vif parsing
This commit is contained in:
parent
e369c51c96
commit
c6ba4914f3
@ -1,5 +1,6 @@
|
||||
#include <mbus/mbus-protocol.h>
|
||||
#include <mbusParserExt.h>
|
||||
#include <logger.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -23,6 +24,12 @@ static parsedVIB_t parseVIB_default(mbus_value_information_block vib) {
|
||||
strcpy(parsedVIB.name, "Energy");
|
||||
strcpy(parsedVIB.unit, "Wh");
|
||||
parsedVIB.exponent = (vib.vif & 0b0111) - 3;
|
||||
} else if ((vib.vif & 0b00101000) == 0b00101000) {
|
||||
strcpy(parsedVIB.name, "Power");
|
||||
strcpy(parsedVIB.unit, "W");
|
||||
parsedVIB.exponent = (vib.vif & 0b0111) - 3;
|
||||
} else {
|
||||
coloredMsg(LOG_RED, true, "mpe pvd unknown vif 0x%02x", vib.vif);
|
||||
}
|
||||
|
||||
return parsedVIB;
|
||||
|
Loading…
x
Reference in New Issue
Block a user