RF24G 0.9
Simple Abstraction Layer for the nRF24L01
|
Public Member Functions | |
Packet public interface | |
These are the main methods you need to set, modify, and retrieve data from packets. | |
void | setAddress (uint8_t _address) |
uint8_t | getAddress () const |
uint8_t | getCnt () const |
void | setCnt (uint8_t _cnt) |
bool | addPayload (const void *data, const uint8_t size) |
bool | readPayload (void *data, const uint8_t size) |
void packet::setAddress | ( | uint8_t | _address | ) |
Sets the address of a packet.
If you are sending a packet, set this to set the destination of the packet.
uint8_t packet::getAddress | ( | ) | const |
Gets the address of a packet.
If you receive a packet, call this on the packet to get what address the packet came from.
uint8_t packet::getCnt | ( | ) | const |
Gets the counter of a packet.
This is used internally by the library to set the packet counter. This is used to detect duplicate packets.
The user does not need to use this method.
void packet::setCnt | ( | uint8_t | _cnt | ) |
Sets the counter of a packet.
This is used internally by the library to set the packet counter. This is used to detect duplicate packets.
The user does not need to use this method.
bool packet::addPayload | ( | const void * | data, |
const uint8_t | size ) |
Adds any datatype smaller than 30 bytes to the packet.
This needs the address of an object and it's size to work correctly.
bool packet::readPayload | ( | void * | data, |
const uint8_t | size ) |
Retrieves any datatype smaller than 30 bytes from the packet.
This needs the address of an object and it's size to work correctly.