diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index d82fe0c4b205bd..38ede26eb71ecf 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -307,7 +307,9 @@ CHIP_ERROR InitCommissioner() factoryParams.fabricStorage = &gFabricStorage; // use a different listen port for the commissioner than the default used by chip-tool. - factoryParams.listenPort = LinuxDeviceOptions::GetInstance().securedCommissionerPort + 10; + factoryParams.listenPort = LinuxDeviceOptions::GetInstance().securedCommissionerPort + 10; + factoryParams.fabricIndependentStorage = &gServerStorage; + params.storageDelegate = &gServerStorage; params.deviceAddressUpdateDelegate = nullptr; params.operationalCredentialsDelegate = &gOpCredsIssuer; @@ -584,7 +586,7 @@ void ChipLinuxAppMainLoop() SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); #if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE - InitCommissioner(); + VerifyOrReturn(InitCommissioner() == CHIP_NO_ERROR); #if defined(ENABLE_CHIP_SHELL) Shell::RegisterControllerCommands(); #endif // defined(ENABLE_CHIP_SHELL) diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index e143ce44dc64a4..e5c7b2f6524aa1 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -121,6 +121,9 @@ OptionSet * allOptions[] = { &cmdLineOptions, &helpOptions, nullptr }; */ void PrepareForCommissioning(const Dnssd::DiscoveredNodeData * selectedCommissioner = nullptr) { + // DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init("/tmp/chip_tv_casting_kvs"); + DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(CHIP_CONFIG_KVS_PATH); + // Enter commissioning mode, open commissioning window Server::GetInstance().Init(); Server::GetInstance().GetFabricTable().DeleteAllFabrics();