Skip to content

Commit

Permalink
Add "reset watermark" handler
Browse files Browse the repository at this point in the history
Verify: pass TC-DGSW-2.3

Signed-off-by: Chin-Ran Lo <[email protected]>
  • Loading branch information
crlonxp committed Sep 29, 2022
1 parent 28b9d76 commit 4562906
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu
return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks()
{
// If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the
// value of the CurrentHeapUsed.

// On Linux, the write operation is non-op since we always rely on the mallinfo system
// function to get the current heap memory.

return CHIP_NO_ERROR;
}

CHIP_ERROR DiagnosticDataProviderImpl::GetRebootCount(uint16_t & rebootCount)
{
uint32_t count = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/platform/nxp/mw320/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider

// ===== Methods that implement the PlatformManager abstract interface.

bool SupportsWatermarks() override { return true; }
CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override;
CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override;
CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override;
CHIP_ERROR ResetWatermarks() override;

CHIP_ERROR GetRebootCount(uint16_t & rebootCount) override;
CHIP_ERROR GetUpTime(uint64_t & upTime) override;
Expand Down

0 comments on commit 4562906

Please sign in to comment.