vif parsing
This commit is contained in:
parent
f6e10183db
commit
e369c51c96
@ -7,7 +7,7 @@
|
||||
typedef struct {
|
||||
char name[32];
|
||||
char unit[16];
|
||||
uint8_t exponent;
|
||||
int8_t exponent;
|
||||
} parsedVIB_t;
|
||||
|
||||
parsedVIB_t parseVIB(mbus_value_information_block vib);
|
||||
|
@ -22,6 +22,7 @@ static parsedVIB_t parseVIB_default(mbus_value_information_block vib) {
|
||||
if ((vib.vif & 0b00000000) == 0b00000000) {
|
||||
strcpy(parsedVIB.name, "Energy");
|
||||
strcpy(parsedVIB.unit, "Wh");
|
||||
parsedVIB.exponent = (vib.vif & 0b0111) - 3;
|
||||
}
|
||||
|
||||
return parsedVIB;
|
||||
|
Loading…
x
Reference in New Issue
Block a user