bt_le_add_scan_device()

Add the Bluetooth address of the remote device to the advertisement filter list, such as 12:03:40:60:11:21

Synopsis:

#include <btapi/btle.h>
 
int bt_le_add_scan_device(const char *bdaddr, void *userData)

Since:

BlackBerry 10.2.0

Arguments:

bdaddr

The address of the specific Bluetooth-enabled device. You can use the value of BT_LE_BDADDR_ANY to receive advertisements from all Bluetooth-enabled devices.

userData

(Optional) A pointer to user data.

Library:

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

Description:

Adding the address allows your application to receive device advertisement data. The advertisement data is in binary form, which you will need to parse in your application logic. If an error is returned from the function call, the errno is set with reason of failure.

Returns:

EOK on successful addition of a device to the filter list, -1 if an error occurred with the errno value set. These are some of the error codes that can be returned:
  • EAGAIN: The link to the Bluetooth stack is unavailable. You can try again.
  • EBUSY: The requested service is already in use.
  • EINVAL: The Bluetooth MAC address provided is NULL or invalid.
  • ENOMEM: Sufficient memory is not available to perform the request.
  • ESRVRFAULT: An internal error has occurred.