Closed
Description
In the file "IridiumSBD.cpp", currently at line 1403, there is this code:
while (wireport->available())
{
wireport->read(); // Mop up any unexpected bytes
}
That code can be removed, since the Wire library uses packages of data and not a stream of data. There is no need to remove unused data.
Explanation: Common-mistakes#4
In the code above that, is this:
wireport->requestFrom((uint8_t)deviceaddress, 2); // Request two bytes
if (wireport->available() >= 2)
The peripheral can not send less or more. There is no need to allow that it is higher than 2.
If two bytes are requested, then test for two bytes:
if (wireport->available() == 2)
Metadata
Metadata
Assignees
Labels
No labels