Skip to content

Commit c05da3f

Browse files
[Silabs] Use provision storage manager singleton in OTA factory data processor (#34822)
* Use provision storage manager singleton * Restyled by clang-format * rekick ci --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent e14ce48 commit c05da3f

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
@@ -18,12 +18,12 @@
1818

1919
#pragma once
2020

21+
#include <ProvisionManager.h>
22+
#include <ProvisionStorage.h>
2123
#include <lib/core/Optional.h>
2224
#include <lib/support/ScopedBuffer.h>
2325
#include <lib/support/Span.h>
2426
#include <platform/silabs/multi-ota/OTATlvProcessor.h>
25-
#include <provision/ProvisionStorage.h> // nogncheck
26-
#include <provision/ProvisionStorageGeneric.h> // nogncheck
2727

2828
namespace chip {
2929

0 commit comments

Comments
 (0)