Skip to content

Remove dynamic memory allocations. Add support for TF-PSA encryption. Add logging. Add extra sensors.#51

Merged
PolarGoose merged 1 commit into
mainfrom
experimental
Apr 15, 2026
Merged

Remove dynamic memory allocations. Add support for TF-PSA encryption. Add logging. Add extra sensors.#51
PolarGoose merged 1 commit into
mainfrom
experimental

Conversation

@PolarGoose
Copy link
Copy Markdown
Collaborator

@PolarGoose PolarGoose commented Apr 15, 2026

  • Remove dynamic memory allocations
  • Add support for TF-PSA encryption
  • Improve test coverage
  • Add logging
  • Incorporate pull request: add OBIS for israel meters #50

Copilot AI review requested due to automatic review settings April 15, 2026 07:14
Copy link
Copy Markdown

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 refactors the DSMR parsing/decryption APIs to remove dynamic allocations, add logging, add TF-PSA AES-128-GCM support, and expand protocol coverage (incl. Israel-specific OBIS fields), with corresponding test and documentation updates.

Changes:

  • Refactor parsing/accumulation APIs to work on std::string_view/std::span<uint8_t> and return bool/std::optional with error details routed through logging.
  • Introduce a pluggable AES-128-GCM decryptor interface and add a TF-PSA implementation; update DLMS decryptor to return DsmrUnencryptedTelegram.
  • Expand unit tests and examples, add a shared test log-capture fixture, and update README to reflect new capabilities/goals.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_util.h Adds a logger capture fixture used throughout tests.
tests/parser_test.cpp Updates parser tests to new DsmrParser API, adds Israel OBIS coverage, and asserts on logged errors.
tests/parser_include_test.cpp Updates include/compile smoke test to new parser API.
tests/packet_accumulator_test.cpp Migrates to uint8_t buffers, new return type, and log-based assertions.
tests/packet_accumulator_include_test.cpp Updates include/compile smoke test for new PacketAccumulator ctor signature.
tests/packet_accumulator_example_test.cpp Updates usage example to new accumulator/parser APIs and improves inline guidance.
tests/dlms_packet_decryptor_test.cpp Updates decryptor tests for new interface and adds TF-PSA backend coverage.
tests/dlms_packet_decryptor_include_test.cpp Updates include/compile smoke test for new decryptor construction and key type.
tests/dlms_packet_decryptor_example_test.cpp Updates decryptor example to new API and documents available backends.
tests/decryption/aes128gcm_tfpsa_include_test.cpp Adds include/compile smoke test for the TF-PSA backend header.
tests/decryption/aes128gcm_mbedtls_include_test.cpp Updates include/compile smoke test paths/types for mbedTLS backend.
tests/decryption/aes128gcm_bearssl_include_test.cpp Updates include/compile smoke test paths/types for BearSSL backend.
src/dsmr_parser/util.h Removes ParseResult, adds DsmrUnencryptedTelegram and a global Logger facility.
src/dsmr_parser/parser.h Rewrites parsing to string_view + logging, adds DsmrParser entrypoint.
src/dsmr_parser/packet_accumulator.h Switches to uint8_t buffers and returns std::optional<DsmrUnencryptedTelegram> with logging.
src/dsmr_parser/fields.h Migrates fields to string_view storage and new parsing helpers; adds Israel-specific OBIS fields.
src/dsmr_parser/dlms_packet_decryptor.h Refactors decryptor to use a backend interface and return DsmrUnencryptedTelegram; adds extra validation/logging.
src/dsmr_parser/decryption/aes128gcm.h Introduces new AES-128-GCM key/decryptor interface and hex parsing.
src/dsmr_parser/decryption/aes128gcm_mbedtls.h Updates mbedTLS backend to implement the new decryptor interface.
src/dsmr_parser/decryption/aes128gcm_bearssl.h Updates BearSSL backend to implement the new decryptor interface and improves header detection.
src/dsmr_parser/decryption/aes128gcm_tfpsa.h Adds TF-PSA AES-128-GCM decryptor backend.
src/dsmr_parser/aes128gcm.h Removes old key type/header (replaced by decryption/aes128gcm.h).
README.md Updates stated goals (no dynamic allocations), supported encryption backends, and links/examples.

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

Comment thread src/dsmr_parser/parser.h
Comment thread src/dsmr_parser/dlms_packet_decryptor.h
Comment thread src/dsmr_parser/decryption/aes128gcm_tfpsa.h
Comment thread src/dsmr_parser/decryption/aes128gcm.h
Comment thread src/dsmr_parser/util.h
Comment thread src/dsmr_parser/util.h
Comment thread src/dsmr_parser/parser.h
Comment thread src/dsmr_parser/parser.h
Copy link
Copy Markdown

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

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.


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

Comment thread src/dsmr_parser/fields.h
Comment thread src/dsmr_parser/util.h
Comment thread src/dsmr_parser/packet_accumulator.h
Comment thread tests/parser_test.cpp
* Add support for TF-PSA encryption
* Improve test coverage
* Add logging
* Incorporate pull request "add OBIS for israel meters": #50
* Increase the version of the library to "1.3.0"
@PolarGoose PolarGoose merged commit 8c341b9 into main Apr 15, 2026
7 checks passed
@PolarGoose PolarGoose deleted the experimental branch April 15, 2026 10:50
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