parameters: (self, b)
docstring: Write to port, controlling RTS before and after transmitting.
docstring_summary: Write to port, controlling RTS before and after transmitting.
docstring_tokens: Write to port controlling RTS before and after transmitting .
function: def write(self, b):
          """Write to port, controlling RTS before and after transmitting."""
          if self._alternate_rs485_settings is not None:
              # apply level for TX and optional delay
              self.setRTS(self._alternate_rs485_settings.rts_level_for_tx)
              if self._alternate_rs485_settings.delay_before_tx is not None:
                  time.sleep(self._alternate_rs485_settings.delay_before_tx)
              # write and wait for data to be written
              super(RS485, self).write(b)
              super(RS485, self).flush()
              # optional delay and apply level for RX
              if self._alternate_rs485_settings.delay_before_rx is not None:
                  time.sleep(self._alternate_rs485_settings.delay_before_rx)
              self.setRTS(self._alternate_rs485_settings.rts_level_for_rx)
          else:
              super(RS485, self).write(b)
function_tokens: def write ( self , b ) : if self . _alternate_rs485_settings is not None : # apply level for TX and optional delay self . setRTS ( self . _alternate_rs485_settings . rts_level_for_tx ) if self . _alternate_rs485_settings . delay_before_tx is not None : time . sleep ( self . _alternate_rs485_settings . delay_before_tx ) # write and wait for data to be written super ( RS485 , self ) . write ( b ) super ( RS485 , self ) . flush ( ) # optional delay and apply level for RX if self . _alternate_rs485_settings . delay_before_rx is not None : time . sleep ( self . _alternate_rs485_settings . delay_before_rx ) self . setRTS ( self . _alternate_rs485_settings . rts_level_for_rx ) else : super ( RS485 , self ) . write ( b )