Beginner Question:
I'd like to use the BlueZ driver in my Raspberry Pi for a simple way to connect to an iPhone app I'm writing, but I'm trying to prototype it first on my Ubuntu boot (I dual boot a macbook pro w/ macOS sierra/Ubuntu 16.04). I am having trouble getting the bluetooth header "bluetooth.h" to show up in my c program. I've tried doing sudo apt-get install bluez, but no bluetooth.h header shows up in my system after I perform this command. Here are the includes for my prototype application:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
when I gcc
the program, I link to -lbluetooth
, but my system can't find that lib either.
I should be using BlueZ for this, right? I've read that BlueZ is the official bluetooth stack for Linux, and I plan to put Raspbian Jesse on my raspberry pi; I'm just sanity checking that I'm on the right path.
http://docs.cubieboard.org/tutorials/common/development/bluez_programming
Looks like this tutorial had the answers, sudo apt-get install bluez
installed the driver, but not the related development headers.
Instead use sudo apt-get install bluez libbluetooth-dev
.
Now -lbluetooth
is found as a lib.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With