From 34dff0b39524ce8564012ba527dffbd65536a7f8 Mon Sep 17 00:00:00 2001 From: lumapu Date: Sun, 19 Nov 2023 17:24:58 +0100 Subject: [PATCH] small changes added Radio DTU to /system --- src/hm/radio.h | 4 ++++ src/web/RestApi.h | 3 ++- src/web/html/system.html | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/hm/radio.h b/src/hm/radio.h index ddba0b50..c67186d7 100644 --- a/src/hm/radio.h +++ b/src/hm/radio.h @@ -61,6 +61,10 @@ class Radio { sendPacket(iv, 24, isRetransmit); } + uint32_t getDTUSn(void) { + return mDtuSn; + } + public: std::queue mBufCtrl; diff --git a/src/web/RestApi.h b/src/web/RestApi.h index f6d40a3a..59a21ca5 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -548,6 +548,7 @@ class RestApi { void getRadioCmtInfo(JsonObject obj) { obj[F("en")] = (bool) mConfig->cmt.enabled; obj[F("isconnected")] = mRadioCmt->isConnected(); + obj[F("sn")] = String(mRadioCmt->getDTUSn(), HEX); } #endif @@ -555,7 +556,7 @@ class RestApi { obj[F("en")] = (bool) mConfig->nrf.enabled; obj[F("isconnected")] = mRadioNrf->isChipConnected(); obj[F("dataRate")] = mRadioNrf->getDataRate(); - //obj[F("isPVariant")] = mRadioNrf->isPVariant(); + obj[F("sn")] = String(mRadioCmt->getDTUSn(), HEX); } void getSerial(JsonObject obj) { diff --git a/src/web/html/system.html b/src/web/html/system.html index a310890d..b5596c7b 100644 --- a/src/web/html/system.html +++ b/src/web/html/system.html @@ -50,7 +50,8 @@ if(obj.radioNrf.en) { lines = [ tr("NRF24L01", badge(obj.radioNrf.isconnected, ((obj.radioNrf.isconnected) ? "" : "not ") + "connected")), - tr("NRF24 Data Rate", dr[obj.radioNrf.dataRate] + "bps") + tr("NRF24 Data Rate", dr[obj.radioNrf.dataRate] + "bps"), + tr("DTU Radio ID", obj.radioNrf.sn) ]; } else lines = [tr("NRF24L01", badge(false, "not enabled"))]; @@ -64,7 +65,10 @@ /*IF_ESP32*/ if(obj.radioCmt.en) { - cmt = [tr("CMT2300A", badge(obj.radioCmt.isconnected, ((obj.radioCmt.isconnected) ? "" : "not ") + "connected"))]; + cmt = [ + tr("CMT2300A", badge(obj.radioCmt.isconnected, ((obj.radioCmt.isconnected) ? "" : "not ") + "connected")), + tr("DTU Radio ID", obj.radioCmt.sn) + ]; } else cmt = [tr("CMT2300A", badge(false, "not enabled"))];