11 Replies Latest reply on May 16, 2017 10:59 AM by Intel Corporation

    Programming Bluetooth with C - Where Are the BT Header Files?


      I have in front of me what looks like an interesting example of Bluetooth socket programming in C that I would really like to explore:


      Bluetooth programming in C with BlueZ


      I would really like to build this thing and give it a try but GCC can't find:


      #include <bluetooth/bluetooth.h>

      #include <bluetooth/hci.h>

      #include <bluetooth/hci_lib.h>


      Neither can I, and I have spent the afternoon trying. Not all afternoon, the other part of the afternoon what spent trying to find out how to locate and install the bluetooth development files which are supposed to contain said header files.


      Note: Someone in a Linux form, addressing another member with the same problem, suggested that trying to import the library using the "sudo apt-get" command. Is it just me, or is "apt-get" not recognized under this linux? ("uname -r" says it is "3.10.98-poky-edison").


      I have spent a considerable chunk of time getting the python "SPP-loopbak" program sort of working over the past few days, but I was looking for alternatives because I am finding that bluetooth virtual COM ports are extremely grouchy in Windows (and I have no choice of host interface, I must support all Windows version from 7 to 10). I had it working on my desktop (Window 7) but my laptop running 8.1 just would not open that port, no way, no how.


      Ultimately, I need a reliable Bluetooth connection between Windows and Edison and I will not be using Python. I will be using C and C++. I will not be treating this connection like some kind of advanced human interface device or multi-media thing. Once a connection is established, every byte between host and Edison will be under program control.


      Thank you,