first use of libmbus

This commit is contained in:
Wolfgang Hottgenroth 2020-11-03 12:56:50 +01:00
parent 9c76689e06
commit 54233f4a99
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -76,16 +76,18 @@ static void parseAndPrintFrame(t_longframe *frame) {
int r = mbus_frame_data_parse(&reply, &frame_data);
if (r == 0) {
mbus_data_variable *data_var = &(frame_data.data_var);
logMsg("papf sts: %d", data_var->header.status);
mbus_data_record *record;
int i;
for (record = frame_data.data_var.record, i = 0;
for (record = data_var->record, i = 0;
record;
record = record->next, i++) {
logMsg("papf txt: U:%s V:%s",
mbus_data_record_unit(record),
mbus_data_record_value(record));
}
mbus_data_record_free(frame_data.data_var.record);
mbus_data_record_free(data_var->record);
} else {
logMsg("papf err: unable to parse frame");
}