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

[linux] Enable setup code options for linux example apps #8547

Merged
merged 5 commits into from
Jul 28, 2021
Merged

[linux] Enable setup code options for linux example apps #8547

merged 5 commits into from
Jul 28, 2021

Conversation

yufengwangca
Copy link
Contributor

@yufengwangca yufengwangca commented Jul 21, 2021

Problem

What is being fixed? Examples:

Change overview

Enable setup code options for linux example apps

Testing

How was this tested? (at least one bullet point required)

  1. Run chip-lighting-app -h to show new options for Setup Payload.
yufengw@yufengw-SEi:~/Workspace/connectedhomeip/examples/lighting-app/linux/out/debug$ ./chip-lighting-app -h
Usage: ./chip-lighting-app [options]

GENERAL OPTIONS

  --ble-device <number>
       The device number for CHIPoBLE, without 'hci' prefix, can be found by hciconfig.

  --wifi
       Enable WiFi management via wpa_supplicant.

  --thread
       Enable Thread management via ot-agent.

  --version <version>
       The version indication provides versioning of the setup payload.

  --vendor-id <id>
       The Vendor ID is assigned by the Connectivity Standards Alliance.

  --product-id <id>
       The Product ID is specified by vendor.

  --custom-flow <Standard = 0 | UserActionRequired = 1 | Custom = 2>
       A 2-bit unsigned enumeration specifying manufacturer-specific custom flow options.

  --capabilities <None = 0, SoftAP = 1 << 0, BLE = 1 << 1, OnNetwork = 1 << 2>
       Discovery Capabilities Bitmask which contains information about Device’s available technologies for device discovery.

  --discriminator <discriminator>
       A 12-bit unsigned integer match the value which a device advertises during commissioning.

  --passcode <passcode>
       A 27-bit unsigned integer, which serves as proof of possession during commissioning.

HELP OPTIONS

  -h, --help
       Print this output and then exit.

  -v, --version
       Print the version and then exit.
  1. Run ./chip-lighting-app with customized setup payload
./chip-lighting-app --version 1 --vendor-id 1234 --product-id 1234 --custom-flow 2 --capabilities 3 --discriminator 1234 --passcode 1234 

[1626884897.552607][453003:453003] CHIP:SVR: SetupQRCode: [MT:TA6K4-J-02MOJB00000]
[1626884897.552637][453003:453003] CHIP:SVR: Manual pairing code: [501234000001234012341]

@yufengwangca yufengwangca changed the title [TE4] Enable setup code options for linux example apps [linux] Enable setup code options for linux example apps Jul 21, 2021
src/app/server/OnboardingCodesUtil.cpp Outdated Show resolved Hide resolved
src/app/server/OnboardingCodesUtil.cpp Outdated Show resolved Hide resolved
@yufengwangca
Copy link
Contributor Author

src/app/server/OnboardingCodesUtil.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from 762a204

File Section File VM
chip-lock.elf text 4 4
chip-lock.elf device_handles -4 -4
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_info,0,3166
.debug_loc,0,2187
.debug_line,0,868
.debug_ranges,0,264
.debug_str,0,245
.debug_frame,0,128
.debug_abbrev,0,38
.debug_aranges,0,32

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
.debug_info,0,3167
.debug_loc,0,2199
.debug_line,0,871
.debug_ranges,0,264
.debug_str,0,245
.debug_frame,0,128
.debug_abbrev,0,38
.debug_aranges,0,32
text,4,4
device_handles,-4,-4


@github-actions
Copy link

Size increase report for "esp32-example-build" from 762a204

File Section File VM
chip-lock-app.elf .flash.text 64 64
chip-ipv6only-app.elf .flash.text 172 172
chip-temperature-measurement-app.elf .flash.text 60 60
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-lock-app.elf and ./pull_artifact/chip-lock-app.elf:

sections,vmsize,filesize
.debug_info,0,2998
.debug_loc,0,1946
.debug_line,0,1525
.debug_str,0,243
.debug_ranges,0,216
.debug_frame,0,72
.flash.text,64,64
.debug_aranges,0,24
[Unmapped],0,-64

Comparing ./master_artifact/chip-ipv6only-app.elf and ./pull_artifact/chip-ipv6only-app.elf:

sections,vmsize,filesize
.flash.text,172,172
[Unmapped],0,-172

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize
.flash.text,60,60
[Unmapped],0,-60

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_info,0,2993
.debug_loc,0,1951
.debug_line,0,1539
.debug_str,0,245
.debug_ranges,0,216
.debug_frame,0,72
.debug_aranges,0,24

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_info,0,1607
.debug_loc,0,1073
.debug_line,0,818
.debug_str,0,238
.debug_ranges,0,224
.debug_frame,0,116
.debug_aranges,0,24

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize


@yufengwangca
Copy link
Contributor Author

@bhaskar-apple ?

src/app/server/OnboardingCodesUtil.cpp Outdated Show resolved Hide resolved
src/app/server/OnboardingCodesUtil.cpp Outdated Show resolved Hide resolved
@bzbarsky-apple
Copy link
Contributor

@bhaskar-apple ?

Not active on Matter anymore.

@saurabhst saurabhst merged commit 71299e4 into project-chip:master Jul 28, 2021
@yufengwangca yufengwangca deleted the pr/lighting/qr branch July 28, 2021 22:43
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
…p#8547)

* [TE4] Enable setup code options in linux example apps

* Update src/app/server/OnboardingCodesUtil.cpp

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Update src/app/server/OnboardingCodesUtil.cpp

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Rename QRCode to qrCode

* Apply suggestions from code review

Co-authored-by: Justin Wood <woody@apple.com>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance Lighting example app to use user provided QRcode or setup code
6 participants