Skip to content

Commit

Permalink
[ESP32] Device Info Provider Implementation (project-chip#21752)
Browse files Browse the repository at this point in the history
* [ESP32] Device Info Provider Implementation

Changes in the factory partition generator script to include supported
calendar types, locales, and fixed labels

* Fix the order of setting deviceinfoprovider

* Introduced device info provider in esp32 apps

* Add example provider's path in CMakeLists.txt
  • Loading branch information
shubhamdp authored and isiu-apple committed Sep 16, 2022
1 parent 36fcbf6 commit 90b6b97
Show file tree
Hide file tree
Showing 24 changed files with 699 additions and 21 deletions.
4 changes: 4 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ if (CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER)
chip_gn_arg_append("chip_use_factory_data_provider" "true")
endif()

if (CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER)
chip_gn_arg_append("chip_use_device_info_provider" "true")
endif()

set(args_gn_input "${CMAKE_CURRENT_BINARY_DIR}/args.gn.in")
file(GENERATE OUTPUT "${args_gn_input}" CONTENT "${chip_gn_args}")

Expand Down
9 changes: 9 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,15 @@ menu "CHIP Device Layer"
Hardware Version, Hardware Version String, and Rotating Device Id UniqueId will be read from factory
partition.

config ENABLE_ESP32_DEVICE_INFO_PROVIDER
depends on ENABLE_ESP32_FACTORY_DATA_PROVIDER
bool "Use ESP32 Device Info Provider"
default n
help
Use ESP32 Device Info Provider to get device instance info from factory partition.
Details like Supported calendar types, supported locales, and fixed labels will be read from factory
partition.

endmenu


Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-app"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
)
set(SRC_DIRS_LIST
"${CMAKE_CURRENT_LIST_DIR}"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-app/zap-generated"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
Expand Down
15 changes: 12 additions & 3 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "nvs_flash.h"
#include "platform/PlatformManager.h"
#include "shell_extension/launch.h"
#include <DeviceInfoProviderImpl.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/af.h>
#include <binding-handler.h>
Expand All @@ -59,6 +58,12 @@
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
#include <platform/ESP32/ESP32DeviceInfoProvider.h>
#else
#include <DeviceInfoProviderImpl.h>
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

using namespace ::chip;
using namespace ::chip::Shell;
using namespace ::chip::DeviceManager;
Expand Down Expand Up @@ -94,7 +99,11 @@ constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;
DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

DeviceLayer::DeviceInfoProviderImpl sExampleDeviceInfoProvider;
#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
DeviceLayer::ESP32DeviceInfoProvider gExampleDeviceInfoProvider;
#else
DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

} // namespace

Expand Down Expand Up @@ -139,7 +148,7 @@ extern "C" void app_main()
ThreadStackMgr().InitThreadStack();
#endif

DeviceLayer::SetDeviceInfoProvider(&sExampleDeviceInfoProvider);
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();
CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks);
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-minimal-app"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
)
set(SRC_DIRS_LIST
Expand All @@ -32,6 +33,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting"
Expand Down
16 changes: 15 additions & 1 deletion examples/all-clusters-minimal-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
#include <platform/ESP32/ESP32DeviceInfoProvider.h>
#else
#include <DeviceInfoProviderImpl.h>
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

using namespace ::chip;
using namespace ::chip::Shell;
using namespace ::chip::Credentials;
Expand Down Expand Up @@ -91,9 +97,15 @@ AppCallbacks sCallbacks;
constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

#if CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER
chip::DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
DeviceLayer::ESP32DeviceInfoProvider gExampleDeviceInfoProvider;
#else
DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

} // namespace

static void InitServer(intptr_t context)
Expand Down Expand Up @@ -137,6 +149,8 @@ extern "C" void app_main()
ThreadStackMgr().InitThreadStack();
#endif

DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();
CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks);
DeviceCallbacksDelegate::Instance().SetAppDelegate(&sAppDeviceCallbacksDelegate);
Expand Down
2 changes: 2 additions & 0 deletions examples/bridge-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/bridge-app"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
SRC_DIRS
"${CMAKE_CURRENT_LIST_DIR}"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/bridge-app/zap-generated"
Expand Down Expand Up @@ -50,6 +51,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
PRIV_REQUIRES chip QRCode bt)

set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14)
Expand Down
14 changes: 14 additions & 0 deletions examples/bridge-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,22 @@
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
#include <platform/ESP32/ESP32DeviceInfoProvider.h>
#else
#include <DeviceInfoProviderImpl.h>
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

namespace {
#if CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER
chip::DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
chip::DeviceLayer::ESP32DeviceInfoProvider gExampleDeviceInfoProvider;
#else
chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
} // namespace

const char * TAG = "bridge-app";
Expand Down Expand Up @@ -410,6 +422,8 @@ extern "C" void app_main()
gLight3.SetChangeCallback(&HandleDeviceStatusChanged);
gLight4.SetChangeCallback(&HandleDeviceStatusChanged);

DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

chip_err = deviceMgr.Init(&AppCallback);
Expand Down
4 changes: 2 additions & 2 deletions examples/light-switch-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/light-switch-app"
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
SRC_DIRS
"${CMAKE_CURRENT_LIST_DIR}"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/light-switch-app/zap-generated"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
Expand Down
15 changes: 12 additions & 3 deletions examples/light-switch-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "nvs_flash.h"
#include "shell_extension/launch.h"

#include <DeviceInfoProviderImpl.h>
#include <app/server/OnboardingCodesUtil.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
Expand All @@ -39,6 +38,12 @@
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
#include <platform/ESP32/ESP32DeviceInfoProvider.h>
#else
#include <DeviceInfoProviderImpl.h>
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

using namespace ::chip;
using namespace ::chip::Credentials;
using namespace ::chip::DeviceManager;
Expand All @@ -48,7 +53,11 @@ namespace {
DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

DeviceLayer::DeviceInfoProviderImpl sExampleDeviceInfoProvider;
#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
DeviceLayer::ESP32DeviceInfoProvider gExampleDeviceInfoProvider;
#else
DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
} // namespace

static const char * TAG = "light-switch-app";
Expand Down Expand Up @@ -83,7 +92,7 @@ extern "C" void app_main()
chip::LaunchShell();
#endif // CONFIG_ENABLE_CHIP_SHELL

DeviceLayer::SetDeviceInfoProvider(&sExampleDeviceInfoProvider);
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();
CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks);
Expand Down
15 changes: 12 additions & 3 deletions examples/lighting-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "freertos/task.h"
#include "nvs_flash.h"
#include "shell_extension/launch.h"
#include <DeviceInfoProviderImpl.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
#include <credentials/DeviceAttestationCredsProvider.h>
Expand All @@ -38,6 +37,12 @@
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
#include <platform/ESP32/ESP32DeviceInfoProvider.h>
#else
#include <DeviceInfoProviderImpl.h>
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

using namespace ::chip;
using namespace ::chip::Credentials;
using namespace ::chip::DeviceManager;
Expand All @@ -52,7 +57,11 @@ namespace {
DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

DeviceLayer::DeviceInfoProviderImpl sExampleDeviceInfoProvider;
#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
DeviceLayer::ESP32DeviceInfoProvider gExampleDeviceInfoProvider;
#else
DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
} // namespace

static void InitServer(intptr_t context)
Expand Down Expand Up @@ -81,7 +90,7 @@ extern "C" void app_main()
chip::LaunchShell();
#endif

DeviceLayer::SetDeviceInfoProvider(&sExampleDeviceInfoProvider);
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();
CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks);
Expand Down
15 changes: 12 additions & 3 deletions examples/lock-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "freertos/task.h"
#include "nvs_flash.h"
#include "shell_extension/launch.h"
#include <DeviceInfoProviderImpl.h>
#include <common/CHIPDeviceManager.h>
#include <common/Esp32AppServer.h>
#include <credentials/DeviceAttestationCredsProvider.h>
Expand All @@ -49,6 +48,12 @@
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
#include <platform/ESP32/ESP32DeviceInfoProvider.h>
#else
#include <DeviceInfoProviderImpl.h>
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

using namespace ::chip;
using namespace ::chip::DeviceManager;
using namespace ::chip::Credentials;
Expand All @@ -58,7 +63,11 @@ namespace {
DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

DeviceLayer::DeviceInfoProviderImpl sExampleDeviceInfoProvider;
#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
DeviceLayer::ESP32DeviceInfoProvider gExampleDeviceInfoProvider;
#else
DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
} // namespace

static const char * TAG = "lock-app";
Expand Down Expand Up @@ -99,7 +108,7 @@ extern "C" void app_main()
chip::LaunchShell();
#endif

DeviceLayer::SetDeviceInfoProvider(&sExampleDeviceInfoProvider);
DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();
CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks);
Expand Down
2 changes: 2 additions & 0 deletions examples/ota-provider-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-provider-app/"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
SRC_DIRS
"${CMAKE_CURRENT_LIST_DIR}"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-provider-app/zap-generated"
Expand Down Expand Up @@ -53,6 +54,7 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
EXCLUDE_SRCS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp"
PRIV_REQUIRES chip QRCode bt console spiffs)
Expand Down
15 changes: 14 additions & 1 deletion examples/ota-provider-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
#include <platform/ESP32/ESP32FactoryDataProvider.h>
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
#include <platform/ESP32/ESP32DeviceInfoProvider.h>
#else
#include <DeviceInfoProviderImpl.h>
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER

using chip::Callback::Callback;
using namespace chip;
using namespace chip::Shell;
Expand Down Expand Up @@ -138,9 +144,14 @@ static void InitServer(intptr_t context)
}

#if CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER
chip::DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
DeviceLayer::ESP32FactoryDataProvider sFactoryDataProvider;
#endif // CONFIG_ENABLE_ESP32_FACTORY_DATA_PROVIDER

#if CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
DeviceLayer::ESP32DeviceInfoProvider gExampleDeviceInfoProvider;
#else
DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
#endif // CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER
} // namespace

CHIP_ERROR OnBlockQuery(void * context, chip::System::PacketBufferHandle & blockBuf, size_t & size, bool & isEof, uint32_t offset)
Expand Down Expand Up @@ -231,6 +242,8 @@ extern "C" void app_main()
return;
}

DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks);
Expand Down
Loading

0 comments on commit 90b6b97

Please sign in to comment.