9#ifndef __RF24NETWORK_H__
10#define __RF24NETWORK_H__
22#if (defined(__linux) || defined(linux)) && !defined(__ARDUINO_X86__)
35#elif defined(XMEGA_D3)
36 #include "../../rf24lib/rf24lib/RF24.h"
40#define MIN_USER_DEFINED_HEADER_TYPE 0
41#define MAX_USER_DEFINED_HEADER_TYPE 127
72#define NETWORK_ADDR_RESPONSE 128
79#define NETWORK_PING 130
103#define EXTERNAL_DATA_TYPE 131
108#define NETWORK_FIRST_FRAGMENT 148
113#define NETWORK_MORE_FRAGMENTS 149
119#define NETWORK_LAST_FRAGMENT 150
161#define NETWORK_ACK 193
170#define NETWORK_POLL 194
178#define NETWORK_REQ_ADDRESS 195
186#define NETWORK_MORE_FRAGMENTS_NACK 200
191#define USER_TX_TO_PHYSICAL_ADDRESS 2
192#define USER_TX_TO_LOGICAL_ADDRESS 3
193#define USER_TX_MULTICAST 4
195#define MAX_FRAME_SIZE 32
196#define FRAME_HEADER_SIZE 10
202#define USE_CURRENT_CHANNEL 255
208#define FLAG_FAST_FRAG 4
214#define FLAG_NO_POLL 8
217#if defined(ARDUINO_ARCH_NRF52) || defined(ARDUINO_ARCH_NRF52840) || defined(ARDUINO_ARCH_NRF52833)
323#if defined(RF24_LINUX)
346#if defined(RF24_LINUX) || defined(DOXYGEN_FORCED)
349 if (_message && _len) {
354#if defined(DOXYGEN_FORCED) || !defined(RF24_LINUX)
382template<
class radio_t = RF24>
433 inline void begin(uint16_t _node_address)
605#if defined(ENABLE_NETWORK_STATS) || defined(DOXYGEN_FORCED)
619#if defined(RF24NetworkMulticast)
680 bool sleepNode(
unsigned int cycles,
int interruptPin, uint8_t INTERRUPT_MODE = 0);
734 void begin(uint8_t _channel, uint16_t _node_address);
773#if defined(RF24_LINUX) || defined(DOXYGEN_FORCED)
777#if (!defined(DISABLE_FRAGMENTATION) && !defined(RF24_LINUX)) || defined(DOXYGEN_FORCED)
834#if defined(RF24NetworkMulticast)
867 bool write(uint16_t to_node, uint8_t sendType);
876 bool write_to_pipe(uint16_t node, uint8_t pipe,
bool multicast);
895 void setup_address(
void);
903 bool _write(
RF24NetworkHeader& header,
const void* message, uint16_t len, uint16_t writeDirect);
905 struct logicalToPhysicalStruct
922 void logicalToPhysicalAddress(logicalToPhysicalStruct* conversionInfo);
927 bool is_direct_child(uint16_t node);
929 bool is_descendant(uint16_t node);
931 uint16_t direct_child_route_to(uint16_t node);
940#if defined(RF24_LINUX)
941 std::queue<RF24NetworkFrame> frame_queue;
942 std::map<uint16_t, RF24NetworkFrame> frameFragmentsCache;
946 #if defined(DISABLE_USER_PAYLOADS)
947 uint8_t frame_queue[1];
954 #if !defined(DISABLE_FRAGMENTATION)
961 uint16_t parent_node;
966 uint64_t pipe_address(uint16_t node, uint8_t pipe);
968#if defined ENABLE_NETWORK_STATS
973#if defined(RF24NetworkMulticast)
975 uint16_t levelToAddress(uint8_t level);
993#if defined(ARDUINO_ARCH_NRF52) || defined(ARDUINO_ARCH_NRF52840) || defined(ARDUINO_ARCH_NRF52833)
ESBNetwork< RF24 > RF24Network
Definition RF24Network.h:992
#define USE_CURRENT_CHANNEL
Definition RF24Network.h:202
#define MAX_FRAME_SIZE
Definition RF24Network.h:195
#define MAX_PAYLOAD_SIZE
Maximum size of fragmented network frames and fragmentation cache.
Definition RF24Network_config.h:67
#define MAIN_BUFFER_SIZE
The allocated size of the incoming frame buffer.
Definition RF24Network_config.h:78
Definition RF24Network.h:384
ESBNetwork(radio_t &_radio)
Definition RF24Network.cpp:63
std::queue< RF24NetworkFrame > external_queue
Definition RF24Network.h:774
bool sleepNode(unsigned int cycles, int interruptPin, uint8_t INTERRUPT_MODE=0)
bool returnSysMsgs
Definition RF24Network.h:815
void multicastLevel(uint8_t level)
Definition RF24Network.cpp:1159
uint16_t node_address
Definition RF24Network.h:847
bool multicast(RF24NetworkHeader &header, const void *message, uint16_t len, uint8_t level=7)
Definition RF24Network.cpp:673
bool available(void)
Definition RF24Network.cpp:547
void begin(uint16_t _node_address)
Definition RF24Network.h:433
uint16_t routeTimeout
Timeout for routed payloads.
Definition RF24Network.h:595
void setup_watchdog(uint8_t prescalar)
void failures(uint32_t *_fails, uint32_t *_ok)
uint8_t update(void)
Definition RF24Network.cpp:130
uint32_t txTimeout
Network timeout value.
Definition RF24Network.h:585
uint8_t networkFlags
Definition RF24Network.h:831
RF24NetworkFrame * frag_ptr
Definition RF24Network.h:796
uint16_t peek(RF24NetworkHeader &header)
Definition RF24Network.cpp:571
uint8_t _multicast_level
Definition RF24Network.h:839
uint16_t addressOfPipe(uint16_t node, uint8_t pipeNo)
Definition RF24Network.cpp:1099
bool is_valid_address(uint16_t node)
Definition RF24Network.cpp:1127
uint8_t frame_buffer[MAX_FRAME_SIZE]
The raw system frame buffer.
Definition RF24Network.h:753
uint16_t read(RF24NetworkHeader &header, void *message, uint16_t maxlen=MAX_PAYLOAD_SIZE)
Definition RF24Network.cpp:617
bool multicastRelay
Definition RF24Network.h:564
uint16_t parent() const
Definition RF24Network.cpp:560
bool write(RF24NetworkHeader &header, const void *message, uint16_t len)
Definition RF24Network.cpp:685
Definition RF24Network.h:312
RF24NetworkFrame(RF24NetworkHeader &_header, uint16_t _message_size)
Definition RF24Network.h:365
RF24NetworkFrame(RF24NetworkHeader &_header, const void *_message=NULL, uint16_t _len=0)
Definition RF24Network.h:347
uint8_t * message_buffer
Definition RF24Network.h:326
RF24NetworkHeader header
Definition RF24Network.h:314
uint16_t message_size
Definition RF24Network.h:317
RF24NetworkFrame()
Definition RF24Network.h:334