From 95967aaf59932e1a53424fad4e5b9655eed6ab84 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Thu, 4 Apr 2024 09:35:39 +0200 Subject: [PATCH] Fixed debug on HAN error --- src/PassiveMeterCommunicator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PassiveMeterCommunicator.cpp b/src/PassiveMeterCommunicator.cpp index d29ef777..835bc262 100644 --- a/src/PassiveMeterCommunicator.cpp +++ b/src/PassiveMeterCommunicator.cpp @@ -142,8 +142,12 @@ bool PassiveMeterCommunicator::loop() { printHanReadError(pos); len += hanSerial->readBytes(hanBuffer+len, hanBufferSize-len); if(pt != NULL) { - pt->publishBytes(hanBuffer+pos, len); + pt->publishBytes(hanBuffer, len); } + if(debugger->isActive(RemoteDebug::VERBOSE)) { + debugger->printf_P(PSTR(" payload:\n")); + debugPrint(hanBuffer, 0, len); + } while(hanSerial->available()) hanSerial->read(); // Make sure it is all empty, in case we overflowed buffer above len = 0; return false;