bt_disc_retrieve_by_service()

Retrieve a list of Bluetooth-enabled devices based on a specified service.

Synopsis:

#include <btapi/btdevice.h>
 
bt_remote_device_t** bt_disc_retrieve_by_service(const char *service_uuid, int *device_count_ptr)

Since:

BlackBerry 10.0.0

Arguments:

service_uuid

Specifies the Bluetooth service UUID as a printable string.

device_count_ptr

(Optional) A pointer to an integer to store the number of retrieved devices. If you do not want to use this value, provide a value of NULL.

Library:

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

Description:

Returns an array of devices which support the specified service. The following example shows you how to retrieve a list of devices:
 int device_count;
 struct bt_remote_device_t **remote_device_array;
 if( ( remote_device_array = bt_disc_retrieve_by_service("0x1101", &device_count))
                                                                != NULL ) {
    // do work with the devices
    bt_rdev_free_array( remote_device_arry );
  }

Returns:

An allocated, NULL-terminated array of remote device structures upon success, with the errno value set otherwise. Any errno value other than the following indicates that a system error has occurred:
  • EINVAL: An invalid option was passed in.
  • ENOMEM: There was insufficient memory to allocate required structures.

Last modified: 2014-05-14



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

comments powered by Disqus