Commit 9d596a0 1 parent a2e7564 commit 9d596a0 Copy full SHA for 9d596a0
File tree 2 files changed +5
-27
lines changed
2 files changed +5
-27
lines changed Original file line number Diff line number Diff line change @@ -156,20 +156,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetUpTime(uint64_t & upTime)
156
156
157
157
CHIP_ERROR DiagnosticDataProviderImpl::GetTotalOperationalHours (uint32_t & totalOperationalHours)
158
158
{
159
- uint64_t upTime = 0 ;
160
-
161
- if (GetUpTime (upTime) == CHIP_NO_ERROR)
162
- {
163
- uint32_t totalHours = 0 ;
164
- if (ConfigurationMgr ().GetTotalOperationalHours (totalHours) == CHIP_NO_ERROR)
165
- {
166
- VerifyOrReturnError (upTime / 3600 <= UINT32_MAX, CHIP_ERROR_INVALID_INTEGER_VALUE);
167
- totalOperationalHours = totalHours + static_cast <uint32_t >(upTime / 3600 );
168
- return CHIP_NO_ERROR;
169
- }
170
- }
171
-
172
- return CHIP_ERROR_INVALID_TIME;
159
+ return ConfigurationMgr ().GetTotalOperationalHours (totalOperationalHours);
173
160
}
174
161
175
162
CHIP_ERROR DiagnosticDataProviderImpl::GetBootReason (BootReasonType & bootReason)
Original file line number Diff line number Diff line change @@ -90,24 +90,15 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack()
90
90
91
91
void PlatformManagerImpl::_Shutdown ()
92
92
{
93
- uint64_t upTime = 0 ;
93
+ uint32_t totalOperationalHours = 0 ;
94
94
95
- if (GetDiagnosticDataProvider ().GetUpTime (upTime ) == CHIP_NO_ERROR)
95
+ if (ConfigurationMgr ().GetTotalOperationalHours (totalOperationalHours ) == CHIP_NO_ERROR)
96
96
{
97
- uint32_t totalOperationalHours = 0 ;
98
-
99
- if (ConfigurationMgr ().GetTotalOperationalHours (totalOperationalHours) == CHIP_NO_ERROR)
100
- {
101
- ConfigurationMgr ().StoreTotalOperationalHours (totalOperationalHours + static_cast <uint32_t >(upTime / 3600 ));
102
- }
103
- else
104
- {
105
- ChipLogError (DeviceLayer, " Failed to get total operational hours of the Node" );
106
- }
97
+ ConfigurationMgr ().StoreTotalOperationalHours (totalOperationalHours);
107
98
}
108
99
else
109
100
{
110
- ChipLogError (DeviceLayer, " Failed to get current uptime since the Node’s last reboot " );
101
+ ChipLogError (DeviceLayer, " Failed to get total operational hours of the Node" );
111
102
}
112
103
113
104
Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::_Shutdown ();
You can’t perform that action at this time.
0 commit comments