Added new defines for decoding dif

This commit is contained in:
Stefan Wahren 2012-04-22 16:06:54 +02:00
parent 5ce9a540ed
commit e2400f5c27
2 changed files with 4 additions and 1 deletions

View File

@ -2096,7 +2096,7 @@ mbus_data_record_function(mbus_data_record *record)
if (record)
{
switch (record->drh.dib.dif & 0x30)
switch (record->drh.dib.dif & MBUS_DATA_RECORD_DIF_MASK_FUNCTION)
{
case 0x00:
snprintf(buff, sizeof(buff), "Instantaneous value");

View File

@ -405,8 +405,11 @@ typedef struct _mbus_data_secondary_address {
#define MBUS_DATA_RECORD_DIF_MASK_MIN 0x10
#define MBUS_DATA_RECORD_DIF_MASK_TYPE_INT32 0x04
#define MBUS_DATA_RECORD_DIF_MASK_DATA 0x0F
#define MBUS_DATA_RECORD_DIF_MASK_FUNCTION 0x30
#define MBUS_DATA_RECORD_DIF_MASK_STORAGE_NO 0x40
#define MBUS_DATA_RECORD_DIF_MASK_EXTENTION 0x80
#define MBUS_DATA_RECORD_DIF_MASK_NON_DATA 0xF0
//
// GENERAL APPLICATION ERRORS