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

Update bridge app to init network commissioning #29612

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions examples/bridge-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ int main(int argc, char * argv[])

// Run CHIP

ChipLinuxAppInitNetworkCommissioning();
ApplicationInit();
registerAttributeAccessOverride(&gPowerAttrAccess);
chip::DeviceLayer::PlatformMgr().RunEventLoop();
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
6 changes: 3 additions & 3 deletions examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ void EnableWiFiNetworkCommissioning(EndpointId endpoint)
sWiFiNetworkCommissioningInstance.Value().Init();
#endif // CHIP_APP_MAIN_HAS_WIFI_DRIVER
}
} // anonymous namespace

void InitNetworkCommissioning()
void ChipLinuxAppInitNetworkCommissioning()
{
if (sSecondaryNetworkCommissioningEndpoint.HasValue())
{
Expand Down Expand Up @@ -232,7 +233,6 @@ void InitNetworkCommissioning()
#endif // CHIP_APP_MAIN_HAS_ETHERNET_DRIVER
}
}
} // anonymous namespace

#if defined(ENABLE_CHIP_SHELL)
using chip::Shell::Engine;
Expand Down Expand Up @@ -582,7 +582,7 @@ void ChipLinuxAppMainLoop(AppMainLoopImplementation * impl)
#endif // defined(ENABLE_CHIP_SHELL)
#endif // CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE

InitNetworkCommissioning();
ChipLinuxAppInitNetworkCommissioning();

ApplicationInit();

Expand Down
5 changes: 5 additions & 0 deletions examples/platform/linux/AppMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ class DefaultAppMainLoopImplementation : public AppMainLoopImplementation
*/
void ChipLinuxAppMainLoop(AppMainLoopImplementation * impl = nullptr);

// This function supports initializing the Network Commissioning cluster for the
// Linux app that does not call ChipLinuxAppMainLoop. This function should be
// called before calling the ApplicationInit function.
void ChipLinuxAppInitNetworkCommissioning();

#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE

using chip::Controller::DeviceCommissioner;
Expand Down
Loading