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

Extend build flags for ip commissioning on linux[TE3] #7214

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ int ChipLinuxAppInit(int argc, char ** argv)
SuccessOrExit(err);

ConfigurationMgr().LogDeviceConfig();
#ifdef CONFIG_RENDEZVOUS_MODE
PrintOnboardingCodes(static_cast<chip::RendezvousInformationFlags>(CONFIG_RENDEZVOUS_MODE));
#else
PrintOnboardingCodes(chip::RendezvousInformationFlag::kBLE);
#endif

#if defined(PW_RPC_ENABLED)
chip::rpc::Init();
Expand Down
6 changes: 6 additions & 0 deletions examples/platform/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import("//build_overrides/chip.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/app/common_flags.gni")

config("app-main-config") {
include_dirs = [ "." ]
Expand All @@ -24,6 +25,7 @@ declare_args() {
}

source_set("app-main") {
defines = []
sources = [
"AppMain.cpp",
"AppMain.h",
Expand All @@ -36,6 +38,10 @@ source_set("app-main") {
if (chip_enable_pw_rpc) {
defines += [ "PW_RPC_ENABLED" ]
}
if (chip_ip_commissioning) {
# BLE and on-network. Code defaults to BLE if this is not set.
defines += [ "CONFIG_RENDEZVOUS_MODE=6" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not mandatory for commissioners to use this bitmask. In fact, since this bitmask is absent from numerical pairing code, it is merely a hint.

Overall, the commissioner examples should just "look everywhere they can" for devices to be commissioned. The onboarding payload does enable filtering down with additional knowledge to reduce possibility of discriminator collision.

Is there an issue tracking this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From discussion offline - the codes are not optional in the QR code. This flag doesn't control anything on-device. Right now, the commissioner example code (chip-device-ctrl) has a direct IP and a direct BLE connection, but also supports connecting from the QR code, which pulls the setup pin, discriminator and rendezvous flags. The QR code pairing example will only check the flags in the QR code, as these are mandatory. An implementation of a manual pairing in the example controller would include all, but has not been written yet.

}

public_deps = [
"${chip_root}/src/app/server",
Expand Down
9 changes: 9 additions & 0 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ static_library("app") {
assert(false, "Unknown IM critical section implementation.")
}

if (chip_ip_commissioning) {
defines = [
"CONFIG_USE_CLUSTERS_FOR_IP_COMMISSIONING=1",
"CONFIG_RENDEZVOUS_WAIT_FOR_COMMISSIONING_COMPLETE=1",
"CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY=1",
"CHIP_DEVICE_CONFIG_ENABLE_JUST_IN_TIME_PROVISIONING=1",
]
}

public_deps = [
"${chip_root}/src/lib/support",
"${chip_root}/src/messaging",
Expand Down
1 change: 1 addition & 0 deletions src/app/common_flags.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
declare_args() {
# Temporary flag for interaction model and echo protocols, set it to true to enable
chip_app_use_echo = false
chip_ip_commissioning = false
}