Merge pull request #38 from keepfocus/master

Handle filler DIF
This commit is contained in:
Robert Johansson 2013-03-17 01:40:14 -07:00
commit a7ac8c3136
4 changed files with 30 additions and 0 deletions

View File

@ -2677,6 +2677,13 @@ mbus_data_variable_parse(mbus_frame *frame, mbus_data_variable *data)
while (i < frame->data_size)
{
// Skip filler dif=2F
if ((frame->data[i] & 0xFF) == MBUS_DIB_DIF_IDLE_FILLER)
{
i++;
continue;
}
if ((record = mbus_data_record_new()) == NULL)
{
// clean up...

View File

@ -129,6 +129,7 @@ typedef struct _mbus_slave_data {
#define MBUS_DIB_VIF_EXTENSION_BIT 0x80
#define MBUS_DIB_DIF_MANUFACTURER_SPECIFIC 0x0F
#define MBUS_DIB_DIF_MORE_RECORDS_FOLLOW 0x1F
#define MBUS_DIB_DIF_IDLE_FILLER 0x2F
typedef struct _mbus_data_information_block {

View 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

View 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>