mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Removed return
This commit is contained in:
parent
7a867e68ed
commit
55ba0911fb
2 changed files with 21 additions and 24 deletions
3
BTD.cpp
3
BTD.cpp
|
@ -273,7 +273,6 @@ void BTD::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto
|
|||
if(pollInterval < pep->bInterval) // Set the polling interval as the largest polling interval obtained from endpoints
|
||||
pollInterval = pep->bInterval;
|
||||
bNumEP++;
|
||||
return;
|
||||
}
|
||||
void BTD::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) {
|
||||
Notify(PSTR("\r\nEndpoint descriptor:"));
|
||||
|
@ -914,7 +913,6 @@ void BTD::setBdaddr(uint8_t* BDADDR) {
|
|||
}
|
||||
PrintHex<uint8_t>(my_bdaddr[0]);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
void BTD::setMoveBdaddr(uint8_t* BDADDR) {
|
||||
/* Set the internal bluetooth address */
|
||||
|
@ -939,5 +937,4 @@ void BTD::setMoveBdaddr(uint8_t* BDADDR) {
|
|||
}
|
||||
PrintHex<uint8_t>(my_bdaddr[0]);
|
||||
#endif
|
||||
return;
|
||||
}
|
42
SPP.cpp
42
SPP.cpp
|
@ -243,30 +243,30 @@ void SPP::ACLData(uint8_t* l2capinbuf) {
|
|||
}
|
||||
if(connected) {
|
||||
/* Read the incoming message */
|
||||
if(rfcommChannelType != RFCOMM_UIH || rfcommChannel != rfcommChannelConnection)
|
||||
return;
|
||||
uint8_t length = l2capinbuf[10] >> 1; // Get length
|
||||
if(rfcommAvailable + length > 256)
|
||||
return; // Return if the buffer would be full
|
||||
uint8_t offset = l2capinbuf[4]-length-4; // See if there is credit
|
||||
for(uint8_t i = 0; i < length; i++)
|
||||
rfcommDataBuffer[rfcommAvailable+i] = l2capinbuf[11+i+offset];
|
||||
rfcommAvailable += length;
|
||||
if(rfcommChannelType == RFCOMM_UIH && rfcommChannel == rfcommChannelConnection) {
|
||||
uint8_t length = l2capinbuf[10] >> 1; // Get length
|
||||
if(rfcommAvailable + length <= 256) { // Don't add data to buffer if it would be full
|
||||
uint8_t offset = l2capinbuf[4]-length-4; // See if there is credit
|
||||
for(uint8_t i = 0; i < length; i++)
|
||||
rfcommDataBuffer[rfcommAvailable+i] = l2capinbuf[11+i+offset];
|
||||
rfcommAvailable += length;
|
||||
}
|
||||
#ifdef EXTRADEBUG
|
||||
Notify(PSTR("\r\nRFCOMM Data Available: "));
|
||||
Serial.print(rfcommAvailable);
|
||||
if (offset) {
|
||||
Notify(PSTR(" - Credit: 0x"));
|
||||
Serial.print(l2capinbuf[11],HEX);
|
||||
}
|
||||
Notify(PSTR("\r\nRFCOMM Data Available: "));
|
||||
Serial.print(rfcommAvailable);
|
||||
if (offset) {
|
||||
Notify(PSTR(" - Credit: 0x"));
|
||||
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)
|
||||
return;
|
||||
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]);
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue