vif parsing
This commit is contained in:
parent
c6ba4914f3
commit
0eba87a107
@ -20,11 +20,11 @@ static parsedVIB_t parseVIB_FD(mbus_value_information_block vib) {
|
||||
static parsedVIB_t parseVIB_default(mbus_value_information_block vib) {
|
||||
parsedVIB_t parsedVIB = { .name = "default unknown", .unit = "?", .exponent = 1 };
|
||||
|
||||
if ((vib.vif & 0b00000000) == 0b00000000) {
|
||||
if ((vib.vif & 0b01111000) == 0b00000000) {
|
||||
strcpy(parsedVIB.name, "Energy");
|
||||
strcpy(parsedVIB.unit, "Wh");
|
||||
parsedVIB.exponent = (vib.vif & 0b0111) - 3;
|
||||
} else if ((vib.vif & 0b00101000) == 0b00101000) {
|
||||
} else if ((vib.vif & 0b01111000) == 0b00101000) {
|
||||
strcpy(parsedVIB.name, "Power");
|
||||
strcpy(parsedVIB.unit, "W");
|
||||
parsedVIB.exponent = (vib.vif & 0b0111) - 3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user