diff --git a/cube/User/Src/mbusComm.c b/cube/User/Src/mbusComm.c index 76bc407..4e19754 100644 --- a/cube/User/Src/mbusComm.c +++ b/cube/User/Src/mbusComm.c @@ -113,6 +113,8 @@ static void printError(t_mbusCommHandle *localMbusCommHandle) { coloredMsg(LOG_YELLOW, true, "mbc pe [%d] Error ratio is %.2f", localMbusCommHandle->requestId, errorRatio); + mqttPublishf(MBUS_TOPIC, "{\"Status\":\"Error\", \"RequestId\":\"%d\", \"Device\":\"%s\", \"ErrorRatio\":\"%.2f\"}", + localMbusCommHandle->requestId, localMbusCommHandle->device->deviceName, errorRatio); } @@ -202,7 +204,7 @@ static void parseAndPrintFrame(t_mbusCommHandle *localMbusCommHandle) { coloredMsg(LOG_YELLOW, true, "mbc papf [%d] Error ratio is %.2f", localMbusCommHandle->requestId, errorRatio); - mqttPublishf(MBUS_TOPIC, "{\"Status\":\"Error\", \"RequestId\":\"%d\", \"Device\":\"%s\", \"ErrorRatio\":\"%.2f\"}", + mqttPublishf(MBUS_TOPIC, "{\"Status\":\"Ok\", \"RequestId\":\"%d\", \"Device\":\"%s\", \"ErrorRatio\":\"%.2f\"}", localMbusCommHandle->requestId, localMbusCommHandle->device->deviceName, errorRatio); } else { coloredMsg(LOG_RED, true, "mbc papf [%d] err: unable to parse frame", localMbusCommHandle->requestId);