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] Use provision storage manager singleton in OTA factory data processor #34822

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
11 changes: 5 additions & 6 deletions src/platform/silabs/multi-ota/OTAFactoryDataProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace chip {

using FactoryProvider = DeviceLayer::Silabs::Provision::Storage;
using namespace ::chip::DeviceLayer::Silabs;

CHIP_ERROR OTAFactoryDataProcessor::Init()
{
Expand Down Expand Up @@ -146,21 +146,20 @@ CHIP_ERROR OTAFactoryDataProcessor::Update(uint8_t tag, Optional<ByteSpan> & opt

CHIP_ERROR OTAFactoryDataProcessor::UpdateValue(uint8_t tag, ByteSpan & newValue)
{
FactoryProvider factoryProvider;
switch (tag)
{
case (int) FactoryTags::kDacKey:
ChipLogProgress(SoftwareUpdate, "Set Device Attestation Key");
return factoryProvider.FactoryProvider::SetDeviceAttestationKey(newValue);
return Provision::Manager::GetInstance().GetStorage().SetDeviceAttestationKey(newValue);
case (int) FactoryTags::kDacCert:
ChipLogProgress(SoftwareUpdate, "Set Device Attestation Cert");
return factoryProvider.FactoryProvider::SetDeviceAttestationCert(newValue);
return Provision::Manager::GetInstance().GetStorage().SetDeviceAttestationCert(newValue);
case (int) FactoryTags::kPaiCert:
ChipLogProgress(SoftwareUpdate, "Set Product Attestionation Intermediate Cert");
return factoryProvider.FactoryProvider::SetProductAttestationIntermediateCert(newValue);
return Provision::Manager::GetInstance().GetStorage().SetProductAttestationIntermediateCert(newValue);
case (int) FactoryTags::kCdCert:
ChipLogProgress(SoftwareUpdate, "Set Certification Declaration");
return factoryProvider.FactoryProvider::SetCertificationDeclaration(newValue);
return Provision::Manager::GetInstance().GetStorage().SetCertificationDeclaration(newValue);
}

ChipLogError(DeviceLayer, "Failed to find tag %d.", tag);
Expand Down
4 changes: 2 additions & 2 deletions src/platform/silabs/multi-ota/OTAFactoryDataProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

#pragma once

#include <ProvisionManager.h>
#include <ProvisionStorage.h>
#include <lib/core/Optional.h>
#include <lib/support/ScopedBuffer.h>
#include <lib/support/Span.h>
#include <platform/silabs/multi-ota/OTATlvProcessor.h>
#include <provision/ProvisionStorage.h> // nogncheck
#include <provision/ProvisionStorageGeneric.h> // nogncheck

namespace chip {

Expand Down
Loading