From 54233f4a99dd8cfb5248877e5a05e2593aca6d7c Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 3 Nov 2020 12:56:50 +0100 Subject: [PATCH] first use of libmbus --- cube/User/Src/mbusComm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cube/User/Src/mbusComm.c b/cube/User/Src/mbusComm.c index 9282156..2d3ac11 100644 --- a/cube/User/Src/mbusComm.c +++ b/cube/User/Src/mbusComm.c @@ -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"); }