From 05d9ce45903574c18313239ae551a1983173b88b Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Sat, 8 Oct 2022 18:14:43 +0200 Subject: [PATCH] Output channel for RX messages --- lib/Hoymiles/src/HoymilesRadio.cpp | 5 ++++- lib/Hoymiles/src/types.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Hoymiles/src/HoymilesRadio.cpp b/lib/Hoymiles/src/HoymilesRadio.cpp index d518871..8e26caa 100644 --- a/lib/Hoymiles/src/HoymilesRadio.cpp +++ b/lib/Hoymiles/src/HoymilesRadio.cpp @@ -48,6 +48,7 @@ void HoymilesRadio::loop() f = _rxBuffer.getFront(); memset(f->fragment, 0xcc, MAX_RF_PAYLOAD_SIZE); f->len = _radio->getDynamicPayloadSize(); + f->channel = _radio->getChannel(); if (f->len > MAX_RF_PAYLOAD_SIZE) f->len = MAX_RF_PAYLOAD_SIZE; @@ -69,7 +70,9 @@ void HoymilesRadio::loop() if (nullptr != inv) { // Save packet in inverter rx buffer - dumpBuf("RX ", f->fragment, f->len); + char buf[30]; + snprintf(buf, sizeof(buf), "RX Channel: %d --> ", f->channel); + dumpBuf(buf, f->fragment, f->len); inv->addRxFragment(f->fragment, f->len); } else { Serial.println(F("Inverter Not found!")); diff --git a/lib/Hoymiles/src/types.h b/lib/Hoymiles/src/types.h index 43c6ffe..a0883a0 100644 --- a/lib/Hoymiles/src/types.h +++ b/lib/Hoymiles/src/types.h @@ -14,5 +14,6 @@ typedef struct { uint8_t mainCmd; uint8_t fragment[MAX_RF_PAYLOAD_SIZE]; uint8_t len; + uint8_t channel; bool wasReceived; } fragment_t;