#include <RH_LoRaFileOps.h>
void setup()
{
if (!lora.init())
Serial.println("init failed");
lora.setTxPower(17);
}
void loop()
{
Serial.println("Sending to server");
uint8_t data[] = "Hello World!";
lora.send(data, sizeof(data));
lora.waitPacketSent();
uint8_t buf[RH_LORAFILEOPS_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (lora.waitAvailableTimeout(6000, 100))
{
if (lora.recv(buf, &len))
{
Serial.print("got reply: ");
Serial.println((char*)buf);
Serial.print("RSSI: ");
Serial.println(lora.lastRssi(), DEC);
Serial.print("SNR: ");
Serial.println(lora.lastSNR(), DEC);
}
else
{
Serial.println("recv failed");
}
}
else
{
Serial.println("No reply, is server running?");
}
delay(1000);
}
Driver to send and receive unaddressed, unreliable datagrams via a LoRa capable radio transceiver on ...
Definition RH_LoRaFileOps.h:221