microbit: BUGFIX: Length field of datagram receive now correct
Datagram receive code incorrectly calculated the payload length, resulting in packets being delivered to applications that were two bytes shorter than they should be.
This commit is contained in:
parent
5a30b3c0b3
commit
5cb265c158
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ ManagedString MicroBitRadioDatagram::recv()
|
|||
PacketBuffer *p = rxQueue;
|
||||
rxQueue = rxQueue->next;
|
||||
|
||||
ManagedString s((const char *)p->payload, p->length - MICROBIT_RADIO_HEADER_SIZE - 1);
|
||||
ManagedString s((const char *)p->payload, p->length - (MICROBIT_RADIO_HEADER_SIZE - 1));
|
||||
|
||||
delete p;
|
||||
return s;
|
||||
|
|
Loading…
Reference in a new issue