bt_gatt_srv_send_read_rsp()

Send the response to a read request.

Synopsis:

#include <btapi/btgattsrv.h>
 
int bt_gatt_srv_send_read_rsp(int instance, const char *addr, uint8_t type, uint16_t handle, bt_gatt_srv_att_error_t error, const uint8_t *value, uint16_t len)

Since:

BlackBerry 10.2.0

Arguments:

instance

The instance number representing the local GATT service.

addr

The address of the remote device which the response 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 response is for.

error

Set to BT_ATT_ERROR_NONE if value is valid, otherwise indicate the error that has occurred.

value

The binary data to be sent back to the remote device.

len

The length of data to be sent back to the remote device.

Library:

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

Description:

This can be performed within the bt_gatt_srv_read_request_cb() callback function or from another thread.

Returns:

EOK on a successful response to the remote device, otherwise -1 with the errno set otherwise. The error codes that can be returned are as follows:
  • EBUSY: The stack was busy performing another operation. You can try again later.
  • EINVAL: An argument passed 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: Insufficient memory was available to perform the request.
  • ESRVRFAULT: An internal error has occurred.