Perform a Generic Attribute (GATT) call to retrieve a list of characteristics asynchronously for a provided primary service.
Synopsis:
#include <btapi/btgatt.h>
int bt_gatt_characteristics_async(int instance, bt_gatt_characteristics_cb cb, void *user_data)
Arguments:
- instance
-
The identifier used to reference the connected primary service.
- cb
-
The callback function to be executed when the operation has completed.
- user_data
-
A user specified pointer that is returned during the callback.
Library:
libbtapi (For the qcc command, use the -l btapi option to link against this library)
Returns:
The number of included services that have been retrieved when the function is successfully completed,
-1 with the
errno set otherwise. The error codes that can be returned are as follows:
- EACCESS: Insufficient authentication or authorization.
- EINVAL: Invalid stack parameters or connection to the remote Bluetooth-enabled device is not available.
- ENOMEM: Insufficient memory to perform the request.
- ESRCH: The service connection was not available.
- ESRVRFAULT: An internal error has occurred.