Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DIFE handling #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Zeppelin500
Copy link

@Zeppelin500 Zeppelin500 commented Oct 22, 2023

The code snipped prevent the libary to come out of step if a DIFE is used. DIFE fields are NOT analyzed, but now you can read out the whole telegram without a failure and get some usefull data. Tested with a Engelmann Sensostar U, which use some DIFE.

// handle DIFE to prevent stumble if a DIFE is used
bool dife = ((dif & 0x80) == 0x80); //check if the first bit of DIF marked as "DIFE is following" 
while(dife) {
   index++;
   dife = false;
   dife = ((buffer[index-1] & 0x80) == 0x80); //check if after the DIFE another DIFE is following 
      } 
    //  End of DIFE handling

One another question:
Why the time points are commented out?

  //{ MBUS_CODE::TIME_POINT_DATE         , 0x6C     , 1,   0},
  //{ MBUS_CODE::TIME_POINT_DATETIME     , 0x6D     , 1,   0},

negativ values (2 Bytes), less decode errors
change the whole logic of data decoding to get formatet dates.
@ShubhamKharche9892
Copy link

{ MBUS_CODE::TIME_POINT_DATE , 0x6C , 1, 0},
{ MBUS_CODE::TIME_POINT_DATETIME , 0x6D , 1, 0},
what basis u choose based value 0x6c

@Zeppelin500
Copy link
Author

Zeppelin500 commented Jul 3, 2024

Describe what you want to do and read the M-Bus documentation. I do not understand your question. I think the library is no longer supported by the author. If you want to decode, use the MBusinoLib. It is a greatly expanded fork of this library and should now support almost all devices.
https://github.com/Zeppelin500/MBusinoLib
You can play with the Wokwi example and change the telegram to your own telegram.

PS:
https://m-bus.com/assets/downloads/MBDOC48.PDF
See Chapter 8.4.3 and following. Attention to the small "n"s for exponent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants