From af15d4b08c3a0c4fef4c208ecffa8559e4502e87 Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Wed, 5 Jun 2024 04:15:58 -0600 Subject: [PATCH] Fix for Multicast to level 4 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 d6edab8b..85793ad0 100644 --- a/RF24Network.cpp +++ b/RF24Network.cpp @@ -46,6 +46,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) /******************************************************************/ template @@ -1122,7 +1125,7 @@ template bool ESBNetwork::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;