-
Notifications
You must be signed in to change notification settings - Fork 1k
Can Characteristics have data types? #766
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
Comments
You can add a "Characteristic presentation format" descriptor to the characteristic for for that. |
Please could you point me to the api? |
It looks like it's another 16 bit uuid hex string - does it get appended to the characteristic uuid? |
I haven't used the MicroPython Bluetooth API, I just know BLE in general. I assume it would just be part of https://docs.micropython.org/en/latest/library/bluetooth.html#bluetooth.BLE.gatts_register_services which says:
And you would need to look up the Bluetooth specs to figure out the UUID and the required flags for the "Characteristic presentation format" descriptor to know what values to fill in. |
@dlech You are correct but I think this might be different to what @adrianblakey is asking. I get the impression that what you want is to be able to say that e.g. this characteristic is a temperature, and therefore (e.g. the temp characteristic on the standard environmental service) should be interpreted as a sint16 deci-degrees. i.e. if I There's currently no support for this... I haven't given it a lot of thought yet but I think it would be very useful. Maybe having a library of standard converters, and being able to pass it to the |
@dlech is right, and here are the specs: (see also https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/uuids/)
@adrianblakey you need to create the characteristic with this descriptor (2904)
e.g in binary # FORMAT EXPONENT UNIT NAMESPACE DESCRIPTION
BLE.gatts_write(value_handle, 0b00000110_00000000_0010011100100110_00000000_0000000000000000) |
Is there an api (and does BT allow it) to assign a data type to a Characteristic?
I am creating my own service and characteristics using 128bit UUID's. I'd like to in effect say "this characteristic is an integer" - is that possible?
The text was updated successfully, but these errors were encountered: