Initialize the Bluetooth device and allocate the required resources for the library.
int bt_device_init(bt_device_cb callback)
A callback function that is invoked when Bluetooth-specific events arrive. Bluetooth events are prefixed with BT_EVT_.
This function also starts a new thread. The callback is invoked in the new thread and is thread safe. This function must be called before you call any other functions in this file. A corresponding call to the bt_device_deinit() function must be made when you have completed using functionality from this file.
0 is returned upon success, -1 with the errno set otherwise. Any errno value other than the following indicates that a system error has occurred:
- EINVAL: bt_device_init() has already been called.
- ENOMEM: There was insufficient memory to allocate required structures.
Last modified: 2013-09-30