Show error when unknown data was received (#1013)

This commit is contained in:
Gunnar Skjold
2025-09-25 12:20:31 +02:00
committed by GitHub
parent 2ff8fddc14
commit 031422f783
2 changed files with 4 additions and 0 deletions

View File

@@ -324,6 +324,7 @@
"-51" : "Authentication failed",
"-52" : "Decryption failed",
"-53" : "Encryption key invalid",
"89" : "Unrecognized data received from meter",
"90" : "No HAN data received for at least 30s",
"91" : "Serial break",
"92" : "Serial buffer full",

View File

@@ -46,6 +46,7 @@ ADC_MODE(ADC_VCC);
#define METER_PARSER_PULSE 2
#define METER_PARSER_KAMSTRUP 9
#define METER_ERROR_UNKNOWN_DATA 89
#define METER_ERROR_NO_DATA 90
#define METER_ERROR_BREAK 91
#define METER_ERROR_BUFFER 92
@@ -1345,6 +1346,8 @@ bool readHanPort() {
if(data != NULL) {
if(data->getListType() > 0) {
handleDataSuccess(data);
} else {
meterState.setLastError(METER_ERROR_UNKNOWN_DATA);
}
delete data;
}