Skip to content

Commit

Permalink
Bug fix & adjustment
Browse files Browse the repository at this point in the history
- Fix for changes to is_valid_address from 3474b15
- Remove dual writes from address response routing to help prevent issues
  • Loading branch information
TMRh20 committed Aug 16, 2020
1 parent 1e261b7 commit e5c6d5d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions RF24Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ uint8_t RF24Network::update(void)
if(requester != node_address){
header->to_node = requester;
write(header->to_node,USER_TX_TO_PHYSICAL_ADDRESS);
delay(10);
write(header->to_node,USER_TX_TO_PHYSICAL_ADDRESS);
continue;
}
}
Expand Down Expand Up @@ -1150,7 +1148,7 @@ uint16_t RF24Network::direct_child_route_to( uint16_t node )
bool RF24Network::is_valid_address( uint16_t node )
{
bool result = true;
if(node == 0100){ return result; }
if(node == 0100 || node == 010){ return result; }

This comment has been minimized.

Copy link
@2bndy5

2bndy5 Jul 1, 2021

Member

I understand the rationality for adding this check to this function, but this means that the user could essentially

network.begin(0100);
// or 
network.begin(010);

which (I think) should be illegal.

Tell me I'm overthinking this and I'll back off. Otherwise I'll file another issue and adjust the begin() definition to prevent this. I almost filed an issue about moving this line out of this function, thinking that only the header.to_node could be set to 0100, but then I remembered about NETWORK_ACK types that can have header.from_node set to 0100.

ps - what's up with the node == 010 check? I can't find anything in the other RF24* libs that might instigate that to be true. Is this to compensate some weird/faulty SPI transaction?

This comment has been minimized.

Copy link
@TMRh20

TMRh20 via email Jul 1, 2021

Author Member
while(node)
{
uint8_t digit = node & 0x07;
Expand Down

0 comments on commit e5c6d5d

Please sign in to comment.