disconnect all connections on hci_close, reset state on init

This commit is contained in:
matthias.ringwald 2011-10-19 17:28:46 +00:00
parent 366fab0c58
commit f5454fc67e
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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
//