parameters: (self)
docstring: Set communication parameters on opened port.
docstring_summary: Set communication parameters on opened port.
docstring_tokens: Set communication parameters on opened port .
function: def _reconfigurePort(self):
          """Set communication parameters on opened port."""
          if not self._port_handle:
              raise SerialException("Can only operate on a valid port handle")
  
          #~ self._port_handle.ReceivedBytesThreshold = 1
  
          if self._timeout is None:
              self._port_handle.ReadTimeout = System.IO.Ports.SerialPort.InfiniteTimeout
          else:
              self._port_handle.ReadTimeout = int(self._timeout*1000)
  
          # if self._timeout != 0 and self._interCharTimeout is not None:
              # timeouts = (int(self._interCharTimeout * 1000),) + timeouts[1:]
  
          if self._writeTimeout is None:
              self._port_handle.WriteTimeout = System.IO.Ports.SerialPort.InfiniteTimeout
          else:
              self._port_handle.WriteTimeout = int(self._writeTimeout*1000)
  
  
          # Setup the connection info.
          try:
              self._port_handle.BaudRate = self._baudrate
          except IOError, e:
              # catch errors from illegal baudrate settings
              raise ValueError(str(e))
  
          if self._bytesize == FIVEBITS:
              self._port_handle.DataBits     = 5
          elif self._bytesize == SIXBITS:
              self._port_handle.DataBits     = 6
          elif self._bytesize == SEVENBITS:
              self._port_handle.DataBits     = 7
          elif self._bytesize == EIGHTBITS:
              self._port_handle.DataBits     = 8
          else:
              raise ValueError("Unsupported number of data bits: %r" % self._bytesize)
  
          if self._parity == PARITY_NONE:
              self._port_handle.Parity       = getattr(System.IO.Ports.Parity, 'None') # reserved keyword in Py3k
          elif self._parity == PARITY_EVEN:
              self._port_handle.Parity       = System.IO.Ports.Parity.Even
          elif self._parity == PARITY_ODD:
              self._port_handle.Parity       = System.IO.Ports.Parity.Odd
          elif self._parity == PARITY_MARK:
              self._port_handle.Parity       = System.IO.Ports.Parity.Mark
          elif self._parity == PARITY_SPACE:
              self._port_handle.Parity       = System.IO.Ports.Parity.Space
          else:
              raise ValueError("Unsupported parity mode: %r" % self._parity)
  
          if self._stopbits == STOPBITS_ONE:
              self._port_handle.StopBits     = System.IO.Ports.StopBits.One
          elif self._stopbits == STOPBITS_ONE_POINT_FIVE:
              self._port_handle.StopBits     = System.IO.Ports.StopBits.OnePointFive
          elif self._stopbits == STOPBITS_TWO:
              self._port_handle.StopBits     = System.IO.Ports.StopBits.Two
          else:
              raise ValueError("Unsupported number of stop bits: %r" % self._stopbits)
  
          if self._rtscts and self._xonxoff:
              self._port_handle.Handshake  = System.IO.Ports.Handshake.RequestToSendXOnXOff
          elif self._rtscts:
              self._port_handle.Handshake  = System.IO.Ports.Handshake.RequestToSend
          elif self._xonxoff:
              self._port_handle.Handshake  = System.IO.Ports.Handshake.XOnXOff
          else:
              self._port_handle.Handshake  = getattr(System.IO.Ports.Handshake, 'None')
function_tokens: def _reconfigurePort ( self ) : if not self . _port_handle : raise SerialException ( "Can only operate on a valid port handle" ) #~ self._port_handle.ReceivedBytesThreshold = 1 if self . _timeout is None : self . _port_handle . ReadTimeout = System . IO . Ports . SerialPort . InfiniteTimeout else : self . _port_handle . ReadTimeout = int ( self . _timeout * 1000 ) # if self._timeout != 0 and self._interCharTimeout is not None: # timeouts = (int(self._interCharTimeout * 1000),) + timeouts[1:] if self . _writeTimeout is None : self . _port_handle . WriteTimeout = System . IO . Ports . SerialPort . InfiniteTimeout else : self . _port_handle . WriteTimeout = int ( self . _writeTimeout * 1000 ) # Setup the connection info. try : self . _port_handle . BaudRate = self . _baudrate except IOError , e : # catch errors from illegal baudrate settings raise ValueError ( str ( e ) ) if self . _bytesize == FIVEBITS : self . _port_handle . DataBits = 5 elif self . _bytesize == SIXBITS : self . _port_handle . DataBits = 6 elif self . _bytesize == SEVENBITS : self . _port_handle . DataBits = 7 elif self . _bytesize == EIGHTBITS : self . _port_handle . DataBits = 8 else : raise ValueError ( "Unsupported number of data bits: %r" % self . _bytesize ) if self . _parity == PARITY_NONE : self . _port_handle . Parity = getattr ( System . IO . Ports . Parity , 'None' ) # reserved keyword in Py3k elif self . _parity == PARITY_EVEN : self . _port_handle . Parity = System . IO . Ports . Parity . Even elif self . _parity == PARITY_ODD : self . _port_handle . Parity = System . IO . Ports . Parity . Odd elif self . _parity == PARITY_MARK : self . _port_handle . Parity = System . IO . Ports . Parity . Mark elif self . _parity == PARITY_SPACE : self . _port_handle . Parity = System . IO . Ports . Parity . Space else : raise ValueError ( "Unsupported parity mode: %r" % self . _parity ) if self . _stopbits == STOPBITS_ONE : self . _port_handle . StopBits = System . IO . Ports . StopBits . One elif self . _stopbits == STOPBITS_ONE_POINT_FIVE : self . _port_handle . StopBits = System . IO . Ports . StopBits . OnePointFive elif self . _stopbits == STOPBITS_TWO : self . _port_handle . StopBits = System . IO . Ports . StopBits . Two else : raise ValueError ( "Unsupported number of stop bits: %r" % self . _stopbits ) if self . _rtscts and self . _xonxoff : self . _port_handle . Handshake = System . IO . Ports . Handshake . RequestToSendXOnXOff elif self . _rtscts : self . _port_handle . Handshake = System . IO . Ports . Handshake . RequestToSend elif self . _xonxoff : self . _port_handle . Handshake = System . IO . Ports . Handshake . XOnXOff else : self . _port_handle . Handshake = getattr ( System . IO . Ports . Handshake , 'None' )