Skip to content
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

Support Needed: chip-tool needs to have a way to generate QR code with TLV data #20226

Closed
liamgonyea opened this issue Jul 1, 2022 · 0 comments · Fixed by #20231
Closed

Support Needed: chip-tool needs to have a way to generate QR code with TLV data #20226

liamgonyea opened this issue Jul 1, 2022 · 0 comments · Fixed by #20231

Comments

@liamgonyea
Copy link
Contributor

Problem

Current implementation of chip-tool allows a user to generate a QR code with the required fields (./out/chip-tool/chip-tool payload generate-qrcode [--payload] [--discriminator] [--setup-pin-code] [--version] [--vendor-id] [--product-id] [--commissioning-mode] [--allow-invalid-payload] [--rendezvous]) but does not allow for the optional TLV data to be included.

This is needed to properly test that a DUT=commissioner can parse a QR code (with TLV data) and sort out the needed required fields ( [--payload] [--discriminator] [--setup-pin-code] [--version] [--vendor-id] [--product-id] [--commissioning-mode] [--rendezvous])

Spec Reference

5.1.3. QR Code - Table 35. Packed Binary Data Structure for Onboarding Payload
image

Appendix A: Tag-length-value (TLV) Encoding Format

Proposed Solution

Add a way to add TLV data to a QR code through an optional field in the ./chip-tool payload generate-qrcode command

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Jul 1, 2022
Specific changes:

1) Clarify the naming of some of the chip-tool payload arguments and add
   documentation.
2) Fix chip-tool handling of the existing-payload argument so that we error out
   on invalid existing payloads instead of silently pressing on.
3) Add a way to pass in the TLV-encoded extra bytes to be added to a payload.
   Unfortunately, only tags that our SetupPayload knows about right now are
   supported.
4) Add a function on QRCodeSetupPayloadGenerator that allows generating a code
   without having to guess at how much space the TLV will take up.
5) Add tests for that new function.

Fixes project-chip#20226
woody-apple pushed a commit that referenced this issue Jul 2, 2022
Specific changes:

1) Clarify the naming of some of the chip-tool payload arguments and add
   documentation.
2) Fix chip-tool handling of the existing-payload argument so that we error out
   on invalid existing payloads instead of silently pressing on.
3) Add a way to pass in the TLV-encoded extra bytes to be added to a payload.
   Unfortunately, only tags that our SetupPayload knows about right now are
   supported.
4) Add a function on QRCodeSetupPayloadGenerator that allows generating a code
   without having to guess at how much space the TLV will take up.
5) Add tests for that new function.

Fixes #20226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants