From cfbf69338470c3015bb02ce83122cd3ccf065e2e Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Thu, 9 Aug 2012 21:22:55 +0200 Subject: [PATCH] Minor edit --- BTD.cpp | 14 +++++++------- SPP.cpp | 11 ++++------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/BTD.cpp b/BTD.cpp index 2ba6ecdf..add4fe6e 100644 --- a/BTD.cpp +++ b/BTD.cpp @@ -417,24 +417,23 @@ void BTD::HCI_event_task() { case EV_ENCRYPTION_CHANGE: case EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE: break; - +#ifdef EXTRADEBUG default: -#ifdef EXTRADEBUG if(hcibuf[0] != 0x00) { Notify(PSTR("\r\nUnmanaged HCI Event: ")); PrintHex(hcibuf[0]); } + break; #endif - break; } // switch HCI_task(); } - else { #ifdef EXTRADEBUG + else { Notify(PSTR("\r\nHCI event error: ")); PrintHex(rcode); -#endif } +#endif } /* Poll Bluetooth and print result */ @@ -604,12 +603,13 @@ void BTD::ACL_event_task() { for (uint8_t i=0; iACLData(l2capinbuf); - } else if (rcode != hrNAK) { + } #ifdef EXTRADEBUG + else if (rcode != hrNAK) { Notify(PSTR("\r\nACL data in error: ")); PrintHex(rcode); -#endif } +#endif for (uint8_t i=0; iRun(); diff --git a/SPP.cpp b/SPP.cpp index 5034c99f..871ba151 100644 --- a/SPP.cpp +++ b/SPP.cpp @@ -261,15 +261,11 @@ void SPP::ACLData(uint8_t* l2capinbuf) { Serial.print(l2capinbuf[11],HEX); } #endif - } #ifdef PRINTREPORT // Uncomment "#define PRINTREPORT" to print the report send to the Arduino via Bluetooth - if(rfcommChannelType == RFCOMM_UIH && rfcommChannel == rfcommChannelConnection) { - uint8_t length = l2capinbuf[10] >> 1; // Get length - uint8_t offset = l2capinbuf[4]-length-4; // See if there is credit for(uint8_t i = 0; i < length; i++) Serial.write(l2capinbuf[i+11+offset]); - } #endif + } } else { if(rfcommChannelType == RFCOMM_SABM) { // SABM Command - this is sent twice: once for channel 0 and then for the channel to establish #ifdef DEBUG @@ -355,14 +351,15 @@ void SPP::ACLData(uint8_t* l2capinbuf) { #endif } } - } else { + } #ifdef EXTRADEBUG + else { Notify(PSTR("\r\nUnsupported L2CAP Data - Channel ID: ")); PrintHex(l2capinbuf[7]); Notify(PSTR(" ")); PrintHex(l2capinbuf[6]); -#endif } +#endif SDP_task(); RFCOMM_task(); }