fd

Dependents:   xtoff3 CYS_Receiver

Fork of RF24Network by Akash Vibhute

Embed: (wiki syntax)

« Back to documentation index

RF24NetworkHeader Struct Reference

RF24NetworkHeader Struct Reference

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

#include <RF24Network.h>

Public Member Functions

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

Data Fields

uint16_t from_node
 Logical address where the message was generated.
uint16_t to_node
 Logical address where the message is going.
uint16_t id
 Sequential message ID, incremented every time a new frame is constructed.
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.
unsigned char reserved
 During fragmentation, it carries the fragment_id, and on the last fragment it carries the header_type.

Static Public Attributes

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

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.

Definition at line 181 of file RF24Network.h.


Constructor & Destructor Documentation

Default constructor.

Simply constructs a blank header

Definition at line 207 of file RF24Network.h.

RF24NetworkHeader ( uint16_t  _to,
unsigned char  _type = 0 
)

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.

Definition at line 232 of file RF24Network.h.


Member Function Documentation

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 this object

Definition at line 831 of file RF24Network.cpp.


Field Documentation

uint16_t from_node

Logical address where the message was generated.

Definition at line 182 of file RF24Network.h.

uint16_t id

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

Definition at line 184 of file RF24Network.h.

uint16_t next_id = 1 [static]

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

Definition at line 199 of file RF24Network.h.

unsigned char reserved

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


*Reserved for system use*

Definition at line 197 of file RF24Network.h.

uint16_t to_node

Logical address where the message is going.

Definition at line 183 of file RF24Network.h.

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.

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

Definition at line 191 of file RF24Network.h.