Skip to content

Commit 4562906

Browse files
committed
Add "reset watermark" handler
Verify: pass TC-DGSW-2.3 Signed-off-by: Chin-Ran Lo <chin-ran.lo@nxp.com>
1 parent 28b9d76 commit 4562906

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu
9393
return CHIP_NO_ERROR;
9494
}
9595

96+
CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks()
97+
{
98+
// If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the
99+
// value of the CurrentHeapUsed.
100+
101+
// On Linux, the write operation is non-op since we always rely on the mallinfo system
102+
// function to get the current heap memory.
103+
104+
return CHIP_NO_ERROR;
105+
}
106+
96107
CHIP_ERROR DiagnosticDataProviderImpl::GetRebootCount(uint16_t & rebootCount)
97108
{
98109
uint32_t count = 0;

src/platform/nxp/mw320/DiagnosticDataProviderImpl.h

+2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
3939

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

42+
bool SupportsWatermarks() override { return true; }
4243
CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override;
4344
CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override;
4445
CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override;
46+
CHIP_ERROR ResetWatermarks() override;
4547

4648
CHIP_ERROR GetRebootCount(uint16_t & rebootCount) override;
4749
CHIP_ERROR GetUpTime(uint64_t & upTime) override;

0 commit comments

Comments
 (0)