Reset l2cap states at new connection request

This commit is contained in:
Kristian Lauszus 2012-08-09 20:30:32 +02:00
parent 5a2faf3855
commit acf47a683d
2 changed files with 3 additions and 0 deletions

View file

@ -238,6 +238,7 @@ void PS3BT::ACLData(uint8_t* ACLData) {
if(((ACLData[12] | (ACLData[13] << 8)) == HID_CTRL_PSM) || ((ACLData[12] | (ACLData[13] << 8)) == HID_INTR_PSM)) { if(((ACLData[12] | (ACLData[13] << 8)) == HID_CTRL_PSM) || ((ACLData[12] | (ACLData[13] << 8)) == HID_INTR_PSM)) {
pBtd->claimConnection(); // Claim that the incoming connection belongs to this service pBtd->claimConnection(); // Claim that the incoming connection belongs to this service
hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
l2cap_state = L2CAP_EV_WAIT;
for(uint8_t i = 0; i < 30; i++) for(uint8_t i = 0; i < 30; i++)
remote_name[i] = pBtd->remote_name[i]; // Store the remote name for the connection remote_name[i] = pBtd->remote_name[i]; // Store the remote name for the connection
#ifdef DEBUG #ifdef DEBUG

View file

@ -83,6 +83,8 @@ void SPP::ACLData(uint8_t* l2capinbuf) {
if(((l2capinbuf[12] | (l2capinbuf[13] << 8)) == SDP_PSM) || ((l2capinbuf[12] | (l2capinbuf[13] << 8)) == RFCOMM_PSM)) { if(((l2capinbuf[12] | (l2capinbuf[13] << 8)) == SDP_PSM) || ((l2capinbuf[12] | (l2capinbuf[13] << 8)) == RFCOMM_PSM)) {
pBtd->claimConnection(); // Claim that the incoming connection belongs to this service pBtd->claimConnection(); // Claim that the incoming connection belongs to this service
hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
l2cap_sdp_state = L2CAP_SDP_WAIT; // Reset state
l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT; // Reset state
} }
} }
} }