From acf47a683da98ecc3af40e2452b32bd890d4ce83 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Thu, 9 Aug 2012 20:30:32 +0200 Subject: [PATCH] Reset l2cap states at new connection request --- PS3BT.cpp | 1 + SPP.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/PS3BT.cpp b/PS3BT.cpp index 16a40d1e..15651f92 100644 --- a/PS3BT.cpp +++ b/PS3BT.cpp @@ -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)) { pBtd->claimConnection(); // Claim that the incoming connection belongs to this service 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++) remote_name[i] = pBtd->remote_name[i]; // Store the remote name for the connection #ifdef DEBUG diff --git a/SPP.cpp b/SPP.cpp index ba793019..92573d79 100644 --- a/SPP.cpp +++ b/SPP.cpp @@ -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)) { pBtd->claimConnection(); // Claim that the incoming connection belongs to this service 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 } } }