LEGO Wireless Protocol v3 device¶
Warning
This is an experimental class. It has not been well tested and may be changed in future.
- class LWP3Device(hub_kind, name=None, timeout=10000)¶
Connects to a hub running official LEGO firmware using the LEGO Wireless Protocol v3
- Parameters:
hub_kind (int) – The hub type identifier of the hub to connect to.
name (str) – The name of the hub to connect to or
None
to connect to any hub.timeout (int) – The time, in milliseconds, to wait for a connection before raising an exception.
- name(name)¶
- name() str
Sets or gets the Bluetooth name of the device.
- Parameters:
name (str) – New Bluetooth name of the device. If no name is given, this method returns the current name.
- awaitwrite(buf)¶
Sends a message to the remote hub.
- Parameters:
buf (bytes) – The raw binary message to send.