#682 Exposing the actual radio center frequency to /static/report

This commit is contained in:
Jm
2021-02-09 21:59:00 -08:00
parent ca8a0ca8d2
commit b29bcbbd41
3 changed files with 70 additions and 5 deletions

View File

@@ -11,6 +11,7 @@
#include <HTTPMultipartBodyParser.hpp>
#include <HTTPURLEncodedBodyParser.hpp>
#include <SPIFFS.h>
#include "RadioLibInterface.h"
#ifndef NO_ESP32
#include "esp_task_wdt.h"
@@ -928,10 +929,18 @@ void handleReport(HTTPRequest *req, HTTPResponse *res)
res->printf("\"has_battery\": %s,\n", BoolToString(powerStatus->getHasBattery()));
res->printf("\"has_usb\": %s,\n", BoolToString(powerStatus->getHasUSB()));
res->printf("\"is_charging\": %s\n", BoolToString(powerStatus->getIsCharging()));
res->println("}");
res->println("},");
res->println("\"radio\": {");
res->printf("\"frequecy\": %f,\n", RadioLibInterface::instance->getFreq());
res->printf("\"lora_channel\": %d\n", RadioLibInterface::instance->getChannelNum());
res->println("},");
res->println("},");
res->println("\"status\": \"ok\"");
res->println("}");
}