Added delay between l2cap disconnection requests

This commit is contained in:
Kristian Lauszus 2012-08-10 01:02:53 +02:00
parent c72c9a4578
commit 7ca5fcf048

View file

@ -72,9 +72,10 @@ void SPP::disconnect(){
// First the two L2CAP channels has to be disconencted and then the HCI connection
if(RFCOMMConnected)
pBtd->l2cap_disconnection_request(hci_handle,0x0A, rfcomm_scid, rfcomm_dcid);
if(RFCOMMConnected && SDPConnected)
delay(1); // Add delay between commands
if(SDPConnected)
pBtd->l2cap_disconnection_request(hci_handle,0x0B, sdp_scid, sdp_dcid);
l2cap_event_flag = 0; // Reset flags
l2cap_sdp_state = L2CAP_DISCONNECT_RESPONSE;
}
void SPP::ACLData(uint8_t* l2capinbuf) {
@ -430,6 +431,7 @@ void SPP::SDP_task() {
RFCOMMConnected = false;
SDPConnected = false;
pBtd->hci_disconnect(hci_handle);
l2cap_event_flag = 0; // Reset flags
l2cap_sdp_state = L2CAP_SDP_WAIT;
l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT;
}