int16_t checkRadio(RadioComms &comms) { radioIsScan = false; int16_t status = comms.configureRadio(); if (status != RADIOLIB_ERR_NONE) return status;
Message *msg = comms.receive( config.is_host ? 2000 : 200); // 200ms should be enough to receive 500 bytes at SF 7 and BW 500 if (msg == NULL) { return status; } if (msg->type == SCAN_RESULT) { display.clearDisplay(); // display.setDisplayRotation(1); display.println("Host Mode ->"); size_t dump_sz = msg->payload.dump.sz; for (int i = 0; i < dump_sz; i++) { int16_t rssi = msg->payload.dump.rssis[i]; int16_t fr = msg->payload.dump.freqs_khz[i]; display.println(String(fr) + ":" + String(rssi)); } HostComms->send(*msg); } else { Serial.printf("Received a message of unsupported type: %d\n", msg->type); } delete msg; return status;
}
No dependencies set.
The note is not visible to the blocked user.
int16_t checkRadio(RadioComms &comms)
{
radioIsScan = false;
int16_t status = comms.configureRadio();
if (status != RADIOLIB_ERR_NONE)
return status;
}
output lora data to displayto output lora data to display