Newly Optimized RF24Network Layer  v1.0.7
2014-2015 - Optimized RF24 Network Layer for NRF24L01 radios
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
RF24NetworkHeader Struct Reference

Header which is sent with each message. More...

#include <RF24Network.h>

Public Member Functions

 RF24NetworkHeader ()
 Default constructor. More...
 
 RF24NetworkHeader (uint16_t _to, unsigned char _type=0)
 Send constructor. More...
 
const char * toString (void) const
 Create debugging string. More...
 

Public Attributes

uint16_t from_node
 Logical address where the message was generated. More...
 
uint16_t to_node
 Logical address where the message is going. More...
 
uint16_t id
 Sequential message ID, incremented every time a new frame is constructed. More...
 
unsigned char type
 Message Types: User message types 1 through 64 will NOT be acknowledged by the network, while message types 65 through 127 will receive a network ACK. More...
 
unsigned char reserved
 During fragmentation, it carries the fragment_id, and on the last fragment it carries the header_type. More...
 

Static Public Attributes

static uint16_t next_id = 1
 The message ID of the next message to be sent (unused) More...
 

Detailed Description

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.

Constructor & Destructor Documentation

RF24NetworkHeader::RF24NetworkHeader ( )
inline

Default constructor.

Simply constructs a blank header

RF24NetworkHeader::RF24NetworkHeader ( uint16_t  _to,
unsigned char  _type = 0 
)
inline

Send constructor.

Note
Now supports automatic fragmentation for very long messages, which can be sent as usual if fragmentation is enabled.

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));
Parameters
_toThe Octal format, logical node address where the message is going
_typeThe type of message which follows. Only 0-127 are allowed for user messages. Types 1-64 will not receive a network acknowledgement.

Member Function Documentation

const char * RF24NetworkHeader::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 this object

Member Data Documentation

uint16_t RF24NetworkHeader::from_node

Logical address where the message was generated.

uint16_t RF24NetworkHeader::to_node

Logical address where the message is going.

uint16_t RF24NetworkHeader::id

Sequential message ID, incremented every time a new frame is constructed.

unsigned char RF24NetworkHeader::type

Message Types: 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.


Type of the packet. 0-127 are user-defined types, 128-255 are reserved for system

unsigned char RF24NetworkHeader::reserved

During fragmentation, it carries the fragment_id, and on the last fragment it carries the header_type.


*Reserved for system use*

uint16_t RF24NetworkHeader::next_id = 1
static

The message ID of the next message to be sent (unused)