Browse Source

small changes

added Radio DTU to /system
pull/1239/head
lumapu 1 year ago
parent
commit
34dff0b395
  1. 4
      src/hm/radio.h
  2. 3
      src/web/RestApi.h
  3. 8
      src/web/html/system.html

4
src/hm/radio.h

@ -61,6 +61,10 @@ class Radio {
sendPacket(iv, 24, isRetransmit); sendPacket(iv, 24, isRetransmit);
} }
uint32_t getDTUSn(void) {
return mDtuSn;
}
public: public:
std::queue<packet_t> mBufCtrl; std::queue<packet_t> mBufCtrl;

3
src/web/RestApi.h

@ -548,6 +548,7 @@ class RestApi {
void getRadioCmtInfo(JsonObject obj) { void getRadioCmtInfo(JsonObject obj) {
obj[F("en")] = (bool) mConfig->cmt.enabled; obj[F("en")] = (bool) mConfig->cmt.enabled;
obj[F("isconnected")] = mRadioCmt->isConnected(); obj[F("isconnected")] = mRadioCmt->isConnected();
obj[F("sn")] = String(mRadioCmt->getDTUSn(), HEX);
} }
#endif #endif
@ -555,7 +556,7 @@ class RestApi {
obj[F("en")] = (bool) mConfig->nrf.enabled; obj[F("en")] = (bool) mConfig->nrf.enabled;
obj[F("isconnected")] = mRadioNrf->isChipConnected(); obj[F("isconnected")] = mRadioNrf->isChipConnected();
obj[F("dataRate")] = mRadioNrf->getDataRate(); obj[F("dataRate")] = mRadioNrf->getDataRate();
//obj[F("isPVariant")] = mRadioNrf->isPVariant(); obj[F("sn")] = String(mRadioCmt->getDTUSn(), HEX);
} }
void getSerial(JsonObject obj) { void getSerial(JsonObject obj) {

8
src/web/html/system.html

@ -50,7 +50,8 @@
if(obj.radioNrf.en) { if(obj.radioNrf.en) {
lines = [ lines = [
tr("NRF24L01", badge(obj.radioNrf.isconnected, ((obj.radioNrf.isconnected) ? "" : "not ") + "connected")), 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 } else
lines = [tr("NRF24L01", badge(false, "not enabled"))]; lines = [tr("NRF24L01", badge(false, "not enabled"))];
@ -64,7 +65,10 @@
/*IF_ESP32*/ /*IF_ESP32*/
if(obj.radioCmt.en) { 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 } else
cmt = [tr("CMT2300A", badge(false, "not enabled"))]; cmt = [tr("CMT2300A", badge(false, "not enabled"))];

Loading…
Cancel
Save