vif parsing
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <main.h>
|
||||
#include <usart.h>
|
||||
@ -180,6 +181,12 @@ static void parseAndPrintFrame(t_mbusCommHandle *localMbusCommHandle) {
|
||||
coloredMsg(LOG_YELLOW, true, "mbc papf [%d] parsed VIB N: %s, U: %s, E: %d",
|
||||
localMbusCommHandle->requestId,
|
||||
parsedVIB.name, parsedVIB.unit, parsedVIB.exponent);
|
||||
if (parsedVIB.found) {
|
||||
uint8_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] result: %s is %d %s",
|
||||
localMbusCommHandle->requestId, parsedVIB.name, weightedValue, parsedVIB.unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user