I've tried the following:
Code: Select all
_FILES_UUID = bluetooth.UUID("7a890001-e96d-4842-8b3d-69ce27889cd6")
_FILE_COUNT_CHAR = (
bluetooth.UUID("7a890002-e96d-4842-8b3d-69ce27889cd6"),
bluetooth.FLAG_NOTIFY | bluetooth.FLAG_WRITE,
(
(
# org.bluetooth.descriptor.gatt.characteristic_user_description
bluetooth.UUID(0x2901),
bluetooth.FLAG_READ | bluetooth.FLAG_NOTIFY | bluetooth.FLAG_WRITE,
),
)
)
_FILES_SERVICE = (
_FILES_UUID,
(_FILE_COUNT_CHAR,),
)
Code: Select all
class BLE_SERVER:
def __init__(self, ble, name='my_server'):
self._ble = ble
((self._file_count_handle, self._file_desc_handle),) = self._ble.gatts_register_services((_FILES_SERVICE,))
self._ble.gatts_write(self._file_desc_handle, "My Files Description")