meterbus debug
This commit is contained in:
parent
1408c4942c
commit
eea6b7de3b
@ -116,7 +116,7 @@ static void printError(t_mbusCommHandle *localMbusCommHandle) {
|
|||||||
mqttPublishf(MBUS_TOPIC, "{\"Status\":\"Error\", \"RequestId\":\"%d\", \"Device\":\"%s\", \"Errors\":\"%d\", \"Requests\":\"%d\", \"ErrorRatio\":\"%.2f\"}",
|
mqttPublishf(MBUS_TOPIC, "{\"Status\":\"Error\", \"RequestId\":\"%d\", \"Device\":\"%s\", \"Errors\":\"%d\", \"Requests\":\"%d\", \"ErrorRatio\":\"%.2f\"}",
|
||||||
localMbusCommHandle->requestId, localMbusCommHandle->device->deviceName,
|
localMbusCommHandle->requestId, localMbusCommHandle->device->deviceName,
|
||||||
localMbusCommHandle->device->failures, localMbusCommHandle->device->requests, errorRatio);
|
localMbusCommHandle->device->failures, localMbusCommHandle->device->requests, errorRatio);
|
||||||
oledPrintf(OLED_SCREEN0, "Err:%d/%d", localMbusCommHandle->device->failures, localMbusCommHandle->device->requests);
|
oledPrintf(OLED_SCREEN0, "Err:%d/%d %.2f", localMbusCommHandle->device->failures, localMbusCommHandle->device->requests, errorRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ static void parseAndPrintFrame(t_mbusCommHandle *localMbusCommHandle) {
|
|||||||
localMbusCommHandle->device->failures, localMbusCommHandle->device->requests, errorRatio,
|
localMbusCommHandle->device->failures, localMbusCommHandle->device->requests, errorRatio,
|
||||||
keys[0], values[0], keys[1], values[1], keys[2], values[2], keys[3], values[3]);
|
keys[0], values[0], keys[1], values[1], keys[2], values[2], keys[3], values[3]);
|
||||||
}
|
}
|
||||||
oledPrintf(OLED_SCREEN0, "Ok:%d/%d", localMbusCommHandle->device->failures, localMbusCommHandle->device->requests);
|
oledPrintf(OLED_SCREEN0, "Ok:%d/%d %.2f", localMbusCommHandle->device->failures, localMbusCommHandle->device->requests, errorRatio);
|
||||||
mbus_data_record_free(data_var->record);
|
mbus_data_record_free(data_var->record);
|
||||||
} else {
|
} else {
|
||||||
coloredMsg(LOG_RED, true, "mbc papf [%d] err: unable to parse frame", localMbusCommHandle->requestId);
|
coloredMsg(LOG_RED, true, "mbc papf [%d] err: unable to parse frame", localMbusCommHandle->requestId);
|
||||||
@ -255,6 +255,7 @@ static void timeoutHandler(void *handle) {
|
|||||||
|
|
||||||
static void receiveNext(t_mbusCommHandle *localMbusCommHandle) {
|
static void receiveNext(t_mbusCommHandle *localMbusCommHandle) {
|
||||||
localMbusCommHandle->receiving = true;
|
localMbusCommHandle->receiving = true;
|
||||||
|
coloredMsg(LOG_RED, false, "RS: %d", localMbusCommHandle->state);
|
||||||
HAL_UART_Receive_IT(&mbusUart, &(localMbusCommHandle->receivedOctet), 1);
|
HAL_UART_Receive_IT(&mbusUart, &(localMbusCommHandle->receivedOctet), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,6 +493,7 @@ void mbusCommTxCpltCallback(UART_HandleTypeDef *huart) {
|
|||||||
|
|
||||||
void mbusCommRxCpltCallback(UART_HandleTypeDef *huart) {
|
void mbusCommRxCpltCallback(UART_HandleTypeDef *huart) {
|
||||||
if (mbusCommHandle.receiving) {
|
if (mbusCommHandle.receiving) {
|
||||||
|
coloredMsg(LOG_RED, false, "RO: 0x%02x", mbusCommHandle.receivedOctet);
|
||||||
schAdd(handleRequestEngine, (void*) &mbusCommHandle, 0, 0);
|
schAdd(handleRequestEngine, (void*) &mbusCommHandle, 0, 0);
|
||||||
mbusCommHandle.receiving = false;
|
mbusCommHandle.receiving = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user