From 992f6f85d8e0e17ce9ef4af0674d16cad9a7e3e2 Mon Sep 17 00:00:00 2001 From: srningap Date: Mon, 17 Apr 2023 18:26:21 +0530 Subject: [PATCH 1/2] adds fix for 917SoC commissionable data provider --- examples/platform/silabs/SiWx917/BUILD.gn | 10 ++++++---- examples/platform/silabs/SilabsDeviceDataProvider.cpp | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn index 2d7b1ec9c8592e..ae115f49b9fb98 100644 --- a/examples/platform/silabs/SiWx917/BUILD.gn +++ b/examples/platform/silabs/SiWx917/BUILD.gn @@ -148,10 +148,6 @@ source_set("siwx917-attestation-credentials") { } source_set("silabs-factory-data-provider") { - if (siwx917_commissionable_data) { - defines = [ "SIWX917_USE_COMISSIONABLE_DATA=1" ] - } - sources = [ "${silabs_common_plat_dir}/SilabsDeviceDataProvider.cpp", "${silabs_common_plat_dir}/SilabsDeviceDataProvider.h", @@ -162,6 +158,8 @@ source_set("silabs-factory-data-provider") { "${chip_root}/src/platform:platform_base", "${chip_root}/src/setup_payload", ] + + public_configs = [ ":siwx917-common-config" ] } config("siwx917-common-config") { @@ -184,6 +182,10 @@ config("siwx917-common-config") { if (enable_heap_monitoring) { defines += [ "HEAP_MONITORING" ] } + + if (siwx917_commissionable_data) { + defines += [ "SIWX917_USE_COMISSIONABLE_DATA=1" ] + } } config("silabs-wifi-config") { diff --git a/examples/platform/silabs/SilabsDeviceDataProvider.cpp b/examples/platform/silabs/SilabsDeviceDataProvider.cpp index 4c87804c72c706..2722409cf94608 100644 --- a/examples/platform/silabs/SilabsDeviceDataProvider.cpp +++ b/examples/platform/silabs/SilabsDeviceDataProvider.cpp @@ -161,6 +161,7 @@ CHIP_ERROR SIWx917DeviceDataProvider::FlashFactoryData() return err; } } + return CHIP_NO_ERROR; } #endif From 3bf2f770eef6543b711e2cae0004e0f080b34518 Mon Sep 17 00:00:00 2001 From: srningap Date: Tue, 18 Apr 2023 16:57:41 +0530 Subject: [PATCH 2/2] resolved build errors for 917SoC commissionable data provider --- examples/platform/silabs/SilabsDeviceDataProvider.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/platform/silabs/SilabsDeviceDataProvider.cpp b/examples/platform/silabs/SilabsDeviceDataProvider.cpp index 2722409cf94608..585699785937bd 100644 --- a/examples/platform/silabs/SilabsDeviceDataProvider.cpp +++ b/examples/platform/silabs/SilabsDeviceDataProvider.cpp @@ -22,6 +22,13 @@ #include #include +#ifdef SIWX917_USE_COMISSIONABLE_DATA +#include "DeviceConfig.h" +#include "siwx917_utils.h" +#include +#include +#endif // SIWX917_USE_COMISSIONABLE_DATA + namespace chip { namespace DeviceLayer { namespace Silabs { @@ -31,7 +38,7 @@ using namespace chip::DeviceLayer::Internal; // TODO Remove once Commander supports (doesn't erase) NVM3 for 917 #ifdef SIWX917_USE_COMISSIONABLE_DATA -void SIWx917DeviceDataProvider::setupPayload(uint8_t * outBuf) +void SilabsDeviceDataProvider::setupPayload(uint8_t * outBuf) { SetupPayload payload; std::string result; @@ -64,7 +71,7 @@ void SIWx917DeviceDataProvider::setupPayload(uint8_t * outBuf) } // writing to the flash based on the value given in the DeviceConfig.h -CHIP_ERROR SIWx917DeviceDataProvider::FlashFactoryData() +CHIP_ERROR SilabsDeviceDataProvider::FlashFactoryData() { // flashing the value to the nvm3 section of the flash // TODO: remove this once it is removed SiWx917 have the nvm3 simiplicity commander support