less logging
This commit is contained in:
@ -129,7 +129,7 @@ t_mbusCommStats *mbusCommGetStats() {
|
|||||||
|
|
||||||
static void printError() {
|
static void printError() {
|
||||||
float errorRatio = ((float) mbusCommHandle.device->failures) / ((float) mbusCommHandle.device->requests);
|
float errorRatio = ((float) mbusCommHandle.device->failures) / ((float) mbusCommHandle.device->requests);
|
||||||
coloredMsg(LOG_YELLOW, true, "mbc pe [%d] Error ratio is %.2f",
|
coloredMsg(LOG_YELLOW, false, "mbc pe [%d] Error ratio is %.2f",
|
||||||
mbusCommHandle.requestId,
|
mbusCommHandle.requestId,
|
||||||
errorRatio);
|
errorRatio);
|
||||||
mqttPublishf(config->mbusDataTopic, "{\"Status\":\"Error\", \"RequestId\":\"%d\", \"Device\":\"%s\", \"Errors\":\"%d\", \"Requests\":\"%d\", \"ErrorRatio\":\"%.2f\"}",
|
mqttPublishf(config->mbusDataTopic, "{\"Status\":\"Error\", \"RequestId\":\"%d\", \"Device\":\"%s\", \"Errors\":\"%d\", \"Requests\":\"%d\", \"ErrorRatio\":\"%.2f\"}",
|
||||||
@ -210,14 +210,14 @@ static void parseAndPrintFrame() {
|
|||||||
if (parsedVIB.found) {
|
if (parsedVIB.found) {
|
||||||
uint32_t value = strtol(mbus_data_record_value(record), NULL, 10);
|
uint32_t value = strtol(mbus_data_record_value(record), NULL, 10);
|
||||||
float weightedValue = ((float) value) * powf(10.0, ((float) parsedVIB.exponent));
|
float weightedValue = ((float) value) * powf(10.0, ((float) parsedVIB.exponent));
|
||||||
coloredMsg(LOG_YELLOW, true, "mbc papf [%d] %s is %.1f %s (%d * 10^%d)",
|
coloredMsg(LOG_YELLOW, false, "mbc papf [%d] %s is %.1f %s (%d * 10^%d)",
|
||||||
mbusCommHandle.requestId, parsedVIB.name, weightedValue, parsedVIB.unit,
|
mbusCommHandle.requestId, parsedVIB.name, weightedValue, parsedVIB.unit,
|
||||||
value, parsedVIB.exponent);
|
value, parsedVIB.exponent);
|
||||||
keys[numOfConsideredFields] = parsedVIB.name;
|
keys[numOfConsideredFields] = parsedVIB.name;
|
||||||
values[numOfConsideredFields] = weightedValue;
|
values[numOfConsideredFields] = weightedValue;
|
||||||
numOfConsideredFields++;
|
numOfConsideredFields++;
|
||||||
} else {
|
} else {
|
||||||
coloredMsg(LOG_YELLOW, true, "mbc papf [%d] L:%d, VIF: 0x%02x U:%s V:%s",
|
coloredMsg(LOG_YELLOW, false, "mbc papf [%d] L:%d, VIF: 0x%02x U:%s V:%s",
|
||||||
mbusCommHandle.requestId,
|
mbusCommHandle.requestId,
|
||||||
mbusCommHandle.device->consideredField[j],
|
mbusCommHandle.device->consideredField[j],
|
||||||
record->drh.vib.vif,
|
record->drh.vib.vif,
|
||||||
@ -229,7 +229,7 @@ static void parseAndPrintFrame() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float errorRatio = ((float) mbusCommHandle.device->failures) / ((float) mbusCommHandle.device->requests);
|
float errorRatio = ((float) mbusCommHandle.device->failures) / ((float) mbusCommHandle.device->requests);
|
||||||
coloredMsg(LOG_YELLOW, true, "mbc papf [%d] Error ratio is %.2f",
|
coloredMsg(LOG_YELLOW, false, "mbc papf [%d] Error ratio is %.2f",
|
||||||
mbusCommHandle.requestId,
|
mbusCommHandle.requestId,
|
||||||
errorRatio);
|
errorRatio);
|
||||||
if (numOfConsideredFields == 1) {
|
if (numOfConsideredFields == 1) {
|
||||||
@ -588,9 +588,9 @@ static e_mbusCommRequestResult mbusCommRequest(t_mbusDevice *mbusDevice) {
|
|||||||
mbusCommHandle.device = mbusDevice;
|
mbusCommHandle.device = mbusDevice;
|
||||||
mbusDevice->requests += 1;
|
mbusDevice->requests += 1;
|
||||||
|
|
||||||
coloredMsg(LOG_YELLOW, true, "mbc mcr [%d] new request %s",
|
coloredMsg(LOG_YELLOW, true, "mbc mcr [%d] new request %s (%d)",
|
||||||
mbusCommHandle.requestId,
|
mbusCommHandle.requestId,
|
||||||
mbusDevice->deviceName);
|
mbusDevice->deviceName, mbusDevice->address);
|
||||||
|
|
||||||
oledPrint(OLED_SCREEN0, mbusDevice->deviceName);
|
oledPrint(OLED_SCREEN0, mbusDevice->deviceName);
|
||||||
res = MBCRR_TRIGGERED;
|
res = MBCRR_TRIGGERED;
|
||||||
@ -621,7 +621,7 @@ void mbusCommAddDevice(t_deviceBlock *deviceBlock) {
|
|||||||
devices[numOfDevices].delay = 0;
|
devices[numOfDevices].delay = 0;
|
||||||
devices[numOfDevices].waiting = false;
|
devices[numOfDevices].waiting = false;
|
||||||
devices[numOfDevices].active = true;
|
devices[numOfDevices].active = true;
|
||||||
coloredMsg(LOG_YELLOW, true, "mbc mbcad device added %d %s %d", numOfDevices, devices[numOfDevices].deviceName, devices[numOfDevices].address);
|
coloredMsg(LOG_YELLOW, false, "mbc mbcad device added %d %s %d", numOfDevices, devices[numOfDevices].deviceName, devices[numOfDevices].address);
|
||||||
numOfDevices += 1;
|
numOfDevices += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user