Client side of simple client/server pair using RF22 class
#include <SPI.h>
#include <RF22.h>
void setup()
{
Serial.begin(9600);
Serial.println("RF22 init failed");
}
void loop()
{
while (1)
{
Serial.println("Sending to rf22_server");
uint8_t data[] = "Hello World!";
rf22.
send(data,
sizeof(data));
uint8_t buf[RF22_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
{
if (rf22.
recv(buf, &len))
{
Serial.print("got reply: ");
Serial.println((char*)buf);
}
else
{
Serial.println("recv failed");
}
}
else
{
Serial.println("No reply, is rf22_server running?");
}
}
}