Before calling any other Bluetooth functions in btdevice.h, you must initialize the Bluetooth device.
typedef void(* bt_device_cb)(const int event,
const char *bt_addr,
const char *event_data);
When defining your callback, check for all Bluetooth events of interest to make sure
that your operations are successful. All Bluetooth events start with
BT_EVT_, and are defined in btdevice.h.
void myCallback(const int event, // the Bluetooth event
const char *bt_addr, // the Bluetooth MAC address
const char *event_data) // the event data
{
// Perform Bluetooth event handling
// ...
}
bt_device_init(myCallback);