Skip to content

ETR01SDK-430: Fixed l3_chunk size in lt_l2_encrypted_cmd_*#451

Merged
andreondra merged 2 commits intodevelopfrom
ETR01SDK-430-Check-l3_chunk-size-in-lt_l2_encrypted_cmd_req_t
Feb 6, 2026
Merged

ETR01SDK-430: Fixed l3_chunk size in lt_l2_encrypted_cmd_*#451
andreondra merged 2 commits intodevelopfrom
ETR01SDK-430-Check-l3_chunk-size-in-lt_l2_encrypted_cmd_req_t

Conversation

@andreondra
Copy link
Contributor

@andreondra andreondra commented Feb 4, 2026

Description

Use correct size of the l3_chunk member according to the TROPIC01 API.


Type of Change

Select the type(s) that best describe your change:

  • 🐛 Bug fix
  • ✨ New feature
  • 🧹 Code cleanup or refactoring
  • 📝 Documentation update
  • 🔧 Build system or toolchain update
  • 🔒 Security improvement
  • Other (please describe):

Checklist

Before submitting, please confirm that you have completed the following:

  • I opened the Pull Request to the develop branch
  • I followed the project's code guidelines
  • I formatted the code using clang-format with the recommended configuration
  • I updated the changelog, or this change does not require it (e.g., internal or non-functional update)
  • The project builds without errors or warnings
  • I have verified the functionality against the hardware/model as applicable
  • I have ensured that public APIs remain backward compatible (if applicable)
  • This PR is ready for review by maintainers (no WIP commits left) and marked as Ready for Review

Optional Checks

You can enable optional CI jobs by checking following boxes. For example, coverage job is useful when modifying or implementing new tests.

  • Measure Test Coverage

@andreondra andreondra self-assigned this Feb 4, 2026
@andreondra andreondra added the bug Something isn't working label Feb 4, 2026
@andreondra
Copy link
Contributor Author

andreondra commented Feb 5, 2026

Valgrind CI fails because of some problem with packages. I think that's out of scope of this PR.

Edit: solved in #453

Copy link
Contributor

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 bug in the L2 API struct definitions where the l3_chunk array size was hardcoded to 255 bytes instead of using the correct API-specified constant TR01_L2_CHUNK_MAX_DATA_SIZE (252 bytes). The hardcoded value was inconsistent with the TROPIC01 hardware API specification and with the actual usage throughout the codebase, where the constant was already being used for chunk size calculations.

Changes:

  • Updated lt_l2_encrypted_cmd_req_t struct to use TR01_L2_CHUNK_MAX_DATA_SIZE instead of hardcoded 255
  • Updated lt_l2_encrypted_cmd_rsp_t struct to use TR01_L2_CHUNK_MAX_DATA_SIZE instead of hardcoded 255
  • Added changelog entry documenting the change

Reviewed changes

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

File Description
src/lt_l2_api_structs.h Fixed l3_chunk array size in both request and response structs to use the correct constant (252) instead of hardcoded value (255)
CHANGELOG.md Added entry for version 3.2.0 documenting the struct size change (with minor typo)

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

Copy link
Contributor

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 2 out of 2 changed files in this pull request and generated no new comments.


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

@andreondra andreondra requested a review from medexs February 5, 2026 09:07
@andreondra andreondra marked this pull request as ready for review February 5, 2026 09:07
@andreondra andreondra merged commit feace33 into develop Feb 6, 2026
14 of 17 checks passed
@andreondra andreondra deleted the ETR01SDK-430-Check-l3_chunk-size-in-lt_l2_encrypted_cmd_req_t branch February 6, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants