RF24Network v1
Public Member Functions | Public Attributes | Static Public Attributes

RF24NetworkHeader Struct Reference

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

#include <RF24Network.h>

List of all members.

Public Member Functions

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

Public Attributes

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 message.
unsigned char type
 Type of the packet.
unsigned char reserved
 Reserved for future use.

Static Public Attributes

static uint16_t next_id
 The message ID of the next message to be sent.

Detailed Description

Header which is sent with each message.

The frame put over the air consists of this header and a message

Examples:

helloworld_rx.pde, helloworld_tx.pde, meshping.pde, and sensornet.pde.


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.

Use this constructor to create a header and then send a message

  RF24NetworkHeader header(recipient_address,'t');
  network.write(header,&message,sizeof(message));
Parameters:
_toThe logical node address where the message is going
_typeThe type of message which follows. Only 0-127 are allowed for user messages.

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

unsigned char RF24NetworkHeader::type

Type of the packet.

0-127 are user-defined types, 128-255 are reserved for system

Examples:
meshping.pde.

The documentation for this struct was generated from the following file:
 All Classes Files Functions Variables