Skip to content

Commit 7a088ae

Browse files
committed
Unneeded change
- Need to clear the packets from the radio even if they are shorter than RF24Network header size
1 parent 7c1384b commit 7a088ae

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

RF24Network.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,14 @@ uint8_t ESBNetwork<radio_t>::update(void)
145145
frame_size = MAX_FRAME_SIZE;
146146
#endif
147147

148-
if (frame_size < sizeof(RF24NetworkHeader)) {
149-
continue;
150-
}
151-
152148
// Fetch the payload, and see if this was the last one.
153149
radio.read(frame_buffer, frame_size);
154150

155151
// Read the beginning of the frame as the header
156152
RF24NetworkHeader* header = (RF24NetworkHeader*)(&frame_buffer);
157153

158154
// Throw it away if it's not a valid address or too small
159-
if (!is_valid_address(header->to_node) || !is_valid_address(header->from_node)) {
155+
if (frame_size < sizeof(RF24NetworkHeader) || !is_valid_address(header->to_node) || !is_valid_address(header->from_node)) {
160156
continue;
161157
}
162158
//IF_RF24NETWORK_DEBUG(printf_P(PSTR("MAC Received " PRIPSTR

0 commit comments

Comments
 (0)