-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add facilities for parsing concatenated QR codes. #38728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add facilities for parsing concatenated QR codes. #38728
Conversation
This supports the format described in section 5.1.6 "Concatenation" in the main Matter specification.
There was a problem hiding this 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 introduces support for parsing concatenated QR codes by extending the payload parsing logic and providing additional unit tests for both QR and manual payloads.
- Added new tests in TestSetupPayload.cpp and TestQRCode.cpp to validate various payload scenarios.
- Introduced the FromStringRepresentation API in SetupPayload.{h,cpp} to handle manual and QR code representations.
- Extended QRCodeSetupPayloadParser with new parsing logic to support concatenated payloads.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/setup_payload/tests/TestSetupPayload.cpp | New unit tests for various invalid and valid payload representations for setup payloads. |
| src/setup_payload/tests/TestQRCode.cpp | Added tests to validate QR code extraction and parsing for multiple payloads. |
| src/setup_payload/SetupPayload.h | Introduced the FromStringRepresentation API with detailed documentation. |
| src/setup_payload/SetupPayload.cpp | Implemented FromStringRepresentation handling both manual and QR code payloads. |
| src/setup_payload/QRCodeSetupPayloadParser.h | Added documentation and new helper functions for parsing concatenated payloads. |
| src/setup_payload/QRCodeSetupPayloadParser.cpp | Extended parsing logic to extract and parse individual payload chunks from a QR code. |
Files not reviewed (1)
- src/setup_payload/tests/BUILD.gn: Language not supported
|
PR #38728: Size comparison from 4df81a2 to 2b0bfb3 Increases above 0.2%:
Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cyw30739, efr32, esp32, linux, nrfconnect, psoc6, qpg, stm32, telink, tizen)
|
|
PR #38728: Size comparison from 4df81a2 to 7308b90 Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Also fix clang-tidy issue with indices.
7308b90 to
7bf4ad8
Compare
|
PR #38728: Size comparison from 928cd29 to 7bf4ad8 Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
* Just return CHIP_ERROR, not a variant. * Naming and documentation fixes.
* Add facilities for parsing concatenated QR codes. This supports the format described in section 5.1.6 "Concatenation" in the main Matter specification. * Address review comments. * Update allow-list for headaers in QRCodeSetupPayloadParser.cpp * Try to fix CI issues by avoiding stringstream. Also fix clang-tidy issue with indices. * Addresss review comments. * Just return CHIP_ERROR, not a variant. * Naming and documentation fixes.
* Add facilities for parsing concatenated QR codes. This supports the format described in section 5.1.6 "Concatenation" in the main Matter specification. * Address review comments. * Update allow-list for headaers in QRCodeSetupPayloadParser.cpp * Try to fix CI issues by avoiding stringstream. Also fix clang-tidy issue with indices. * Addresss review comments. * Just return CHIP_ERROR, not a variant. * Naming and documentation fixes.
This supports the format described in section 5.1.6 "Concatenation" in the main Matter specification.
Testing
Unit tests included in the PR.