A more advanced version of helloworld_rx using fragmentation/reassembly and variable payload sizes
#include "printf.h"
#include <RF24.h>
RF24 radio(7, 8);
const uint16_t this_node = 00;
const uint16_t other_node = 01;
void setup(void) {
Serial.begin(115200);
while (!Serial) {
}
Serial.println(F("RF24Network/examples/helloworld_rx_advanced/"));
if (!radio.begin()) {
Serial.println(F("Radio hardware not responding!"));
while (1) {
}
}
radio.setChannel(90);
network.begin( this_node);
printf_begin();
radio.printDetails();
}
uint32_t timeBetweenPackets = 0;
void loop(void) {
network.update();
while (network.available()) {
uint16_t payloadSize = network.peek(header);
network.read(header, &dataBuffer, payloadSize);
Serial.print("Received packet, size ");
Serial.print(payloadSize);
Serial.print("(");
Serial.print(millis() - timeBetweenPackets);
Serial.println("ms since last)");
timeBetweenPackets = millis();
}
}
#define MAX_PAYLOAD_SIZE
Maximum size of fragmented network frames and fragmentation cache.
Definition RF24Network_config.h:67
Definition RF24Network.h:384