-
Notifications
You must be signed in to change notification settings - Fork 58
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
Characteristics formats and extensions #92
Comments
i dont know how to use or do that
Sent from Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Yohann ***@***.***>
Sent: Monday, November 21, 2022 9:49:39 PM
To: NordicSemiconductor/bluetooth-numbers-database ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [NordicSemiconductor/bluetooth-numbers-database] Characteristics formats and extensions (Issue #92)
Hi, I started adding two fields in the file characteristic_uuid.json
* format to specify how the value should be displayed (printf style %d %s ...)
* extension to specify the units of the value.
Both are optional and non related.
I only modified a few for now, and it looks like this
{ "name": "Aerobic Heart Rate Lower Limit", "identifier": "org.bluetooth.characteristic.aerobic_heart_rate_lower_limit", "uuid": "2A7E" , "source": "gss", "format": "%d", "extension": "bpm"},
{ "name": "Aerobic Heart Rate Upper Limit", "identifier": "org.bluetooth.characteristic.aerobic_heart_rate_upper_limit", "uuid": "2A84" , "source": "gss", "format": "%d", "extension": "bpm"},
{ "name": "Aerobic Threshold", "identifier": "org.bluetooth.characteristic.aerobic_threshold", "uuid": "2A7F" , "source": "gss", "format": "%d", "extension": "bpm"},
{ "name": "Battery Level", "identifier": "org.bluetooth.characteristic.battery_level", "uuid": "2A19" , "source": "gss", "format": "%d", "extension": "%"},
{ "name": "Firmware Revision String", "identifier": "org.bluetooth.characteristic.firmware_revision_string", "uuid": "2A26", "source": "gss", "format": "%s" },
{ "name": "First Name", "identifier": "org.bluetooth.characteristic.first_name", "uuid": "2A8A", "source": "gss", "format": "%s"},
{ "name": "Latitude", "identifier": "org.bluetooth.characteristic.latitude", "uuid": "2AAE", "source": "gss", "format": "%.2f", "extension": "°"},
{ "name": "Longitude", "identifier": "org.bluetooth.characteristic.longitude", "uuid": "2AAF", "source": "gss", "format": "%.2f", "extension": "°" },
What are your thoughts on this ? Would you be interested for a PR ?
Thanks
—
Reply to this email directly, view it on GitHub<#92>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3B4SZ55ID3ZWCRUYUUOZWTWJOY3HANCNFSM6AAAAAASG424YI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
How to use or what to do is up to whoever use this json. The reason to add these fields is that these values are standard and many applications could benefits from a simple hint of how to print them. |
I think this is interesting. But we'd have to bump the API version, so instead of everything being inside /v1 it should be /v2. @bencefr what do you think? |
This is more specific but something like a 'map' field with the meaning of the value (when possible) could also be useful when the value refers to something. For example in the HRS service there is the Body Sensor Location which is a single byte representing the place where is the sensor. It could look like this in the json { "name": "Body Sensor Location", "identifier": "org.bluetooth.characteristic.body_sensor_location", "uuid": "2A38" , "source": "gss", "map": ["other", "chest", "wrist", "finger", "hand", "ear_lobe", "foot"]},
And the value of the characteristic could be used as an index to find the readable value directly. |
And for multi bytes values the format could also be used with multiple format specifiers For the Date of Birth characteristic it could look like this { "name": "Date of Birth","identifier": "org.bluetooth.characteristic.date_of_birth", "uuid": "2A85" , "source": "gss", "format": "%d/%d/%d" }, |
This project tried something similar https://github.com/sputnikdev/bluetooth-gatt-parser with Java and characteristics defined in xml files. For the above example of the Body Sensor Location the xml file is: <?xml version="1.0" encoding="UTF-8"?><!-- Copyright 2011 Bluetooth SIG, Inc. All rights reserved. -->
<Characteristic xsi:noNamespaceSchemaLocation="http://schemas.bluetooth.org/Documents/characteristic.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
type="org.bluetooth.characteristic.body_sensor_location" uuid="2A38" name="Body Sensor Location">
<InformativeText></InformativeText>
<Value>
<Field name="Body Sensor Location">
<Requirement>Mandatory</Requirement>
<Format>8bit</Format>
<Enumerations>
<Enumeration key="0" value="Other"/>
<Enumeration key="1" value="Chest"/>
<Enumeration key="2" value="Wrist"/>
<Enumeration key="3" value="Finger"/>
<Enumeration key="4" value="Hand"/>
<Enumeration key="5" value="Ear Lobe"/>
<Enumeration key="6" value="Foot"/>
<ReservedForFutureUse start="7" end="255"/>
</Enumerations>
</Field>
</Value>
</Characteristic>
Footer
|
Hi, I started adding two fields in the file characteristic_uuid.json
Both are optional and non related.
I only modified a few for now, and it looks like this
What are your thoughts on this ? Would you be interested for a PR ?
Thanks
The text was updated successfully, but these errors were encountered: