publishing results
This commit is contained in:
parent
5e4f9063e1
commit
5ed7fdce0f
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user