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 <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jan 4, 2024
1 parent 0ef08de commit 3527169
Show file tree
Hide file tree
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
Expand Up @@ -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
*
Expand Down
1 change: 1 addition & 0 deletions examples/platform/silabs/SiWx917/SiWx917/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace ::chip::DeviceLayer::PersistedStorage;

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

namespace {
typedef void (*func_ptr)();
Expand All @@ -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);
Expand All @@ -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
Expand Up @@ -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
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
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
Expand Up @@ -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",
]

Expand Down

0 comments on commit 3527169

Please sign in to comment.