bt_device_init()

Initialize the Bluetooth device and allocate the required resources for the library.

Synopsis:

#include <btapi/btdevice.h>
 
int bt_device_init(bt_device_cb callback)

Arguments:

callback

A callback function that is invoked when Bluetooth-specific events arrive. Bluetooth events are prefixed with BT_EVT_.

Library:

libbtapi

Description:

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.

Returns:

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-12-21

comments powered by Disqus