Skip to content

Commit b5951a3

Browse files
committed
Use provision storage manager singleton
1 parent 83dc1c8 commit b5951a3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/platform/silabs/multi-ota/OTAFactoryDataProcessor.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
namespace chip {
2424

25-
using FactoryProvider = DeviceLayer::Silabs::Provision::Storage;
25+
using namespace ::chip::DeviceLayer::Silabs;
2626

2727
CHIP_ERROR OTAFactoryDataProcessor::Init()
2828
{
@@ -146,21 +146,20 @@ CHIP_ERROR OTAFactoryDataProcessor::Update(uint8_t tag, Optional<ByteSpan> & opt
146146

147147
CHIP_ERROR OTAFactoryDataProcessor::UpdateValue(uint8_t tag, ByteSpan & newValue)
148148
{
149-
FactoryProvider factoryProvider;
150149
switch (tag)
151150
{
152151
case (int) FactoryTags::kDacKey:
153152
ChipLogProgress(SoftwareUpdate, "Set Device Attestation Key");
154-
return factoryProvider.FactoryProvider::SetDeviceAttestationKey(newValue);
153+
return Provision::Manager::GetInstance().GetStorage().SetDeviceAttestationKey(newValue);
155154
case (int) FactoryTags::kDacCert:
156155
ChipLogProgress(SoftwareUpdate, "Set Device Attestation Cert");
157-
return factoryProvider.FactoryProvider::SetDeviceAttestationCert(newValue);
156+
return Provision::Manager::GetInstance().GetStorage().SetDeviceAttestationCert(newValue);
158157
case (int) FactoryTags::kPaiCert:
159158
ChipLogProgress(SoftwareUpdate, "Set Product Attestionation Intermediate Cert");
160-
return factoryProvider.FactoryProvider::SetProductAttestationIntermediateCert(newValue);
159+
return Provision::Manager::GetInstance().GetStorage().SetProductAttestationIntermediateCert(newValue);
161160
case (int) FactoryTags::kCdCert:
162161
ChipLogProgress(SoftwareUpdate, "Set Certification Declaration");
163-
return factoryProvider.FactoryProvider::SetCertificationDeclaration(newValue);
162+
return Provision::Manager::GetInstance().GetStorage().SetCertificationDeclaration(newValue);
164163
}
165164

166165
ChipLogError(DeviceLayer, "Failed to find tag %d.", tag);

src/platform/silabs/multi-ota/OTAFactoryDataProcessor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include <lib/support/ScopedBuffer.h>
2323
#include <lib/support/Span.h>
2424
#include <platform/silabs/multi-ota/OTATlvProcessor.h>
25-
#include <provision/ProvisionStorage.h> // nogncheck
26-
#include <provision/ProvisionStorageGeneric.h> // nogncheck
25+
#include <ProvisionStorage.h>
26+
#include <ProvisionManager.h>
2727

2828
namespace chip {
2929

0 commit comments

Comments
 (0)