Ignore filler DIF (= 0x2F)
This commit is contained in:
parent
91f0c87207
commit
363f59a149
@ -2677,6 +2677,12 @@ mbus_data_variable_parse(mbus_frame *frame, mbus_data_variable *data)
|
||||
|
||||
while (i < frame->data_size)
|
||||
{
|
||||
// Skip filler dif=2F
|
||||
while (((frame->data[i] & 0xFF) == 0x2F) && (i < frame->data_size)) {
|
||||
i++;
|
||||
}
|
||||
if (i == frame->data_size) break;
|
||||
|
||||
if ((record = mbus_data_record_new()) == NULL)
|
||||
{
|
||||
// clean up...
|
||||
|
1
test/test-frames/wmbus-converted.hex
Normal file
1
test/test-frames/wmbus-converted.hex
Normal file
@ -0,0 +1 @@
|
||||
68 1f 1f 68 08 00 72 31 77 67 17 2d 2c 01 02 00 00 00 00 2f 2f 04 83 3b 88 13 00 00 2f 2f 2f 2f 2f 2f 2f 00 16
|
21
test/test-frames/wmbus-converted.xml
Normal file
21
test/test-frames/wmbus-converted.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<MBusData>
|
||||
|
||||
<SlaveInformation>
|
||||
<Id>17677731</Id>
|
||||
<Manufacturer>KAM</Manufacturer>
|
||||
<Version>1</Version>
|
||||
<ProductName>Kamstrup 382 (6850-005)</ProductName>
|
||||
<Medium>Electricity</Medium>
|
||||
<AccessNumber>0</AccessNumber>
|
||||
<Status>00</Status>
|
||||
<Signature>0000</Signature>
|
||||
</SlaveInformation>
|
||||
|
||||
<DataRecord id="0">
|
||||
<Function>Instantaneous value</Function>
|
||||
<Unit>Energy (Wh)</Unit>
|
||||
<Value>5000</Value>
|
||||
<Timestamp>1970-01-01T00:00:00</Timestamp>
|
||||
</DataRecord>
|
||||
|
||||
</MBusData>
|
Loading…
x
Reference in New Issue
Block a user