Skip to content

Skip the MBus short frame at the beginning of the buffer.#18

Merged
PolarGoose merged 1 commit into
mainfrom
skip_mbus_short_frame
Jul 13, 2026
Merged

Skip the MBus short frame at the beginning of the buffer.#18
PolarGoose merged 1 commit into
mainfrom
skip_mbus_short_frame

Conversation

@PolarGoose

@PolarGoose PolarGoose commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Fix #16

Copilot AI review requested due to automatic review settings July 12, 2026 17:57
@PolarGoose PolarGoose changed the title Fix https://github.com/esphome-libs/dlms_parser/issues/16 : Skip the MBus short frame at the beginning of the buffer. Skip the MBus short frame at the beginning of the buffer. Jul 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #16 by making the DLMS parser tolerate an M-Bus short frame prefix that some meters prepend to otherwise normal HDLC payloads, preventing spurious “invalid frame” / “no objects found” errors.

Changes:

  • Detect an M-Bus short frame at the beginning of the input buffer and skip its 5-byte prefix before transport auto-detection/decoding.
  • Add an integration test case that prepends 0x10 .. 0x16 (valid short frame) to an existing segmented HDLC dump to ensure parsing still succeeds.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/dlms_parser/dlms_parser.cpp Adds M-Bus short-frame prefix detection and strips it before HDLC/M-Bus/RAW decoding.
tests/test_meter_dumps.cpp Adds a regression test for an HDLC dump with a leading M-Bus short frame prefix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Skip the MBus short frame at the beginning of the buffer.
@PolarGoose
PolarGoose force-pushed the skip_mbus_short_frame branch from 7aa37e3 to 6b93a92 Compare July 12, 2026 20:31
@PolarGoose
PolarGoose merged commit b50d174 into main Jul 13, 2026
7 checks passed
@PolarGoose
PolarGoose deleted the skip_mbus_short_frame branch July 13, 2026 09:25
@PolarGoose
PolarGoose restored the skip_mbus_short_frame branch July 13, 2026 09:26
@PolarGoose
PolarGoose deleted the skip_mbus_short_frame branch July 13, 2026 09:27
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.

Landis+Gyr E450 two invalid frames HDLC Frame every hour

2 participants