bt_gatt_srv_write_request_cb

The callback prototype to indicate that a remote device has requested to write data to the given handle.

Synopsis:

#include <btapi/btgattsrv.h>
 
typedef void(* bt_gatt_srv_write_request_cb)(int instance, const char *bdaddr, uint8_t type, uint16_t handle, uint8_t offset, bool needRsp, uint8_t *val, uint16_t len, void *userData);

Since:

BlackBerry 10.3.0

Arguments:

instance

The identifier used to reference the service.

bdaddr

The address of the remote Bluetooth device.

type

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

handle

The handle of the attribute which is being written to.

offset

The offset where the write should be performed.

needRsp

If true, a response is needed. Call bt_gatt_srv_send_write_rsp().

val

A pointer to the data sent in the notification.

len

The length of the data sent.

userData

A pointer to the user data that was passed in during the connection request.

Library:

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

Description:

If the write requires a response indicated by needRsp, then you must call bt_gatt_srv_send_write_rsp() to accept or reject the request. This can be done from either within or outside the callback.