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

Add diag clusters #10279

Merged
merged 10 commits into from
Oct 7, 2021
33 changes: 33 additions & 0 deletions src/platform/qpg/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>(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<uint64_t>(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<uint64_t>(highWatermarkHeapSize);
return CHIP_NO_ERROR;
}

} // namespace DeviceLayer
} // namespace chip
3 changes: 3 additions & 0 deletions src/platform/qpg/PlatformManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 0 additions & 7 deletions src/platform/qpg/qpgConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/platform/qpg/qpgConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion third_party/qpg_sdk/repo
Submodule repo updated from 197eba to ca8b06