mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-03 23:47:08 +00:00
rfcomm: shut down multiplexer after closing last channel
This commit is contained in:
parent
366f7a2538
commit
5263a2a3e7
@ -2201,6 +2201,15 @@ static void rfcomm_channel_state_machine_with_channel(rfcomm_channel_t *channel,
|
||||
channel->state = RFCOMM_CHANNEL_CLOSED;
|
||||
rfcomm_emit_channel_closed(channel);
|
||||
rfcomm_channel_finalize(channel);
|
||||
// RFCOMM v1.2, 5.2.2. Close-Down Procedure
|
||||
// The device closing the last connection (DLC) on a particular session shall close the
|
||||
// multiplexer by closing the corresponding L2CAP channel.
|
||||
if (rfcomm_multiplexer_has_channels(multiplexer) == false){
|
||||
log_info("Closed last DLC, shut-down multiplexer");
|
||||
uint16_t l2cap_cid = multiplexer->l2cap_cid;
|
||||
rfcomm_multiplexer_finalize(multiplexer);
|
||||
l2cap_disconnect(l2cap_cid);
|
||||
}
|
||||
*out_channel_valid = 0;
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user