From 5ffe3f9ccbc8e8fb23ee3f4cf709ed09e5aafadf Mon Sep 17 00:00:00 2001 From: michalbudzon-q <91474873+michalbudzon-q@users.noreply.github.com> Date: Tue, 4 Jan 2022 17:07:39 +0100 Subject: [PATCH] Replace Nvm_Init with KvsInit. Update qvCHIP API. (#12476) --- src/platform/qpg/qpgConfig.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/platform/qpg/qpgConfig.cpp b/src/platform/qpg/qpgConfig.cpp index 45f48e2d3a4ac3..0eec2eeecd4849 100644 --- a/src/platform/qpg/qpgConfig.cpp +++ b/src/platform/qpg/qpgConfig.cpp @@ -40,9 +40,18 @@ namespace Internal { CHIP_ERROR QPGConfig::Init() { - qvCHIP_KvsInit(); + const qvStatus_t status = qvCHIP_KvsInit(); - return CHIP_NO_ERROR; + if (QV_STATUS_NO_ERROR == status) + { + return CHIP_NO_ERROR; + } + else if (QV_STATUS_BUFFER_TOO_SMALL == status) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + + return CHIP_ERROR_INTERNAL; } CHIP_ERROR QPGConfig::ReadConfigValue(Key key, bool & val)