Skip to content

Properly parse lines like "1-0:0.2.0((ER11))".#45

Merged
PolarGoose merged 1 commit intomainfrom
fix_parsing
Feb 5, 2026
Merged

Properly parse lines like "1-0:0.2.0((ER11))".#45
PolarGoose merged 1 commit intomainfrom
fix_parsing

Conversation

@PolarGoose
Copy link
Collaborator

@PolarGoose PolarGoose commented Feb 5, 2026

Fix issue [dsmr] 2026.1.3 no longer works and prints out Unexpected '(' symbol repeatidly.
The smart meter ISk5\\2M550T-2006 output contains the line 1-0:0.2.0((ER11)). This causes the parser to fail with the error Unexpected '(' symbol.

Changes:

  • The parser properly handles this case.
  • Change fw version fields to strings instead on integer. Because a version can be an arbitrary string.
  • Increase the version to 1.1.0

Copilot AI review requested due to automatic review settings February 5, 2026 15:22
Copy link

Copilot AI left a comment

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 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) and StringParser (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) from FixedValue numeric types to std::string types 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.

@PolarGoose PolarGoose merged commit 62481cf into main Feb 5, 2026
2 checks passed
@PolarGoose PolarGoose deleted the fix_parsing branch February 5, 2026 22:33
@PolarGoose PolarGoose mentioned this pull request Feb 5, 2026
@PolarGoose PolarGoose restored the fix_parsing branch February 6, 2026 11:01
@PolarGoose PolarGoose deleted the fix_parsing branch February 6, 2026 11:04
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.

1 participant