Hoymiles Lib: Remove hard coded Serial output

The serial port for output of debug information can now changed during runtime
This commit is contained in:
Thomas Basler
2022-12-19 20:52:12 +01:00
parent 3421c9a0b1
commit f689fedf4e
10 changed files with 72 additions and 51 deletions

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2022 Thomas Basler and others
*/
#include "AlarmLogParser.h"
#include "../Hoymiles.h"
#include <cstring>
void AlarmLogParser::clearBuffer()
@@ -14,7 +15,7 @@ void AlarmLogParser::clearBuffer()
void AlarmLogParser::appendFragment(uint8_t offset, uint8_t* payload, uint8_t len)
{
if (offset + len > ALARM_LOG_PAYLOAD_SIZE) {
Serial.printf("FATAL: (%s, %d) stats packet too large for buffer (%d > %d)\n", __FILE__, __LINE__, offset + len, ALARM_LOG_PAYLOAD_SIZE);
Hoymiles.getMessageOutput()->printf("FATAL: (%s, %d) stats packet too large for buffer (%d > %d)\n", __FILE__, __LINE__, offset + len, ALARM_LOG_PAYLOAD_SIZE);
return;
}
memcpy(&_payloadAlarmLog[offset], payload, len);