att_dispatch: fix handling of l2cap close

This commit is contained in:
Matthias Ringwald 2023-09-29 20:12:46 +02:00
parent 6737be29e2
commit d4c00e3dbb

View File

@ -218,7 +218,7 @@ static void att_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
break; break;
case L2CAP_EVENT_CHANNEL_CLOSED: case L2CAP_EVENT_CHANNEL_CLOSED:
// clear l2cap_cid in att_server // clear l2cap_cid in att_server
l2cap_cid = l2cap_event_incoming_connection_get_handle(packet); l2cap_cid = l2cap_event_channel_closed_get_local_cid(packet);
att_server = att_dispatch_att_server_for_l2cap_cid(l2cap_cid); att_server = att_dispatch_att_server_for_l2cap_cid(l2cap_cid);
att_server->l2cap_cid = 0; att_server->l2cap_cid = 0;
// dispatch to all roles // dispatch to all roles