bibliopixel.drivers.serial.devices module

class bibliopixel.drivers.serial.devices.Devices(hardware_id, baudrate)[source]

Bases: object

Manage a list of serial devices.

Parameters:
  • hardware_id (str) – A valid USB VID:PID pair such as “1D50:60AB”
  • baudrate (int) – Baud rate to connect to serial device
error(fail=True, action='')[source]

SHOULD BE PRIVATE METHOD

find_serial_devices()[source]

Scan and report all compatible serial devices on system.

Returns:List of discovered devices
get_device(id=None)[source]

Returns details of either the first or specified device

Parameters:id (int) – Identifier of desired device. If not given, first device found will be returned
Returns tuple:Device ID, Device Address, Firmware Version
get_device_id(dev, baudrate=921600)[source]

Get device ID at given address/path.

Parameters:
  • dev (str) – Serial device address/path
  • baudrate – Baudrate to use when connecting (optional)
set_device_id(dev, id, baudrate=921600)[source]

Set device ID to new value.

Parameters:
  • dev (str) – Serial device address/path
  • id – Device ID to set
  • baudrate – Baudrate to use when connectinh (optional)