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] Remove generic base class init from configuration manager #24346

Merged
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
19 changes: 18 additions & 1 deletion examples/platform/silabs/efr32/EFR32DeviceDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,24 @@ CHIP_ERROR EFR32DeviceDataProvider::GetManufacturingDate(uint16_t & year, uint8_
ChipLogError(DeviceLayer, "Invalid manufacturing date: %s", dateStr);
}
return err;
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR EFR32DeviceDataProvider::GetPartNumber(char * buf, size_t bufSize)
{
size_t partNumberLen = 0; // without counting null-terminator
return SILABSConfig::ReadConfigValueStr(SILABSConfig::kConfigKey_PartNumber, buf, bufSize, partNumberLen);
}

CHIP_ERROR EFR32DeviceDataProvider::GetProductURL(char * buf, size_t bufSize)
{
size_t productUrlLen = 0; // without counting null-terminator
return SILABSConfig::ReadConfigValueStr(SILABSConfig::kConfigKey_ProductURL, buf, bufSize, productUrlLen);
}

CHIP_ERROR EFR32DeviceDataProvider::GetProductLabel(char * buf, size_t bufSize)
{
size_t productLabelLen = 0; // without counting null-terminator
return SILABSConfig::ReadConfigValueStr(SILABSConfig::KConfigKey_ProductLabel, buf, bufSize, productLabelLen);
}

EFR32DeviceDataProvider & EFR32DeviceDataProvider::GetDeviceDataProvider()
Expand Down
3 changes: 3 additions & 0 deletions examples/platform/silabs/efr32/EFR32DeviceDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class EFR32DeviceDataProvider : public CommissionableDataProvider,
CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize) override;
CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day) override;
CHIP_ERROR GetHardwareVersion(uint16_t & hardwareVersion) override;
CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override;
CHIP_ERROR GetProductURL(char * buf, size_t bufSzie) override;
CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override;
};

} // namespace EFR32
Expand Down
11 changes: 1 addition & 10 deletions src/platform/silabs/EFR32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ ConfigurationManagerImpl & ConfigurationManagerImpl::GetDefaultInstance()

CHIP_ERROR ConfigurationManagerImpl::Init()
{
CHIP_ERROR err;

// Initialize the generic implementation base class.
err = Internal::GenericConfigurationManagerImpl<SILABSConfig>::Init();
SuccessOrExit(err);

// TODO: Initialize the global GroupKeyStore object here (#1626)

IncreaseBootCount();
Expand All @@ -63,10 +57,7 @@ CHIP_ERROR ConfigurationManagerImpl::Init()
rebootCause = RMU_ResetCauseGet();
RMU_ResetCauseClear();

err = CHIP_NO_ERROR;

exit:
return err;
return CHIP_NO_ERROR;
}

bool ConfigurationManagerImpl::CanFactoryReset()
Expand Down
3 changes: 3 additions & 0 deletions src/platform/silabs/SilabsConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ class SILABSConfig
static constexpr Key kConfigKey_VendorName = SILABSConfigKey(kMatterFactory_KeyBase, 0x0D);
static constexpr Key kConfigKey_ProductName = SILABSConfigKey(kMatterFactory_KeyBase, 0x0E);
static constexpr Key kConfigKey_HardwareVersionString = SILABSConfigKey(kMatterFactory_KeyBase, 0x0F);
static constexpr Key KConfigKey_ProductLabel = SILABSConfigKey(kMatterFactory_KeyBase, 0x10);
static constexpr Key kConfigKey_ProductURL = SILABSConfigKey(kMatterFactory_KeyBase, 0x11);
static constexpr Key kConfigKey_PartNumber = SILABSConfigKey(kMatterFactory_KeyBase, 0x12);
static constexpr Key kConfigKey_UniqueId = SILABSConfigKey(kMatterFactory_KeyBase, 0x1F);
// Matter Config Keys
static constexpr Key kConfigKey_ServiceConfig = SILABSConfigKey(kMatterConfig_KeyBase, 0x01);
Expand Down