toio.device_interface.ble module

BLE device interface

class toio.device_interface.ble.BleCube(device: BLEDevice | str)[source]

Bases: CubeInterface

Cube interface for internal BLE interface.

__init__(device: BLEDevice | str)[source]
async connect() bool[source]
async disconnect() bool[source]
async read(char_uuid: UUID) bytearray[source]
async write(char_uuid: UUID, data: bytes | bytearray | memoryview, response: bool = False)[source]
async register_notification_handler(char_uuid: UUID, notification_handler: Callable[[BleakGATTCharacteristic, bytearray], None | Awaitable[None]]) bool[source]
async unregister_notification_handler(char_uuid: UUID) bool[source]
is_connect() bool[source]

Implemented in v1.1.0 or later

get current connection state

class toio.device_interface.ble.BaseBleScanner[source]

Bases: ScannerInterface

BleScanner Scanner for internal BLE interface.

__init__()[source]
async scan(*args, **kwargs) List[CubeInfo][source]