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

[Silabs] WiFi - fix for 917SoC commissionable data provider #26128

Merged
Show file tree
Hide file tree
Changes from all 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
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
jepenven-silabs marked this conversation as resolved.
Show resolved Hide resolved
#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