diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ff32091..9b8fbd17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ option(SERIAL_DEBUG_FRAGMENTATION_L2 "enable/disable debugging output related to fragmented messages' transmission success" OFF ) -option(DISABLE_FRAGMENTATION"disable message fragmentation" OFF) +option(DISABLE_FRAGMENTATION "disable message fragmentation" OFF) option(DISABLE_DYNAMIC_PAYLOADS "force usage of static payload size" OFF) # detect CPU and add compiler flags accordingly diff --git a/RF24Network.cpp b/RF24Network.cpp index e9ac2f79..052d7eac 100644 --- a/RF24Network.cpp +++ b/RF24Network.cpp @@ -174,7 +174,7 @@ uint8_t RF24Network::update(void) write(header->to_node, TX_NORMAL); continue; } - if ((returnSysMsgs && header->type > 127) || header->type == NETWORK_ACK) { + if ((returnSysMsgs && header->type > MAX_USER_DEFINED_HEADER_TYPE) || header->type == NETWORK_ACK) { IF_SERIAL_DEBUG_ROUTING(printf_P(PSTR("%lu MAC: System payload rcvd %d\n"), millis(), returnVal);); if (header->type != NETWORK_FIRST_FRAGMENT && header->type != NETWORK_MORE_FRAGMENTS && header->type != EXTERNAL_DATA_TYPE && header->type != NETWORK_LAST_FRAGMENT) { return returnVal; diff --git a/RF24Network.h b/RF24Network.h index 9b05fa39..f1cd694e 100644 --- a/RF24Network.h +++ b/RF24Network.h @@ -356,6 +356,7 @@ class RF24Network * Calling begin brings up the network, and configures the address, which designates the location of the node within RF24Network topology. * @note Node addresses are specified in Octal format, see [RF24Network Addressing](md_docs_addressing.html) for more information. * @warning Be sure to first call `RF24::begin()` to initialize the radio properly. + * @note The address `04444` is resreved for RF24Mesh usage * * **Example 1:** Begin on current radio channel with address 0 (master node) * @code diff --git a/RF24Network_config.h b/RF24Network_config.h index 2dc40bfc..7190157d 100644 --- a/RF24Network_config.h +++ b/RF24Network_config.h @@ -11,37 +11,34 @@ #ifndef __RF24NETWORK_CONFIG_H__ #define __RF24NETWORK_CONFIG_H__ + /** @brief A reserved valid address for use with RF24Mesh (when a mesh node requests an assigned address) */ #ifndef NETWORK_DEFAULT_ADDRESS #define NETWORK_DEFAULT_ADDRESS 04444 #endif // NETWORK_DEFAULT_ADDRESS - #ifndef NETWORK_MULTICAST_ADDRESS - #define NETWORK_MULTICAST_ADDRESS 0100 - #endif // NETWORK_MULTICAST_ADDRESS + /** @brief A sentinel address value for multicasting purposes */ + #define NETWORK_MULTICAST_ADDRESS 0100 - #ifndef NETWORK_AUTO_ROUTING - #define NETWORK_AUTO_ROUTING 070 - #endif // NETWORK_AUTO_ROUTING + /** @brief A sentinel value for internally indicating that the frame should be automatically routed as necessary */ + #define NETWORK_AUTO_ROUTING 070 #if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__) /********** USER CONFIG - non ATTiny **************/ //#define ENABLE_SLEEP_MODE //AVR only + /** @brief When defined, this will allow the use of multicasting messages */ #define RF24NetworkMulticast - /* * - * \def - * Saves memory by disabling fragmentation - */ + /* Saves memory by disabling fragmentation */ //#define DISABLE_FRAGMENTATION - /** System defines */ + /* System defines */ - /** Maximum size of fragmented network frames and fragmentation cache. - * - * @note: This buffer can now be any size > 24. Previously need to be a multiple of 24. - * @note: If used with RF24Ethernet, this value is used to set the buffer sizes. + /** + * @brief Maximum size of fragmented network frames and fragmentation cache. + * @note This buffer can now be any size > 24. Previously this needed to be a multiple of 24 (changed in v1.0.15). + * @note If used with RF24Ethernet, this value is used to set the buffer sizes. */ #ifndef MAX_PAYLOAD_SIZE #define MAX_PAYLOAD_SIZE 144 @@ -53,18 +50,18 @@ #define MAIN_BUFFER_SIZE (MAX_PAYLOAD_SIZE + FRAME_HEADER_SIZE) - /** Disable user payloads. Saves memory when used with RF24Ethernet or software that uses external data.*/ + /* Disable user payloads. Saves memory when used with RF24Ethernet or software that uses external data.*/ //#define DISABLE_USER_PAYLOADS - /** Enable tracking of success and failures for all transmissions, routed and user initiated */ + /* Enable tracking of success and failures for all transmissions, routed and user initiated */ //#define ENABLE_NETWORK_STATS - /** Enable dynamic payloads - If using different types of NRF24L01 modules, some may be incompatible when using this feature **/ #ifndef DISABLE_DYNAMIC_PAYLOADS + /** Enable dynamic payloads - If using different types of NRF24L01 modules, some may be incompatible when using this feature **/ #define ENABLE_DYNAMIC_PAYLOADS #endif // DISABLE_DYNAMIC_PAYLOADS - /** Debug Options */ + /* Debug Options */ //#define SERIAL_DEBUG //#define SERIAL_DEBUG_MINIMAL //#define SERIAL_DEBUG_ROUTING