blatann.gatt.writer module
- class blatann.gatt.writer.GattcWriter(ble_device, peer)
Bases:
objectClass which implements the state machine for writing a value to a peripheral’s attribute
- property on_write_complete
Event that is emitted when a write completes on an attribute handler
Handler args: (int attribute_handle, gatt.GattStatusCode, bytearray data_written)
- Returns:
an Event which can have handlers registered to and deregistered from
- Return type:
- write(handle, data)
Writes data to the attribute at the handle provided. Can only write to a single attribute at a time. If a write is in progress, raises an InvalidStateException
- Parameters:
handle – The attribute handle to write
data – The data to write
- Returns:
A Waitable that will fire when the write finishes. see on_write_complete for the values returned from the waitable
- Return type: