output lora data to display #19

Open
opened 2026-10-05 05:59:00 +02:00 by adam · 0 comments
Owner

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;

}

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; } <!-- github-sync-id:2763115032 -->
adam changed title from output lora data to display to output lora data to display 2026-10-27 16:43:57 +01:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/LoraSA#19