Skip to content

Commit

Permalink
Added using CD from config in case settings read failed
Browse files Browse the repository at this point in the history
  • Loading branch information
kkasperczyk-no committed Jul 12, 2022
1 parent d267b6f commit 3e29e90
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/platform/nrfconnect/FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ CHIP_ERROR FactoryDataProvider<FlashFactoryData>::GetCertificationDeclaration(Mu
#if CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE
size_t cdLen = 0;

ReturnErrorOnFailure(Internal::ZephyrConfig::ReadConfigValueStr(Internal::ZephyrConfig::kConfigKey_CertificationDeclaration,
reinterpret_cast<char *>(outBuffer.data()), outBuffer.size(),
cdLen));

outBuffer.reduce_size(cdLen);
if (Internal::ZephyrConfig::ReadConfigValueStr(Internal::ZephyrConfig::kConfigKey_CertificationDeclaration,
reinterpret_cast<char *>(outBuffer.data()), outBuffer.size(),
cdLen) == CHIP_NO_ERROR)
{
outBuffer.reduce_size(cdLen);
return CHIP_NO_ERROR;
}
#endif

return CHIP_NO_ERROR;
#else
constexpr uint8_t kCdForAllExamples[] = CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION;

return CopySpanToMutableSpan(ByteSpan{ kCdForAllExamples }, outBuffer);
#endif // CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE
}

template <class FlashFactoryData>
Expand Down

0 comments on commit 3e29e90

Please sign in to comment.