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)

Since:

BlackBerry 10.0.0

Arguments:

callback

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

Library:

libbtapi (For the qcc command, use the -l btapi option to link against this library)

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: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus