From 0a4ac30fe3e48e47a9638c996ebf4f6b6007b3fb Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Wed, 5 Jun 2024 17:52:49 -0600 Subject: [PATCH] Fix for Multicast to level 4 (#227) https://github.com/nRF24/RF24Network/issues/226 - Define NETWORK_MULTICAST_ADDRESS_LEVEL_2 and NETWORK_MULTICAST_ADDRESS_LEVEL_4 - Add the above to valid addresses in `is_valid_address();` --- RF24Network.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RF24Network.cpp b/RF24Network.cpp index ba4fe251..f4655d4f 100644 --- a/RF24Network.cpp +++ b/RF24Network.cpp @@ -43,6 +43,9 @@ volatile bool wasInterrupted; #endif uint16_t RF24NetworkHeader::next_id = 1; +#define NETWORK_MULTICAST_ADDRESS_LEVEL_2 010 +#define NETWORK_MULTICAST_ADDRESS_LEVEL_4 01000 + #if defined(RF24_LINUX) /******************************************************************/ @@ -1094,7 +1097,7 @@ uint16_t RF24Network::direct_child_route_to(uint16_t node) bool RF24Network::is_valid_address(uint16_t node) { bool result = true; - if (node == NETWORK_MULTICAST_ADDRESS || node == 010) { + if (node == NETWORK_MULTICAST_ADDRESS || node == NETWORK_MULTICAST_ADDRESS_LEVEL_2 || node == NETWORK_MULTICAST_ADDRESS_LEVEL_4) { return result; } uint8_t count = 0;