Minor edit

This commit is contained in:
Kristian Lauszus 2012-08-09 21:22:55 +02:00
parent e55e78450b
commit cfbf693384
2 changed files with 11 additions and 14 deletions

14
BTD.cpp
View file

@ -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<uint8_t>(hcibuf[0]);
}
break;
#endif
break;
} // switch
HCI_task();
}
else {
#ifdef EXTRADEBUG
else {
Notify(PSTR("\r\nHCI event error: "));
PrintHex<uint8_t>(rcode);
#endif
}
#endif
}
/* Poll Bluetooth and print result */
@ -604,12 +603,13 @@ void BTD::ACL_event_task() {
for (uint8_t i=0; i<BTD_NUMDEVICES; i++)
if (btService[i])
btService[i]->ACLData(l2capinbuf);
} else if (rcode != hrNAK) {
}
#ifdef EXTRADEBUG
else if (rcode != hrNAK) {
Notify(PSTR("\r\nACL data in error: "));
PrintHex<uint8_t>(rcode);
#endif
}
#endif
for (uint8_t i=0; i<BTD_NUMDEVICES; i++)
if (btService[i])
btService[i]->Run();

11
SPP.cpp
View file

@ -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<uint8_t>(l2capinbuf[7]);
Notify(PSTR(" "));
PrintHex<uint8_t>(l2capinbuf[6]);
#endif
}
#endif
SDP_task();
RFCOMM_task();
}