Community
cancel
Showing results for 
Search instead for 
Did you mean: 
HHuls
Novice
1,737 Views

Getting the RAW data from a bluetooth LE device

HI,

I am new with the Bluetooth low energy but I am trying to get the raw payload from a Bluetooth LE climate device.

Can somebody help me with some information or example code on how I can get the broadcasted information?

The HCIDUMP RAW I can see the data and the needed CO2 measurements .

Greetings

Han

6 Replies
HHuls
Novice
210 Views

I forgot to mansion that I am trying to write some code in C with BLUEZ

idata
Community Manager
210 Views

Hello Han,

 

 

Thanks for reaching out!

 

 

As you may know, in order to interact with BLE devices you have to use gatttool. BlueZ by default does not include this module, so, usually I would recommend you to install a version of BlueZ that does as explained in https://software.intel.com/en-us/articles/using-the-generic-attribute-profile-gatt-in-bluetooth-low-.... Nevertheless, since you are planning to use BlueZ's API to create a C script, you could find more appropriate to use LibGATT ( https://github.com/jacklund/libgatt) which is simply the same code that gatttool uses but has been bundled into a public library. If you decide to do this, you should take a look at gatt.h ( https://github.com/jacklund/libgatt/blob/master/src/gatt.h), in this file you will find the methods for connect, write, read, etc. This should get you started

 

 

I hope this information helps you,

 

Pedro M.
Bernard_G_Intel
Employee
210 Views

Hello,

Here are some links that may help you:

Note1:To correct Bluetooth compilation errors from docker image (if it has not yet been solved by Intel)

  • Start a bash
  • Type " docker ps " to get your CONTAINER_ID
  • Type " docker exec -it CONTAINER_ID bash" to open a bash in docker container
  • Type " vi /usr/include/bluetooth/bluetooth.h" to correct error in this file
  • Replace the 4 typeof at lines 161, 162, 169 et 170 by __typeof__
  • exit and exit
idata
Community Manager
210 Views

Hello Han,

 

 

Do you have any updates about this?

 

 

Pedro M.
HHuls
Novice
210 Views

Hi Pedro,

it is a by the side project of me and i am still reading into this issue. And I am not sure if I would like to resolv it in scripting or c code. One thing I am sure to use the data of the air mentor I need to decode the raw string sended As a beacon payload.

i am still looking for some example code for the raw payload data. The scanning program for devices and the distance is working fine

kindly regards

Han

idata
Community Manager
210 Views

I understand what you mean, sometimes it involves more trouble to create a C script than a shell script, even though shell scripting is a little bit more complex than C. I would personally try getting done everything manually and if I see that it can be done, I would choose shell scripting. This is because BlueZ's documentation isn't the best, and sometimes, if you are not very familiar with their API, it could be quite challenging to get things done.

 

 

Anyway, if you would like to get examples, you might be interested in contacting BlueZ directly to see if they can help you with this. You can do so in http://www.bluez.org/contact/.

 

 

I hope this helps and I hope to hear from you again. If you ever have any doubts, please don't hesitate to come back to the community, we'll try to help you in any way we can.

 

Pedro M.
Reply