Skip to content

Commit

Permalink
Remove unwanted check in appendFragmentToFrame().
Browse files Browse the repository at this point in the history
 - This is a double check.
 - Only fragments can be used with this function.
 - Check before if the frame contains a payload fragment!
  • Loading branch information
reixd committed Sep 17, 2014
1 parent b1e8590 commit e0ec131
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions RPi/RF24Network/RF24Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,6 @@ bool RF24Network::enqueue(RF24NetworkFrame frame) {

void RF24Network::appendFragmentToFrame(RF24NetworkFrame frame) {

bool isFragment = ( frame.header.type == NETWORK_FIRST_FRAGMENT || frame.header.type == NETWORK_MORE_FRAGMENTS || frame.header.type == NETWORK_LAST_FRAGMENT );

if (!isFragment) {
//The received payload is not a fragment.
frameFragmentsCache[ std::make_pair(frame.header.from_node,frame.header.id) ] = frame;
} else

if (frameFragmentsCache.count(std::make_pair(frame.header.from_node,frame.header.id)) == 0 ) {
// This is the first of many fragments.

Expand Down

0 comments on commit e0ec131

Please sign in to comment.