Properly parse lines like "1-0:0.2.0((ER11))".#45
Merged
PolarGoose merged 1 commit intomainfrom Feb 5, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a parser issue where smart meters that output firmware version fields with double brackets (like 1-0:0.2.0((ER11))) would cause the parser to fail with an "Unexpected '(' symbol" error. Additionally, the PR changes firmware version and checksum fields from numeric types to strings to support arbitrary version formats.
Changes:
- Added double-bracket handling logic in both
P1Parser(for line detection) andStringParser(for value parsing) to properly parse values like((ER11))as(ER11) - Changed firmware version and checksum fields (
fw_core_version,fw_core_checksum,fw_module_version,fw_module_checksum) fromFixedValuenumeric types tostd::stringtypes to support non-numeric version strings - Added comprehensive test cases covering double-bracket scenarios and various edge cases
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/dsmr_parser/parser.h |
Added logic to handle double brackets in both line detection (P1Parser) and string value parsing (StringParser) |
src/dsmr_parser/fields.h |
Changed firmware version and checksum fields from numeric FixedValue to std::string with StringField parser, increased max length to 96 characters |
tests/parser_test.cpp |
Added test cases for double-bracket parsing scenarios, added firmware fields to test data structure, updated CRC to match new message content |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fecbb6d to
315ec6c
Compare
17 tasks
315ec6c to
6d194dc
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix issue [dsmr] 2026.1.3 no longer works and prints out Unexpected '(' symbol repeatidly.
The smart meter
ISk5\\2M550T-2006output contains the line1-0:0.2.0((ER11)). This causes the parser to fail with the errorUnexpected '(' symbol.Changes:
1.1.0