diff --git a/src/platform/Darwin/DiagnosticDataProviderImpl.cpp b/src/platform/Darwin/DiagnosticDataProviderImpl.cpp index 640a8eca27cd58..62a20a8efdb777 100644 --- a/src/platform/Darwin/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Darwin/DiagnosticDataProviderImpl.cpp @@ -89,6 +89,17 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() return CHIP_NO_ERROR; } +CHIP_ERROR DiagnosticDataProviderImpl::GetRebootCount(uint16_t & rebootCount) +{ + uint32_t count = 0; + + ReturnErrorOnFailure(ConfigurationMgr().GetRebootCount(count)); + VerifyOrReturnError(count <= UINT16_MAX, CHIP_ERROR_INVALID_INTEGER_VALUE); + rebootCount = static_cast(count); + + return CHIP_NO_ERROR; +} + DiagnosticDataProvider & GetDiagnosticDataProviderImpl() { return DiagnosticDataProviderImpl::GetDefaultInstance(); diff --git a/src/platform/Darwin/DiagnosticDataProviderImpl.h b/src/platform/Darwin/DiagnosticDataProviderImpl.h index 3cfc31bc1f9678..b97aa30ad27074 100644 --- a/src/platform/Darwin/DiagnosticDataProviderImpl.h +++ b/src/platform/Darwin/DiagnosticDataProviderImpl.h @@ -43,6 +43,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider // ===== Methods that implement the DiagnosticDataProvider abstract interface. bool SupportsWatermarks() override { return true; } CHIP_ERROR ResetWatermarks() override; + CHIP_ERROR GetRebootCount(uint16_t & rebootCount) override; }; /**