Skip to content

Commit 858ed0e

Browse files
ekohandelkartben
authored andcommitted
bt: services: ots: l2cap close handling for read
Ensure OTS current object is returned to idle state when an L2CAP connection is closed. Signed-off-by: Abe Kohandel <[email protected]>
1 parent 7a30d5d commit 858ed0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/bluetooth/services/ots/ots_oacp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ LOG_MODULE_DECLARE(bt_ots, CONFIG_BT_OTS_LOG_LEVEL);
2929
#if defined(CONFIG_BT_OTS_OACP_WRITE_SUPPORT)
3030
static ssize_t oacp_write_proc_cb(struct bt_gatt_ots_l2cap *l2cap_ctx,
3131
struct bt_conn *conn, struct net_buf *buf);
32+
#endif
3233

3334
static void oacp_l2cap_closed(struct bt_gatt_ots_l2cap *l2cap_ctx,
3435
struct bt_conn *conn)
@@ -45,7 +46,6 @@ static void oacp_l2cap_closed(struct bt_gatt_ots_l2cap *l2cap_ctx,
4546
l2cap_ctx->rx_done = NULL;
4647
l2cap_ctx->tx_done = NULL;
4748
}
48-
#endif
4949

5050
#if defined(CONFIG_BT_OTS_OACP_CREATE_SUPPORT)
5151
static enum bt_gatt_ots_oacp_res_code oacp_create_proc_validate(
@@ -506,6 +506,7 @@ static void oacp_read_proc_cb(struct bt_gatt_ots_l2cap *l2cap_ctx,
506506
}
507507

508508
ots->l2cap.tx_done = oacp_read_proc_cb;
509+
ots->l2cap.closed = oacp_l2cap_closed;
509510
err = bt_gatt_ots_l2cap_send(&ots->l2cap, obj_chunk, len);
510511
if (err) {
511512
LOG_ERR("L2CAP CoC error: %d while trying to execute OACP "

0 commit comments

Comments
 (0)