bt_gatt_srv_send_notification_async()

Send a notification asynchronously to the remote device.

Synopsis:

#include <btapi/btgattsrv.h>
 
int bt_gatt_srv_send_notification_async(int instance, const char *addr, uint8_t type, uint16_t handle, const uint8_t *val, uint16_t len, bt_gatt_srv_send_notification_cb cb, void *user_data)

Since:

BlackBerry 10.3.0

Arguments:

instance

The instance number representing the local GATT service.

addr

The address of the remote device which the notification is to be sent to.

type

The device type identifier. Refer to constants prefixed with BT_DEVICE_TYPE_.

handle

The handle of the attribute that the notification belongs to.

val

The binary data being sent in the notification.

len

The length of the data to be sent in the notification.

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:

EOK on a successful notification to the remote device, otherwise, -1 with the errno set. The error codes that can be returned are as follows:
  • EBUSY: The stack was busy performing another operation. You can try again later.
  • EDEADLK: A potential deadlock has been avoided.
  • EINVAL: An argument is invalid or the connection to the remote Bluetooth-enabled device is unavailable.
  • ENODEV: Unable to find the service connection defined by the instance argument.
  • ENOMEM: Sufficient memory was not available to perform the request.
  • ESRVRFAULT: An internal error has occurred.