# serialtools.bus module

class serialtools.bus.BusCreator

  Bases: `object`

  add_arguments(parser: ArgumentParser, *, rx_only: bool = False) → None
  baudrate

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  bytesize

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  create_args(*, port: str | None = None, baudrate: int | None = None, virtual: bool | None = None) → Namespace
  create_bus(args: Namespace) → Serial | ReadFromFileBus | WriteToFileBus
  dsrdtr

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  parity

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  port

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  rtscts

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  stopbits

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  virtual

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  vport

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

  xonxoff

    Each instance of this class represents a setting which can be changed in a config file.

    This class implements the descriptor protocol to return `value` if an instance of this class is accessed as an instance attribute. If you want to get this object you need to access it as a class attribute.

class serialtools.bus.ReadFromFileBus(fn: str)

  Bases: `object`

  Parameters:

    fn – file name of file containing data to be read. Data is in the output format of serialtools dump, hex values separated by spaces and optionally lines starting with a time stamps in parentheses.

  cancel_read() → None
  cancel_write() → None
  close() → None
  read(n: int) → bytes
  timestamp: datetime | None = None
  write(data: bytes) → None

class serialtools.bus.ReadFromParameterBus(content: str)

  Bases: `ReadFromFileBus`

  Parameters:

    fn – file name of file containing data to be read. Data is in the output format of serialtools dump, hex values separated by spaces and optionally lines starting with a time stamps in parentheses.

class serialtools.bus.WriteToFileBus(f: str | TextIO | None, *, break_time_ms: int)

  Bases: `object`

  cancel_read() → None
  cancel_write() → None
  close() → None
  read(n: int) → bytes
  timestamp: datetime | None = None
  write(data: bytes) → None

serialtools.bus.get_timestamp(bus: Serial | ReadFromFileBus | WriteToFileBus) → datetime | None