Optimized RF24Network Layer v2.0.2
2024 - Optimized RF24 Network Layer for NRF24L01 & NRF52x radios
|
Macros | |
#define | NETWORK_ADDR_RESPONSE 128 |
#define | NETWORK_PING 130 |
#define | EXTERNAL_DATA_TYPE 131 |
#define | NETWORK_FIRST_FRAGMENT 148 |
#define | NETWORK_MORE_FRAGMENTS 149 |
#define | NETWORK_LAST_FRAGMENT 150 |
#define | NETWORK_ACK 193 |
#define | NETWORK_POLL 194 |
#define | NETWORK_REQ_ADDRESS 195 |
Reserved network message types
The network will determine whether to automatically acknowledge payloads based on their general RF24NetworkHeader::type
.
System types can also contain message data.
#define NETWORK_ADDR_RESPONSE 128 |
A NETWORK_ADDR_RESPONSE type is utilized to manually route custom messages containing a single RF24Network address.
Used by RF24Mesh
If a node receives a message of this type that is directly addressed to it, it will read the included message, and forward the payload on to the proper recipient.
This allows nodes to forward multicast messages to the master node, receive a response, and forward it back to the requester.
#define NETWORK_PING 130 |
Messages of type NETWORK_PING will be dropped automatically by the recipient. A NETWORK_ACK or automatic radio-ack will indicate to the sender whether the payload was successful. The time it takes to successfully send a NETWORK_PING is the round-trip-time.
#define EXTERNAL_DATA_TYPE 131 |
External data types are used to define messages that will be passed to an external data system. This allows RF24Network to route and pass any type of data, such as TCP/IP frames, while still being able to utilize standard RF24Network messages etc.
Linux
Linux devices (defined with RF24_LINUX
macro) will buffer all data types in the user cache.
Arduino/AVR/Etc
Data transmitted with the type set to EXTERNAL_DATA_TYPE will not be loaded into the user cache.
External systems can extract external data using the following process, while internal data types are cached in the user buffer, and accessed using network.read() :
#define NETWORK_FIRST_FRAGMENT 148 |
Messages of this type designate the first of two or more message fragments, and will be re-assembled automatically.
#define NETWORK_MORE_FRAGMENTS 149 |
Messages of this type indicate a fragmented payload with two or more message fragments.
#define NETWORK_LAST_FRAGMENT 150 |
Messages of this type indicate the last fragment in a sequence of message fragments. Messages of this type do not receive a NETWORK_ACK
#define NETWORK_ACK 193 |
Messages of this type signal the sender that a network-wide transmission has been completed.
01
and 011
use the radio's auto-ack feature for transmissions between them, but nodes 01
and 02
do not use the radio's auto-ack feature for transmissions between them as messages will be routed through other nodes. 00
sends an instigating message to node 011
, node 01
will send the NETWORK_ACK message to 00
upon successful delivery of instigating message to node 011
. #define NETWORK_POLL 194 |
Used by RF24Mesh
Messages of this type are used with multi-casting , to find active/available nodes. Any node receiving a NETWORK_POLL sent to a multicast address will respond directly to the sender with a blank message, indicating the address of the available node via the header.
#define NETWORK_REQ_ADDRESS 195 |
Used by RF24Mesh
Messages of this type are used to request information from the master node, generally via a unicast (direct) write. Any (non-master) node receiving a message of this type will manually forward it to the master node using a normal network write.