error handling
This commit is contained in:
parent
ad379a3e22
commit
2fc1aafab9
@ -416,6 +416,8 @@ static void handleRequestEngine(void *handle) {
|
||||
show(LED_RED, ON);
|
||||
coloredMsg(LOG_RED, true, "mbc hre [%d] err: already error, read the rest (now: %02x) until timeout",
|
||||
localMbusCommHandle->requestId, localMbusCommHandle->receivedOctet);
|
||||
mbusCommStats.errorCnt += 1;
|
||||
localMbusCommHandle->device->failures += 1;
|
||||
printError(localMbusCommHandle);
|
||||
localMbusCommHandle->state = MBCS_ERROR_CONTINUED;
|
||||
// no break
|
||||
@ -426,8 +428,6 @@ static void handleRequestEngine(void *handle) {
|
||||
|
||||
case MBCS_TIMEOUT:
|
||||
coloredMsg(LOG_RED, true, "mbc hre [%d] state TIMEOUT", localMbusCommHandle->requestId);
|
||||
mbusCommStats.errorCnt += 1;
|
||||
localMbusCommHandle->device->failures += 1;
|
||||
localMbusCommHandle->receiving = false;
|
||||
if (localMbusCommHandle->frame.userdata != NULL) {
|
||||
free(localMbusCommHandle->frame.userdata);
|
||||
|
Loading…
x
Reference in New Issue
Block a user