Open vikramdattu opened 11 months ago
@vikramdattu still interested? I was thinking on the improvements to bless. If @kevincar you agree, I will take the subject ;)
@mklemarczyk Absolutely!
@kevincar I have some prototype, I plan to share a PR soon so others can check it for different platforms. I primary work on linux.
I send you first proposal in PR #134 Who wish to help testing on other platforms ? I will need some data to complete implementation.
@vikramdattu @kevincar Simple example with descriptor for service. You can define descriptors for different characteristics and services. As many you like. I use them mostly for static data to notify about unit or refresh rate. Those should not be updated too often.
You can use predefined guid from Bluetooth standard, or define your guid for custom descriptors.
# Simple advertisement service with descriptor.
gatt: Dict = {
weather_service_id: {
temperature_characteristic_id: {
'Properties': (
GATTCharacteristicProperties.read
| GATTCharacteristicProperties.write
),
'Permissions': (
GATTAttributePermissions.readable
| GATTAttributePermissions.writeable
),
'Value': None,
'Descriptors': {
'2901': { # Bluetooth descriptor guid, or your custom 128bit guid
'Properties': (
GATTDescriptorProperties.read
| GATTDescriptorProperties.write
),
'Permissions': (
GATTAttributePermissions.readable
| GATTAttributePermissions.writeable
),
'Value': b'millis', # Static value for descriptor.
}
}
}
}
}
Describe the solution you'd like BlueZ already does have this support, and Bleak supports read
descriptors
propertyAdditional context Many of the applications, use characteristics descriptors. Having the method for this exposed will help a ton.