bt_gatt_reg_notifications()

Register a callback to notify of Generic Attribute (GATT) events that occur.

Synopsis:

#include <btapi/btgatt.h>
 
int bt_gatt_reg_notifications(int instance, bt_gatt_notifications_cb notify)

Since:

BlackBerry 10.0.0

Arguments:

instance

The identifier used to reference the connected primary service.

notify

The callback to call when an event occurs. Use a value of NULL to clear a callback that is registered to a primary service.

Library:

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

Description:

This function notifies you when both notification and indication events occur. You must pass in the handle to the primary service. You can pass a value of NULL to the notify argument to clear a callback that you previously registered.

Returns:

EOK when a notification has been successfully registered or cleared, -1 with the errno set otherwise. The error codes that can be returned are as follows:
  • EDEADLK: A potential deadlock has been avoided.
  • ENODEV: Unable to find the service connection defined by the instance argument.
  • EINVAL: An invalid argument was passed to the function.
  • ENOENT: An invalid handle was provided for the GATT server.
  • ESRCH: The service connection was not available.