vif parsing
This commit is contained in:
parent
e1a77d4fbf
commit
f6e10183db
@ -1,22 +1,28 @@
|
|||||||
#include <mbus/mbus-protocol.h>
|
#include <mbus/mbus-protocol.h>
|
||||||
#include <mbusParserExt.h>
|
#include <mbusParserExt.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
static parsedVIB_t parseVIB_FB(mbus_value_information_block vib) {
|
static parsedVIB_t parseVIB_FB(mbus_value_information_block vib) {
|
||||||
parsedVIB_t parsedVIB = { .name = "FB", .unit = "?", .exponent = 1 };
|
parsedVIB_t parsedVIB = { .name = "FB unknown", .unit = "?", .exponent = 1 };
|
||||||
|
|
||||||
return parsedVIB;
|
return parsedVIB;
|
||||||
}
|
}
|
||||||
|
|
||||||
static parsedVIB_t parseVIB_FD(mbus_value_information_block vib) {
|
static parsedVIB_t parseVIB_FD(mbus_value_information_block vib) {
|
||||||
parsedVIB_t parsedVIB = { .name = "FD", .unit = "?", .exponent = 1 };
|
parsedVIB_t parsedVIB = { .name = "FD unknown", .unit = "?", .exponent = 1 };
|
||||||
|
|
||||||
return parsedVIB;
|
return parsedVIB;
|
||||||
}
|
}
|
||||||
|
|
||||||
static parsedVIB_t parseVIB_default(mbus_value_information_block vib) {
|
static parsedVIB_t parseVIB_default(mbus_value_information_block vib) {
|
||||||
parsedVIB_t parsedVIB = { .name = "default", .unit = "?", .exponent = 1 };
|
parsedVIB_t parsedVIB = { .name = "default unknown", .unit = "?", .exponent = 1 };
|
||||||
|
|
||||||
|
if ((vib.vif & 0b00000000) == 0b00000000) {
|
||||||
|
strcpy(parsedVIB.name, "Energy");
|
||||||
|
strcpy(parsedVIB.unit, "Wh");
|
||||||
|
}
|
||||||
|
|
||||||
return parsedVIB;
|
return parsedVIB;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user