mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-26 12:35:25 +00:00
disconnect all connections on hci_close, reset state on init
This commit is contained in:
parent
366fab0c58
commit
f5454fc67e
@ -706,6 +706,8 @@ void hci_init(hci_transport_t *transport, void *config, bt_control_t *control, r
|
||||
|
||||
// register packet handlers with transport
|
||||
transport->register_packet_handler(&packet_handler);
|
||||
|
||||
hci_stack.state = HCI_STATE_OFF;
|
||||
}
|
||||
|
||||
void hci_close(){
|
||||
@ -713,6 +715,10 @@ void hci_close(){
|
||||
if (hci_stack.remote_device_db) {
|
||||
hci_stack.remote_device_db->close();
|
||||
}
|
||||
while (hci_stack.connections) {
|
||||
hci_shutdown_connection((hci_connection_t *) hci_stack.connections);
|
||||
}
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
}
|
||||
|
||||
// State-Module-Driver overview
|
||||
|
@ -82,10 +82,14 @@ static int l2cap_channel_ready_for_open(l2cap_channel_t *channel);
|
||||
|
||||
|
||||
void l2cap_init(){
|
||||
|
||||
new_credits_blocked = 0;
|
||||
signaling_responses_pending = 0;
|
||||
|
||||
l2cap_channels = NULL;
|
||||
l2cap_services = NULL;
|
||||
|
||||
packet_handler = null_packet_handler;
|
||||
|
||||
//
|
||||
// register callback with HCI
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user