bluez_peripheral.gatt.descriptor module

class bluez_peripheral.gatt.descriptor.DescriptorFlags(value)

Bases: Flag

Flags to use when specifying the read/ write routines that can be used when accessing the descriptor. These are converted to bluez flags some of which are not clearly documented.

AUTHORIZE = 256
ENCRYPT_AUTHENTICATED_READ = 16
ENCRYPT_AUTHENTICATED_WRITE = 32
ENCRYPT_READ = 4
ENCRYPT_WRITE = 8
READ = 1

Descriptor may be read.

SECURE_READ = 64
SECURE_WRITE = 128
WRITE = 2

Descriptor may be written to.

class bluez_peripheral.gatt.descriptor.DescriptorReadOptions(options)

Bases: object

Options supplied to descriptor read functions. Generally you can ignore these unless you have a long descriptor (eg > 48 bytes) or you have some specific authorization requirements.

property device

The path of the remote device on the system dbus or None.

The link type.

property offset

A byte offset to use when writing to this descriptor.

class bluez_peripheral.gatt.descriptor.DescriptorWriteOptions(options)

Bases: object

Options supplied to descriptor write functions. Generally you can ignore these unless you have a long descriptor (eg > 48 bytes) or you have some specific authorization requirements.

property device

The path of the remote device on the system dbus or None.

The link type.

property offset

A byte offset to use when writing to this descriptor.

property prepare_authorize

True if prepare authorization request. False otherwise.

class bluez_peripheral.gatt.descriptor.descriptor(uuid: Union[BTUUID, str], characteristic: characteristic, flags: DescriptorFlags = DescriptorFlags.READ)

Bases: ServiceInterface

Create a new descriptor with a specified UUID and flags associated with the specified parent characteristic.

Parameters
  • uuid (Union[UUID, str]) – The UUID of this GATT descriptor. A list of standard ids is provided by the Bluetooth SIG

  • characteristic (characteristic) – The parent characteristic to associate this descriptor with.

  • flags (DescriptorFlags, optional) – Flags defining the possible read/ write behaviour of the attribute.

setter(setter_func: Callable[[bytes, DescriptorWriteOptions], None]) descriptor

A decorator for descriptor value setters.