less logging

This commit is contained in:
2020-12-18 20:18:51 +01:00
parent ad141d8687
commit 5bd953781c

View File

@ -129,7 +129,7 @@ t_mbusCommStats *mbusCommGetStats() {
static void printError() {
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,
errorRatio);
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) {
uint32_t value = strtol(mbus_data_record_value(record), NULL, 10);
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,
value, parsedVIB.exponent);
keys[numOfConsideredFields] = parsedVIB.name;
values[numOfConsideredFields] = weightedValue;
numOfConsideredFields++;
} 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.device->consideredField[j],
record->drh.vib.vif,
@ -229,7 +229,7 @@ static void parseAndPrintFrame() {
}
}
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,
errorRatio);
if (numOfConsideredFields == 1) {
@ -588,9 +588,9 @@ static e_mbusCommRequestResult mbusCommRequest(t_mbusDevice *mbusDevice) {
mbusCommHandle.device = mbusDevice;
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,
mbusDevice->deviceName);
mbusDevice->deviceName, mbusDevice->address);
oledPrint(OLED_SCREEN0, mbusDevice->deviceName);
res = MBCRR_TRIGGERED;
@ -621,7 +621,7 @@ void mbusCommAddDevice(t_deviceBlock *deviceBlock) {
devices[numOfDevices].delay = 0;
devices[numOfDevices].waiting = false;
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;
}