bt_gatt_srv_send_write_rsp()

Send the response to a write request.

Synopsis:

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

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 the write was successful, otherwise indicate the error that has occurred.

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_write_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.