mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 09:35:42 +00:00
use L2CAP_STATE_WILL_SEND_DISCONNECT_REQUEST on client connection close
This commit is contained in:
parent
e7ff783c33
commit
cb8eb7e69e
@ -570,6 +570,8 @@ void l2cap_signaling_handler_channel(l2cap_channel_t *channel, uint8_t *command)
|
|||||||
case 0:
|
case 0:
|
||||||
// successful connection
|
// successful connection
|
||||||
channel->remote_cid = READ_BT_16(command, L2CAP_SIGNALING_COMMAND_DATA_OFFSET);
|
channel->remote_cid = READ_BT_16(command, L2CAP_SIGNALING_COMMAND_DATA_OFFSET);
|
||||||
|
|
||||||
|
|
||||||
channel->sig_id = l2cap_next_sig_id();
|
channel->sig_id = l2cap_next_sig_id();
|
||||||
config_options[0] = 1; // MTU
|
config_options[0] = 1; // MTU
|
||||||
config_options[1] = 2; // len param
|
config_options[1] = 2; // len param
|
||||||
@ -873,9 +875,7 @@ void l2cap_close_connection(void *connection){
|
|||||||
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
||||||
channel = (l2cap_channel_t *) it;
|
channel = (l2cap_channel_t *) it;
|
||||||
if (channel->connection == connection) {
|
if (channel->connection == connection) {
|
||||||
channel->sig_id = l2cap_next_sig_id();
|
channel->state = L2CAP_STATE_WILL_SEND_DISCONNECT_REQUEST;
|
||||||
l2cap_send_signaling_packet( channel->handle, DISCONNECTION_REQUEST, channel->sig_id, channel->remote_cid, channel->local_cid);
|
|
||||||
channel->state = L2CAP_STATE_WAIT_DISCONNECT;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -890,5 +890,8 @@ void l2cap_close_connection(void *connection){
|
|||||||
it = it->next;
|
it = it->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// process
|
||||||
|
l2cap_run();
|
||||||
}
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user