File tree 3 files changed +15
-37
lines changed
app/clusters/software-diagnostics-server
3 files changed +15
-37
lines changed Original file line number Diff line number Diff line change @@ -158,12 +158,23 @@ bool emberAfSoftwareDiagnosticsClusterResetWatermarksCallback(app::CommandHandle
158
158
159
159
uint64_t currentHeapUsed;
160
160
CHIP_ERROR err = DeviceLayer::GetDiagnosticDataProvider ().GetCurrentHeapUsed (currentHeapUsed);
161
- VerifyOrExit (err == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE);
162
161
163
- err = DeviceLayer::GetDiagnosticDataProvider ().SetCurrentHeapHighWatermark (currentHeapUsed);
164
- VerifyOrExit (err == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE);
162
+ // Skip SetCurrentHeapHighWatermark if GetCurrentHeapUsed is not implemented
163
+ if (err != CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE && err != CHIP_ERROR_NOT_IMPLEMENTED)
164
+ {
165
+ if (err == CHIP_NO_ERROR)
166
+ {
167
+ if (CHIP_NO_ERROR != DeviceLayer::GetDiagnosticDataProvider ().SetCurrentHeapHighWatermark (currentHeapUsed))
168
+ {
169
+ status = EMBER_ZCL_STATUS_FAILURE;
170
+ }
171
+ }
172
+ else
173
+ {
174
+ status = EMBER_ZCL_STATUS_FAILURE;
175
+ }
176
+ }
165
177
166
- exit :
167
178
emberAfSendImmediateDefaultResponse (status);
168
179
169
180
return true ;
Original file line number Diff line number Diff line change @@ -68,32 +68,5 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetTotalOperationalHours(uint32_t & total
68
68
return CHIP_ERROR_INVALID_TIME;
69
69
}
70
70
71
- CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree (uint64_t & currentHeapFree)
72
- {
73
- // Overide with dummy value to pass CI
74
- currentHeapFree = 0 ;
75
- return CHIP_NO_ERROR;
76
- }
77
-
78
- CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed (uint64_t & currentHeapUsed)
79
- {
80
- // Overide with dummy value to pass CI
81
- currentHeapUsed = 0 ;
82
- return CHIP_NO_ERROR;
83
- }
84
-
85
- CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark (uint64_t & currentHeapHighWatermark)
86
- {
87
- // Overide with dummy value to pass CI
88
- currentHeapHighWatermark = 0 ;
89
- return CHIP_NO_ERROR;
90
- }
91
-
92
- CHIP_ERROR DiagnosticDataProviderImpl::SetCurrentHeapHighWatermark (uint64_t heapHighWatermark)
93
- {
94
- // Overide to pass CI
95
- return CHIP_NO_ERROR;
96
- }
97
-
98
71
} // namespace DeviceLayer
99
72
} // namespace chip
Original file line number Diff line number Diff line change @@ -38,12 +38,6 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
38
38
// ===== Methods that implement the PlatformManager abstract interface.
39
39
CHIP_ERROR GetUpTime (uint64_t & upTime) override ;
40
40
CHIP_ERROR GetTotalOperationalHours (uint32_t & totalOperationalHours) override ;
41
-
42
- // ===== Methods that implement the DiagnosticDataProvider abstract interface.
43
- CHIP_ERROR GetCurrentHeapFree (uint64_t & currentHeapFree) override ;
44
- CHIP_ERROR GetCurrentHeapUsed (uint64_t & currentHeapUsed) override ;
45
- CHIP_ERROR GetCurrentHeapHighWatermark (uint64_t & currentHeapHighWatermark) override ;
46
- CHIP_ERROR SetCurrentHeapHighWatermark (uint64_t heapHighWatermark) override ;
47
41
};
48
42
49
43
} // namespace DeviceLayer
You can’t perform that action at this time.
0 commit comments