Bluetooth: Gatt: Added write callback for gatt (un)subscribe
Added a callback that lets an application get write error (if any) when subscribing to a gatt characteristic. Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
This commit is contained in:
parent
d026b5dd34
commit
9bf50ddb20
2 changed files with 6 additions and 0 deletions
|
@ -1401,6 +1401,8 @@ enum {
|
|||
struct bt_gatt_subscribe_params {
|
||||
/** Notification value callback */
|
||||
bt_gatt_notify_func_t notify;
|
||||
/** Subscribe CCC write request response callback */
|
||||
bt_gatt_write_func_t write;
|
||||
/** Subscribe value handle */
|
||||
uint16_t value_handle;
|
||||
/** Subscribe CCC handle */
|
||||
|
|
|
@ -3929,6 +3929,10 @@ static void gatt_write_ccc_rsp(struct bt_conn *conn, uint8_t err,
|
|||
/* Notify with NULL data to complete unsubscribe */
|
||||
params->notify(conn, params, NULL, 0);
|
||||
}
|
||||
|
||||
if (params->write) {
|
||||
params->write(conn, err, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static int gatt_write_ccc(struct bt_conn *conn, uint16_t handle, uint16_t value,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue