toio.device_interface package¶
device_interface
Abstraction layer to communicate toio Core Cubes.
The abstract base classes defined are as follows:
ScannerInterface
CubeInterface
- class toio.device_interface.CubeInterface[source]¶
Bases:
object
Interface to communicate to a toio Core Cube.
- abstract async write(uuid: UUID, data: bytes | bytearray | memoryview, response: bool = False) None [source]¶
- class toio.device_interface.CubeInfo(name, device, interface, advertisement)[source]¶
Bases:
NamedTuple
- name: str | None¶
Alias for field number 0
- device: BLEDevice¶
Alias for field number 1
- interface: CubeInterface¶
Alias for field number 2
- advertisement: AdvertisementData¶
Alias for field number 3
- class toio.device_interface.ScannerInterface[source]¶
Bases:
object
Interface to scan toio Core Cubes. This interface is used from toio.scanner.* module.
- abstract async scan(num: int | None = None, cube_id: set[str] | None = None, address: set[str] | None = None, sort: Literal['rssi', 'local_name'] | None = None, timeout: float = 5.0) list[toio.device_interface.CubeInfo] [source]¶