BluezDbus Characteristic¶
References for this implementation of a Bluez Characteristic using dbus-next
GATT Characteristic: https://gitlab.com/allthenticate/dependencies/bluez/-/blob/master/doc/gatt-api.txt BLE Core Specification: https://www.bluetooth.com/specifications/specs/core-specification/
- class able.bluezdbus.characteristic.BlueZCharacteristicFlags(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
enum.EnumEnum for possible characteristic flags and permissions
- AUTHENTICATED_SIGNED_WRITES = 'authenticated_signed_writes'¶
- AUTHORIZE = 'authorize'¶
- BROADCAST = 'broadcast'¶
- ENCRYPT_AUTHENTICATED_READ = 'encrypt_authenticated_read'¶
- ENCRYPT_AUTHENTICATED_WRITE = 'encrypt_authenticated_write'¶
- ENCRYPT_READ = 'encrypt_read'¶
- ENCRYPT_WRITE = 'encrypt_write'¶
- EXTENDED_PROPERTIES = 'extended_properties'¶
- INDICATE = 'indicate'¶
- NOTIFY = 'notify'¶
- READ = 'read'¶
- RELIABLE_WRITE = 'reliable_write'¶
- SECURE_READ = 'secure_read'¶
- SECURE_WRITE = 'secure_write'¶
- WRITABLE_AUXILIARIES = 'writable_auxiliaries'¶
- WRITE = 'write'¶
- WRITE_WITHOUT_RESPONSE = 'write_without_response'¶
- class able.bluezdbus.characteristic.BluezCharacteristic(characteristic_uuid, *, value=b'', flags=None, nickname=None, notify_on_write=False)[source]¶
Bases:
able.characteristic.ABleCharacteristic,dbus_next.service.ServiceInterfaceClass implementation of a BlE GATT Characteristic using Dbus-Next
- async broadcast(data)[source]¶
Broadcast characteristic’s new value to every subscribed central
- Parameters
data (
Union[bytes,str]) – the data to notify the centrals on- Return type
None
- async notify_central_of_change(central, data, *args)[source]¶
Makes a bluez call to notify only one central of a change to this characteristic.
- Parameters
central (
ABleCentral) – the central to notify or indicate to with the new datadata (
bytes) – the data to ‘send’ to the central by setting the value of this characteristic to and notifying only that central
- Return type
None- Returns
None
- property path: str¶
Path property, raises an exception if not properly defined
- Return type
str