From ba8d1f3fc34163548bc3fa7f0ce3e676f0a06574 Mon Sep 17 00:00:00 2001 From: lumapu Date: Mon, 20 Nov 2023 23:33:26 +0100 Subject: [PATCH] fix compile error and warnings --- src/hm/Communication.h | 6 +++--- src/web/RestApi.h | 2 +- src/web/html/serial.html | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/hm/Communication.h b/src/hm/Communication.h index f05d7986..da4496b1 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -210,9 +210,9 @@ class Communication : public CommQueue<> { if(q->iv->miMultiParts < 6) { nextState = States::WAIT; } else { - if((q->cmd == 0x39) && (q->iv->type == INV_TYPE_4CH) || - (q->cmd == MI_REQ_CH2) && (q->iv->type == INV_TYPE_2CH) || - (q->cmd == MI_REQ_CH1) && (q->iv->type == INV_TYPE_1CH)) { + if(((q->cmd == 0x39) && (q->iv->type == INV_TYPE_4CH)) + || ((q->cmd == MI_REQ_CH2) && (q->iv->type == INV_TYPE_2CH)) + || ((q->cmd == MI_REQ_CH1) && (q->iv->type == INV_TYPE_1CH))) { miComplete(q->iv); //closeRequest(q->iv, q->iv->miMultiParts > 5); } diff --git a/src/web/RestApi.h b/src/web/RestApi.h index 7a59ac2b..4208be30 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -556,7 +556,7 @@ class RestApi { obj[F("en")] = (bool) mConfig->nrf.enabled; obj[F("isconnected")] = mRadioNrf->isChipConnected(); obj[F("dataRate")] = mRadioNrf->getDataRate(); - obj[F("sn")] = String(mRadioCmt->getDTUSn(), HEX); + obj[F("sn")] = String(mRadioNrf->getDTUSn(), HEX); } void getSerial(JsonObject obj) { diff --git a/src/web/html/serial.html b/src/web/html/serial.html index 3f9b4d94..ff25477a 100644 --- a/src/web/html/serial.html +++ b/src/web/html/serial.html @@ -17,6 +17,7 @@
+
@@ -63,6 +64,12 @@ mAutoScroll = !mAutoScroll; this.value = (mAutoScroll) ? "autoscroll" : "manual scroll"; }); + /*document.getElementById("copy").addEventListener("click", function() { + con.select(); + con.setSelectionRange(0, 9999999); + navigator.clipboard.writeText(con.value); + alert("Copied to clipboard"); + });*/ if (!!window.EventSource) { var source = new EventSource('/events');