Bluetooth: Gatt: Update users of write callback in subscription params

Update the users of the "write" callback in the
bt_gatt_subscribe_params to use the new "subscribe" callback instead.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
This commit is contained in:
Asbjørn Sæbø 2022-04-29 13:07:25 +02:00 committed by Carles Cufí
parent bf361aff21
commit af607bb886
2 changed files with 8 additions and 8 deletions

View file

@ -404,7 +404,7 @@ static uint8_t active_preset_notify_cb(struct bt_conn *conn,
}
static void active_index_subscribe_cb(struct bt_conn *conn, uint8_t att_err,
struct bt_gatt_write_params *params)
struct bt_gatt_subscribe_params *params)
{
struct has_inst *inst = inst_by_conn(conn);
@ -427,7 +427,7 @@ static int active_index_subscribe(struct has_inst *inst, uint16_t value_handle)
BT_DBG("conn %p handle 0x%04x", (void *)inst->conn, value_handle);
inst->active_index_subscription.notify = active_preset_notify_cb;
inst->active_index_subscription.write = active_index_subscribe_cb;
inst->active_index_subscription.subscribe = active_index_subscribe_cb;
inst->active_index_subscription.value_handle = value_handle;
inst->active_index_subscription.ccc_handle = 0x0000;
inst->active_index_subscription.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;
@ -491,7 +491,7 @@ static int active_index_read(struct has_inst *inst)
}
static void control_point_subscribe_cb(struct bt_conn *conn, uint8_t att_err,
struct bt_gatt_write_params *write)
struct bt_gatt_subscribe_params *subscribe)
{
struct has_inst *inst = inst_by_conn(conn);
int err = att_err;
@ -525,7 +525,7 @@ static int control_point_subscribe(struct has_inst *inst, uint16_t value_handle,
BT_DBG("conn %p handle 0x%04x", (void *)inst->conn, value_handle);
inst->control_point_subscription.notify = control_point_notify_cb;
inst->control_point_subscription.write = control_point_subscribe_cb;
inst->control_point_subscription.subscribe = control_point_subscribe_cb;
inst->control_point_subscription.value_handle = value_handle;
inst->control_point_subscription.ccc_handle = 0x0000;
inst->control_point_subscription.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;
@ -654,7 +654,7 @@ static int features_read(struct has_inst *inst, uint16_t value_handle)
}
static void features_subscribe_cb(struct bt_conn *conn, uint8_t att_err,
struct bt_gatt_write_params *params)
struct bt_gatt_subscribe_params *params)
{
struct has_inst *inst = inst_by_conn(conn);
int err = att_err;
@ -722,7 +722,7 @@ static int features_subscribe(struct has_inst *inst, uint16_t value_handle)
BT_DBG("conn %p handle 0x%04x", (void *)inst->conn, value_handle);
inst->features_subscription.notify = features_notify_cb;
inst->features_subscription.write = features_subscribe_cb;
inst->features_subscription.subscribe = features_subscribe_cb;
inst->features_subscription.value_handle = value_handle;
inst->features_subscription.ccc_handle = 0x0000;
inst->features_subscription.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;

View file

@ -76,7 +76,7 @@ static uint8_t notify_func(struct bt_conn *conn,
}
static void notify_enabled(struct bt_conn *conn, uint8_t err,
struct bt_gatt_write_params *params)
struct bt_gatt_subscribe_params *params)
{
struct bt_mesh_gatt_server *server = get_server(conn);
@ -143,7 +143,7 @@ static uint8_t discover_func(struct bt_conn *conn,
(void)memset(&server->subscribe, 0, sizeof(server->subscribe));
server->subscribe.notify = notify_func;
server->subscribe.write = notify_enabled;
server->subscribe.subscribe = notify_enabled;
server->subscribe.value = BT_GATT_CCC_NOTIFY;
server->subscribe.ccc_handle = attr->handle;
server->subscribe.value_handle = attr->handle - 1;