Skip to content

Commit

Permalink
[Silabs] WiFi - fix for 917SoC commissionable data provider (#26128)
Browse files Browse the repository at this point in the history
* adds fix for 917SoC commissionable data provider

* resolved build errors for 917SoC commissionable data provider
  • Loading branch information
silabs-srishylam authored and pull[bot] committed Aug 7, 2023
1 parent cf7ec60 commit 1542960
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 6 additions & 4 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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") {
Expand All @@ -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") {
Expand Down
12 changes: 10 additions & 2 deletions examples/platform/silabs/SilabsDeviceDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
#include <setup_payload/Base38Encode.h>
#include <setup_payload/SetupPayload.h>

#ifdef SIWX917_USE_COMISSIONABLE_DATA
#include "DeviceConfig.h"
#include "siwx917_utils.h"
#include <setup_payload/Base38Decode.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#endif // SIWX917_USE_COMISSIONABLE_DATA

namespace chip {
namespace DeviceLayer {
namespace Silabs {
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -161,6 +168,7 @@ CHIP_ERROR SIWx917DeviceDataProvider::FlashFactoryData()
return err;
}
}
return CHIP_NO_ERROR;
}
#endif

Expand Down

0 comments on commit 1542960

Please sign in to comment.