parameters: (self)
docstring: \
          Open port with current settings. This may throw a SerialException
          if the port cannot be opened.
docstring_summary: \
          Open port with current settings. This may throw a SerialException
          if the port cannot be opened.
docstring_tokens: \ Open port with current settings . This may throw a SerialException if the port cannot be opened .
function: def open(self):
          """\
          Open port with current settings. This may throw a SerialException
          if the port cannot be opened.
          """
          if self._port is None:
              raise SerialException("Port must be configured before it can be used.")
          if self.is_open:
              raise SerialException("Port is already open.")
          try:
              self._port_handle = System.IO.Ports.SerialPort(self.portstr)
          except Exception as msg:
              self._port_handle = None
              raise SerialException("could not open port %s: %s" % (self.portstr, msg))
  
          # if RTS and/or DTR are not set before open, they default to True
          if self._rts_state is None:
              self._rts_state = True
          if self._dtr_state is None:
              self._dtr_state = True
  
          self._reconfigure_port()
          self._port_handle.Open()
          self.is_open = True
          if not self._dsrdtr:
              self._update_dtr_state()
          if not self._rtscts:
              self._update_rts_state()
          self.reset_input_buffer()
function_tokens: def open ( self ) : if self . _port is None : raise SerialException ( "Port must be configured before it can be used." ) if self . is_open : raise SerialException ( "Port is already open." ) try : self . _port_handle = System . IO . Ports . SerialPort ( self . portstr ) except Exception as msg : self . _port_handle = None raise SerialException ( "could not open port %s: %s" % ( self . portstr , msg ) ) # if RTS and/or DTR are not set before open, they default to True if self . _rts_state is None : self . _rts_state = True if self . _dtr_state is None : self . _dtr_state = True self . _reconfigure_port ( ) self . _port_handle . Open ( ) self . is_open = True if not self . _dsrdtr : self . _update_dtr_state ( ) if not self . _rtscts : self . _update_rts_state ( ) self . reset_input_buffer ( )