Network Payload Structures¶
-
struct RF24NetworkFrame¶
Frame structure for internal message handling, and for use by external applications
The actual frame put over the air consists of a header (8-bytes) and a message payload (Up to 24-bytes). When data is received, it is stored using the RF24NetworkFrame structure, which includes:
The header containing information about routing the message and the message type
The size of the included message
The ‘message’ or data being received
Public Functions¶
-
inline RF24NetworkFrame()¶
Default constructor
Simply constructs a blank frame. Frames are generally used internally. See RF24NetworkHeader.
-
inline RF24NetworkFrame(RF24NetworkHeader &_header, const void *_message = NULL, uint16_t _len = 0)¶
Constructor for Linux platforms - create a network frame with data Frames are constructed and handled differently on Arduino/AVR and Linux devices (
#if defined RF24_LINUX
)Frames are used internally and by external systems. See RF24NetworkHeader.
-
inline RF24NetworkFrame(RF24NetworkHeader &_header, uint16_t _message_size)¶
Constructor for Arduino/AVR/etc. platforms - create a network frame with data Frames are constructed and handled differently on Arduino/AVR and Linux devices (
#if defined RF24_LINUX
)Frames are used internally and by external systems. See RF24NetworkHeader.
See also
- Parameters:
- RF24NetworkHeader &_header¶
The RF24Network header to be stored in the frame
- uint16_t _message_size¶
The size of the ‘message’ or data
Public Members¶
-
RF24NetworkHeader header¶
Header which is sent with each message
-
struct RF24NetworkHeader¶
Header which is sent with each message
The frame put over the air consists of this header and a message
Headers are addressed to the appropriate node, and the network forwards them on to their final destination.
Public Functions¶
-
inline RF24NetworkHeader()¶
Default constructor
Simply constructs a blank header
-
inline RF24NetworkHeader(uint16_t _to, unsigned char _type = 0)¶
Send constructor
Fragmentation is enabled by default for all devices except ATTiny. Configure fragmentation and max payload size in RF24Network_config.h
Use this constructor to create a header and then send a message
uint16_t recipient_address = 011; RF24NetworkHeader header(recipient_address, 't'); network.write(header, &message, sizeof(message));
Note
Now supports automatic fragmentation for very long messages, which can be sent as usual if fragmentation is enabled.
-
const char *toString(void) const¶
Create debugging string
Useful for debugging. Dumps all members into a single string, using internal static memory. This memory will get overridden next time you call the method.
- Returns:
String representation of the object’s significant members.
Public Members¶
-
unsigned char type¶
Type of the packet. 0 - 127 are user-defined types, 128 - 255 are reserved for system.
User message types 1 through 64 will NOT be acknowledged by the network, while message types 65 through 127 will receive a network ACK. System message types 192 through 255 will NOT be acknowledged by the network. Message types 128 through 192 will receive a network ACK.
See also
Reserved System Message Types
-
unsigned char reserved¶
Reserved for system use
During fragmentation, it carries the fragment_id, and on the last fragment it carries the header_type.
-
inline RF24NetworkHeader()¶