Browse Source

fix compile error and warnings

pull/1239/head
lumapu 11 months ago
parent
commit
ba8d1f3fc3
  1. 6
      src/hm/Communication.h
  2. 2
      src/web/RestApi.h
  3. 7
      src/web/html/serial.html

6
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);
}

2
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) {

7
src/web/html/serial.html

@ -17,6 +17,7 @@
<div class="col-6 col-sm-4 a-r">
<input type="button" value="clear" class="btn" id="clear"/>
<input type="button" value="autoscroll" class="btn" id="scroll"/>
<!--<input type="button" value="copy" class="btn" id="copy"/>-->
</div>
</div>
</div>
@ -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');

Loading…
Cancel
Save