Skip to content

Commit

Permalink
[Silabs] Fix a few issues preventing siwx917 platform builds. (#25557)
Browse files Browse the repository at this point in the history
* Fix a few issues preventing siwx917 builds. efr32 KeyValueStoreManagerImpl.cpp and MigrationManager implementation could and should be share for the siwx917 platform so move it and renable the class and namespace of the migration manager

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
2 people authored and pull[bot] committed Sep 2, 2023
1 parent 8d3a983 commit 1589328
Showing 8 changed files with 19 additions and 240 deletions.
11 changes: 0 additions & 11 deletions examples/lighting-app/silabs/SiWx917/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
@@ -69,17 +69,6 @@
*/
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
*
* A string identifying the software version running on the device.
* CHIP service currently expects the software version to be in the format
* {MAJOR_VERSION}.0d{MINOR_VERSION}
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA"
#endif

/**
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
*
1 change: 1 addition & 0 deletions examples/platform/silabs/SiWx917/SiWx917/rsi_if.c
Original file line number Diff line number Diff line change
@@ -422,6 +422,7 @@ static void wfx_rsi_save_ap_info()
static void wfx_rsi_do_join(void)
{
int32_t status;
rsi_security_mode_t connect_security_mode;

if (wfx_rsi.dev_state & (WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED))
{
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::Init(void)
err = SilabsConfig::Init();
SuccessOrExit(err);

EFR32::EFR32Migration::GetMigrationManager().applyMigrations();
Silabs::MigrationManager::GetMigrationInstance().applyMigrations();

memset(mKvsKeyMap, 0, sizeof(mKvsKeyMap));
size_t outLen;
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ using namespace ::chip::DeviceLayer::PersistedStorage;

namespace chip {
namespace DeviceLayer {
namespace EFR32 {
namespace Silabs {

namespace {
typedef void (*func_ptr)();
@@ -45,7 +45,7 @@ static migrationData_t migrationTable[] = {

} // namespace

void EFR32Migration::applyMigrations()
void MigrationManager::applyMigrations()
{
uint32_t lastMigationGroupDone = 0;
SilabsConfig::ReadConfigValue(SilabsConfig::kConfigKey_MigrationCounter, lastMigationGroupDone);
@@ -62,12 +62,12 @@ void EFR32Migration::applyMigrations()
SilabsConfig::WriteConfigValue(SilabsConfig::kConfigKey_MigrationCounter, completedMigrationGroup);
}

EFR32Migration & EFR32Migration::GetMigrationManager()
MigrationManager & MigrationManager::GetMigrationInstance()
{
static EFR32Migration sMigrationManager;
static MigrationManager sMigrationManager;
return sMigrationManager;
}

} // namespace EFR32
} // namespace Silabs
} // namespace DeviceLayer
} // namespace chip
Original file line number Diff line number Diff line change
@@ -20,25 +20,25 @@

namespace chip {
namespace DeviceLayer {
namespace EFR32 {
namespace Silabs {

class EFR32Migration
class MigrationManager
{
friend class KeyValueStoreManagerImpl;

public:
/**
* The EFR32 migration manager is implemented as a singleton
* The Silabs migration manager is implemented as a singleton
* User should get the object from this getter.
*/
static EFR32Migration & GetMigrationManager();
static MigrationManager & GetMigrationInstance();
static void applyMigrations();

private:
EFR32Migration(){};
~EFR32Migration(){};
MigrationManager(){};
~MigrationManager(){};
};

} // namespace EFR32
} // namespace Silabs
} // namespace DeviceLayer
} // namespace chip
4 changes: 3 additions & 1 deletion src/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
@@ -43,8 +43,11 @@ static_library("SiWx917") {
"${silabs_platform_dir}/DiagnosticDataProviderImpl.cpp",
"${silabs_platform_dir}/DiagnosticDataProviderImpl.h",
"${silabs_platform_dir}/InetPlatformConfig.h",
"${silabs_platform_dir}/KeyValueStoreManagerImpl.cpp",
"${silabs_platform_dir}/KeyValueStoreManagerImpl.h",
"${silabs_platform_dir}/Logging.cpp",
"${silabs_platform_dir}/MigrationManager.cpp",
"${silabs_platform_dir}/MigrationManager.h",
"${silabs_platform_dir}/PlatformManagerImpl.h",
"${silabs_platform_dir}/SilabsConfig.cpp",
"${silabs_platform_dir}/SilabsConfig.h",
@@ -53,7 +56,6 @@ static_library("SiWx917") {
"../../SingletonConfigurationManager.cpp",
"BLEManagerImpl.cpp",
"ConfigurationManagerImpl.cpp",
"KeyValueStoreManagerImpl.cpp",
"PlatformManagerImpl.cpp",
"bluetooth/rsi_ble_config.h",
"bluetooth/wfx_sl_ble_init.c",
213 changes: 0 additions & 213 deletions src/platform/silabs/SiWx917/KeyValueStoreManagerImpl.cpp

This file was deleted.

4 changes: 2 additions & 2 deletions src/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
@@ -57,17 +57,17 @@ static_library("efr32") {
"${silabs_platform_dir}/DiagnosticDataProviderImpl.cpp",
"${silabs_platform_dir}/DiagnosticDataProviderImpl.h",
"${silabs_platform_dir}/InetPlatformConfig.h",
"${silabs_platform_dir}/KeyValueStoreManagerImpl.cpp",
"${silabs_platform_dir}/KeyValueStoreManagerImpl.h",
"${silabs_platform_dir}/Logging.cpp",
"${silabs_platform_dir}/MigrationManager.cpp",
"${silabs_platform_dir}/PlatformManagerImpl.h",
"${silabs_platform_dir}/SilabsConfig.cpp",
"${silabs_platform_dir}/SilabsConfig.h",
"${silabs_platform_dir}/SystemPlatformConfig.h",
"../../FreeRTOS/SystemTimeSupport.cpp",
"../../SingletonConfigurationManager.cpp",
"ConfigurationManagerImpl.cpp",
"KeyValueStoreManagerImpl.cpp",
"MigrationManager.cpp",
"PlatformManagerImpl.cpp",
]

0 comments on commit 1589328

Please sign in to comment.