diff --git a/src/platform/qpg/PlatformManagerImpl.cpp b/src/platform/qpg/PlatformManagerImpl.cpp index 1820914c306e58..4397237f528d13 100644 --- a/src/platform/qpg/PlatformManagerImpl.cpp +++ b/src/platform/qpg/PlatformManagerImpl.cpp @@ -53,5 +53,38 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) return err; } +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapFree(uint64_t & currentHeapFree) +{ + size_t freeHeapSize; + size_t usedHeapSize; + size_t highWatermarkHeapSize; + + qvCHIP_GetHeapStats(&freeHeapSize, &usedHeapSize, &highWatermarkHeapSize); + currentHeapFree = static_cast(freeHeapSize); + return CHIP_NO_ERROR; +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapUsed(uint64_t & currentHeapUsed) +{ + size_t freeHeapSize; + size_t usedHeapSize; + size_t highWatermarkHeapSize; + + qvCHIP_GetHeapStats(&freeHeapSize, &usedHeapSize, &highWatermarkHeapSize); + currentHeapUsed = static_cast(usedHeapSize); + return CHIP_NO_ERROR; +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) +{ + size_t freeHeapSize; + size_t usedHeapSize; + size_t highWatermarkHeapSize; + + qvCHIP_GetHeapStats(&freeHeapSize, &usedHeapSize, &highWatermarkHeapSize); + currentHeapHighWatermark = static_cast(highWatermarkHeapSize); + return CHIP_NO_ERROR; +} + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/qpg/PlatformManagerImpl.h b/src/platform/qpg/PlatformManagerImpl.h index ba8403486c4af7..968410f6bd1619 100644 --- a/src/platform/qpg/PlatformManagerImpl.h +++ b/src/platform/qpg/PlatformManagerImpl.h @@ -52,6 +52,9 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener // ===== Methods that implement the PlatformManager abstract interface. CHIP_ERROR _InitChipStack(void); + CHIP_ERROR _GetCurrentHeapFree(uint64_t & currentHeapFree); + CHIP_ERROR _GetCurrentHeapUsed(uint64_t & currentHeapUsed); + CHIP_ERROR _GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); // ===== Members for internal use by the following friends. diff --git a/src/platform/qpg/qpgConfig.cpp b/src/platform/qpg/qpgConfig.cpp index 7e6546d8e3aabe..bb5795e1ed2025 100644 --- a/src/platform/qpg/qpgConfig.cpp +++ b/src/platform/qpg/qpgConfig.cpp @@ -45,13 +45,6 @@ CHIP_ERROR QPGConfig::Init() return CHIP_NO_ERROR; } -uint16_t QPGConfig::GetSettingsMaxValueLength(Key key) -{ - uint16_t keyLen; - - return (qvCHIP_Nvm_GetMaxKeyLen(key, &keyLen) == QV_STATUS_NO_ERROR) ? keyLen : 0; -} - CHIP_ERROR QPGConfig::ReadConfigValue(Key key, bool & val) { uint16_t length; diff --git a/src/platform/qpg/qpgConfig.h b/src/platform/qpg/qpgConfig.h index 38cfb9116a098a..72f230e28c9f09 100644 --- a/src/platform/qpg/qpgConfig.h +++ b/src/platform/qpg/qpgConfig.h @@ -104,7 +104,6 @@ class QPGConfig static CHIP_ERROR Init(void); // Configuration methods used by the GenericConfigurationManagerImpl<> template. - static uint16_t GetSettingsMaxValueLength(uint16_t Key); static CHIP_ERROR ReadConfigValue(Key key, bool & val); static CHIP_ERROR ReadConfigValue(Key key, uint32_t & val); static CHIP_ERROR ReadConfigValue(Key key, uint64_t & val); diff --git a/third_party/qpg_sdk/repo b/third_party/qpg_sdk/repo index 197eba673348ac..ca8b067590d4d6 160000 --- a/third_party/qpg_sdk/repo +++ b/third_party/qpg_sdk/repo @@ -1 +1 @@ -Subproject commit 197eba673348ac410bdb155e3dd8bac322391e10 +Subproject commit ca8b067590d4d65280417b60dfe4d16dad9b2775