Hi All,
Sorry if this is a newbie question...
I've explored BLE Explorer and BLE Scan.. and even tweaked these a little and got some awesome results.. I'm getting service and characteristic data!
My device is a WICED-Sense kit, which has 5 sensors built into it (pretty cool; e.g. gyroscope, accelerometer, temperature, etc) - I'm still hunting for documentation that maps the UUIDs to the specific sensors that I'm interested in, but in the meantime - how can read the data from the characteristic? In other words, I'm getting back what looks like encoded data:
Example
LOG: Characteristic:
LOG: UUID: 00002a24-0000-1000-8000-00805f9b34fb
LOG: Data: 0001%00%00%00%00
LOG: Characteristic:
LOG: UUID: 00002a23-0000-1000-8000-00805f9b34fb
LOG: Data: %A5%DC%BD%C1%8B%06%89%85
..how can I read what the "data" values are? ...I tried "fromUtf8" and eventually started to get URI Malformed errors...
Any thoughts? --thanks, Mike
Reading Characteristic Data
Re: Reading Characteristic Data
Hi!
Look into the WICED-Sense kit iOS app's source code and see if you can find the answer of how the data is coded. You can find the source code here: http://community.broadcom.com/docs/DOC-1648
Additionally there might be some documentation regarding it at http://community.broadcom.com/community ... on/content . I looked around a bit for documentation but didn't find any.
You need to be registered on the WICED Community to get access to these pages, register here if you didn't already: http://community.broadcom.com/login.jsp ... rOnly=true
Look into the WICED-Sense kit iOS app's source code and see if you can find the answer of how the data is coded. You can find the source code here: http://community.broadcom.com/docs/DOC-1648
Additionally there might be some documentation regarding it at http://community.broadcom.com/community ... on/content . I looked around a bit for documentation but didn't find any.
You need to be registered on the WICED Community to get access to these pages, register here if you didn't already: http://community.broadcom.com/login.jsp ... rOnly=true
Hacker, tinkerer
EvoThings
EvoThings
Re: Reading Characteristic Data
you may want to take a look at these pages:
https://developer.bluetooth.org/gatt/ch ... sHome.aspx
http://www.spinics.net/lists/linux-blue ... 31603.html
https://github.com/grundid/bletools/blo ... attDb.java
those are the two characteristics you mention - it seems there is a standard set of UUID's within GATT definition - so this is what these two characteristics represent. you can find out a lot more about the specific characteristics you mentioned here:
https://developer.bluetooth.org/gatt/ch ... tem_id.xml
https://developer.bluetooth.org/gatt/ch ... string.xml
in regards to the information stored - it looks like your tool is reaching back the data and doing a URL encoding of the raw data stream.
means
it then needs to be mapped to the specific BT data values:
you may have to check exactly the rules for endianess however, i couldn't find that at first glance.
hopefully that answers your questions!
https://developer.bluetooth.org/gatt/ch ... sHome.aspx
http://www.spinics.net/lists/linux-blue ... 31603.html
https://github.com/grundid/bletools/blo ... attDb.java
Code: Select all
{ "00002a24-0000-1000-8000-00805f9b34fb", "Model Number String" },
{ "00002a23-0000-1000-8000-00805f9b34fb", "System ID" },
those are the two characteristics you mention - it seems there is a standard set of UUID's within GATT definition - so this is what these two characteristics represent. you can find out a lot more about the specific characteristics you mentioned here:
https://developer.bluetooth.org/gatt/ch ... tem_id.xml
https://developer.bluetooth.org/gatt/ch ... string.xml
in regards to the information stored - it looks like your tool is reaching back the data and doing a URL encoding of the raw data stream.
Code: Select all
%A5%DC%BD%C1%8B%06%89%85
means
Code: Select all
data[] = 0xa5, 0xdc, 0xbd, 0xc1, 0x8d, 0x06, 0x89, 0x85
it then needs to be mapped to the specific BT data values:
Code: Select all
system id
.manufacturer_id = 0xa5dcbdc18d
.organization_uniq_id = 0x068985
you may have to check exactly the rules for endianess however, i couldn't find that at first glance.
hopefully that answers your questions!
Re: Reading Characteristic Data
Thanks Guys - both replies were helpful in giving me clues about what I needed..
In case anyone else is interested in WICED-sense; the interesting UUIDs are (obtained from the WICED sense community site):
..For grabbing data, I found that if I ran the raw data returned from the device through Int8Array() I got the values I needed
Cheers.
In case anyone else is interested in WICED-sense; the interesting UUIDs are (obtained from the WICED sense community site):
Code: Select all
Primary Service UUID: 739298b6-87b6-4984-a5dc-bdc18b068985
Notification Descriptor UUID: 00002902-0000-1000-8000-00805f9b34fb
Data Characteristic UUID: 33ef9113-3b55-413e-b553-fea1eaada459
..For grabbing data, I found that if I ran the raw data returned from the device through Int8Array() I got the values I needed
Code: Select all
new Int8Array(data)
Cheers.
Re: Reading Characteristic Data
Great findings, thanks for reporting!
I usually use Uint8Array, which might be safer if you rely on getting unsigned byte values.
Best regards, Mikael
I usually use Uint8Array, which might be safer if you rely on getting unsigned byte values.
Best regards, Mikael
Return to “Questions and answers”
Who is online
Users browsing this forum: No registered users and 9 guests