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

Device info provider efr32, some fixes for nrf and linux #18817

Merged
merged 5 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ efr32_executable("chef_app") {
deps = [
":chef-common",
":sdk",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]
Expand Down
7 changes: 7 additions & 0 deletions examples/chef/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "init_efrPlatform.h"
#include "sl_simple_button_instances.h"
#include "sl_system_kernel.h"
#include <DeviceInfoProviderImpl.h>
#include <app/server/Server.h>
#include <matter_config.h>

#define BLE_DEV_NAME "SiLabs-Chef-App"
Expand All @@ -33,6 +35,8 @@ using namespace ::chip::DeviceLayer;
#define UNUSED_PARAMETER(a) (a = a)

volatile int apperror_cnt;
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;

// ================================================================================
// Main Code
// ================================================================================
Expand All @@ -42,6 +46,9 @@ int main(void)
if (EFR32MatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);

gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

EFR32_LOG("Starting App Task");
if (GetAppTask().StartAppTask() != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);
Expand Down
1 change: 1 addition & 0 deletions examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ efr32_executable("light_switch_app") {
deps = [
":sdk",
"${chip_root}/examples/light-switch-app/light-switch-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]
Expand Down
7 changes: 7 additions & 0 deletions examples/light-switch-app/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "init_efrPlatform.h"
#include "sl_simple_button_instances.h"
#include "sl_system_kernel.h"
#include <DeviceInfoProviderImpl.h>
#include <app/server/Server.h>
#include <matter_config.h>

#define BLE_DEV_NAME "SiLabs-Light-Switch"
Expand All @@ -33,6 +35,8 @@ using namespace ::chip::DeviceLayer;
#define UNUSED_PARAMETER(a) (a = a)

volatile int apperror_cnt;
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;

// ================================================================================
// Main Code
// ================================================================================
Expand All @@ -42,6 +46,9 @@ int main(void)
if (EFR32MatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);

gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

EFR32_LOG("Starting App Task");
if (GetAppTask().StartAppTask() != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ efr32_executable("lighting_app") {
deps = [
":sdk",
"${chip_root}/examples/lighting-app/lighting-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]
Expand Down
6 changes: 6 additions & 0 deletions examples/lighting-app/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "init_efrPlatform.h"
#include "sl_simple_button_instances.h"
#include "sl_system_kernel.h"
#include <DeviceInfoProviderImpl.h>
#include <app/server/Server.h>
#include <matter_config.h>

#define BLE_DEV_NAME "SiLabs-Light"
Expand All @@ -33,6 +35,7 @@ using namespace ::chip::DeviceLayer;
#define UNUSED_PARAMETER(a) (a = a)

volatile int apperror_cnt;
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;

// ================================================================================
// Main Code
Expand All @@ -43,6 +46,9 @@ int main(void)
if (EFR32MatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);

gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

EFR32_LOG("Starting App Task");
if (GetAppTask().StartAppTask() != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ CHIP_ERROR AppTask::Init()

static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ efr32_executable("lock_app") {
deps = [
":sdk",
"${chip_root}/examples/lock-app/lock-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
Expand Down
6 changes: 6 additions & 0 deletions examples/lock-app/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "init_efrPlatform.h"
#include "sl_simple_button_instances.h"
#include "sl_system_kernel.h"
#include <DeviceInfoProviderImpl.h>
#include <app/server/Server.h>
#include <matter_config.h>

#define BLE_DEV_NAME "SiLabs-Door-Lock"
Expand All @@ -33,6 +35,7 @@ using namespace ::chip::DeviceLayer;
#define UNUSED_PARAMETER(a) (a = a)

volatile int apperror_cnt;
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;

// ================================================================================
// Main Code
Expand All @@ -43,6 +46,9 @@ int main(void)
if (EFR32MatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);

gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

EFR32_LOG("Starting App Task");
if (GetAppTask().StartAppTask() != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);
Expand Down
2 changes: 2 additions & 0 deletions examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ int ChipLinuxAppInit(int argc, char * const argv[], OptionSet * customOptions)
err = chip::examples::InitCommissionableDataProvider(gCommissionableDataProvider, LinuxDeviceOptions::GetInstance());
SuccessOrExit(err);
DeviceLayer::SetCommissionableDataProvider(&gCommissionableDataProvider);

gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

err = chip::examples::InitConfigurationManager(reinterpret_cast<ConfigurationManagerImpl &>(ConfigurationMgr()),
Expand Down
1 change: 1 addition & 0 deletions examples/window-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ efr32_executable("window_app") {

deps = [
":sdk",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/examples/window-app/common:window-common",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
Expand Down
6 changes: 6 additions & 0 deletions examples/window-app/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "init_efrPlatform.h"
#include "sl_simple_button_instances.h"
#include "sl_system_kernel.h"
#include <DeviceInfoProviderImpl.h>
#include <app/server/Server.h>
#include <matter_config.h>

#define BLE_DEV_NAME "Silabs-Window"
Expand All @@ -31,6 +33,7 @@ using namespace ::chip::DeviceLayer;
#define UNUSED_PARAMETER(a) (a = a)

volatile int apperror_cnt;
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;

// ================================================================================
// Main Code
Expand All @@ -43,6 +46,9 @@ int main(void)
if (EFR32MatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);

gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

WindowApp & app = WindowApp::Instance();

EFR32_LOG("Starting App");
Expand Down