-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to write Descriptors
in advertizement
#118
Comments
@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 send you first proposal in PR #134 |
@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.
}
}
}
}
} |
@12944qwerty Can you please describe setup you use for Windows or Mac ? I can take some time to prepare it on my side and provide implementation. I will be quite busy over March, so it can take a while. |
@mklemarczyk Code would be the exact same as the example (with slight modifications where it won't break). I would also import the GATT dict with the same format you gave above. |
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.
The text was updated successfully, but these errors were encountered: