Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Nov 22, 2021
1 parent de5365e commit 1158afe
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 183 deletions.
2 changes: 1 addition & 1 deletion examples/common/pigweed/rpc_services/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Device : public generated::Device<Device>
virtual pw::Status GetDeviceState(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_DeviceState & response)
{
uint64_t time_since_boot_sec;
DeviceLayer::DiagnosticDataMgr().GetUpTime(time_since_boot_sec);
DeviceLayer::GetDiagnosticDataProvider().GetUpTime(time_since_boot_sec);
response.time_since_boot_millis = time_since_boot_sec * 1000;
size_t count = 0;
for (const FabricInfo & fabricInfo : Server::GetInstance().GetFabricTable())
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Tizen/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

#include <platform/internal/CHIPDeviceLayerInternal.h>

#include <platform/Linux/DiagnosticDataProviderImpl.h>
#include <platform/PlatformManager.h>
#include <platform/Tizen/DiagnosticDataProviderImpl.h>
#include <platform/internal/GenericPlatformManagerImpl_POSIX.cpp>

namespace chip {
Expand Down
7 changes: 1 addition & 6 deletions src/platform/Zephyr/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@
* for Zephy platform.
*/

#if !CONFIG_NORDIC_SECURITY_BACKEND
#include <crypto/CHIPCryptoPAL.h> // nogncheck
#endif // !CONFIG_NORDIC_SECURITY_BACKEND

#include <platform/internal/CHIPDeviceLayerInternal.h>

#include <lib/support/logging/CHIPLogging.h>
#include <platform/DiagnosticDataProvider.h>
#include <platform/Zephy/DiagnosticDataProviderImpl.h>
#include <platform/Zephyr/DiagnosticDataProviderImpl.h>

#include <drivers/entropy.h>
#include <malloc.h>

namespace chip {
Expand Down
11 changes: 0 additions & 11 deletions src/platform/Zephyr/DiagnosticDataProviderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider
CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override;
CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override;
CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override;
CHIP_ERROR GetThreadMetrics(ThreadMetrics ** threadMetricsOut) override;
void ReleaseThreadMetrics(ThreadMetrics * threadMetrics) override;

CHIP_ERROR GetRebootCount(uint16_t & rebootCount) override;
CHIP_ERROR GetUpTime(uint64_t & upTime) override;
CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override;
CHIP_ERROR GetBootReason(uint8_t & bootReason) override;

CHIP_ERROR GetActiveHardwareFaults(GeneralFaults<kMaxHardwareFaults> & hardwareFaults) override;
CHIP_ERROR GetActiveRadioFaults(GeneralFaults<kMaxRadioFaults> & radioFaults) override;
CHIP_ERROR GetActiveNetworkFaults(GeneralFaults<kMaxNetworkFaults> & networkFaults) override;
};

} // namespace DeviceLayer
Expand Down
2 changes: 2 additions & 0 deletions src/platform/Zephyr/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <lib/support/logging/CHIPLogging.h>
#include <platform/PlatformManager.h>
#include <platform/Zephyr/DiagnosticDataProviderImpl.h>
#include <platform/internal/GenericPlatformManagerImpl_Zephyr.cpp>

#include <drivers/entropy.h>
Expand Down Expand Up @@ -73,6 +74,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
err = Internal::ZephyrConfig::Init();
SuccessOrExit(err);
SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance());
SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());

#if !CONFIG_NORDIC_SECURITY_BACKEND
// Add entropy source based on Zephyr entropy driver
Expand Down
4 changes: 2 additions & 2 deletions src/platform/nrfconnect/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ static_library("nrfconnect") {
"../SingletonConfigurationManager.cpp",
"../Zephyr/BLEManagerImpl.cpp",
"../Zephyr/ConfigurationManagerImpl.cpp",
"../Zephyr/DiagnosticDataProviderImpl.cpp",
"../Zephyr/DiagnosticDataProviderImpl.h",
"../Zephyr/KeyValueStoreManagerImpl.cpp",
"../Zephyr/Logging.cpp",
"../Zephyr/PlatformManagerImpl.cpp",
Expand All @@ -39,8 +41,6 @@ static_library("nrfconnect") {
"ConnectivityManagerImpl.h",
"DeviceNetworkProvisioningDelegateImpl.cpp",
"DeviceNetworkProvisioningDelegateImpl.h",
"DiagnosticDataProviderImpl.cpp",
"DiagnosticDataProviderImpl.h",
"InetPlatformConfig.h",
"KeyValueStoreManagerImpl.h",
"PlatformManagerImpl.h",
Expand Down
40 changes: 0 additions & 40 deletions src/platform/nrfconnect/DiagnosticDataProviderImpl.cpp

This file was deleted.

40 changes: 0 additions & 40 deletions src/platform/nrfconnect/DiagnosticDataProviderImpl.h

This file was deleted.

4 changes: 2 additions & 2 deletions src/platform/telink/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ static_library("telink") {
"../SingletonConfigurationManager.cpp",
"../Zephyr/BLEManagerImpl.cpp",
"../Zephyr/ConfigurationManagerImpl.cpp",
"../Zephyr/DiagnosticDataProviderImpl.cpp",
"../Zephyr/DiagnosticDataProviderImpl.h",
"../Zephyr/KeyValueStoreManagerImpl.cpp",
"../Zephyr/Logging.cpp",
"../Zephyr/PlatformManagerImpl.cpp",
Expand All @@ -39,8 +41,6 @@ static_library("telink") {
"ConnectivityManagerImpl.h",
"DeviceNetworkProvisioningDelegateImpl.cpp",
"DeviceNetworkProvisioningDelegateImpl.h",
"DiagnosticDataProviderImpl.cpp",
"DiagnosticDataProviderImpl.h",
"InetPlatformConfig.h",
"KeyValueStoreManagerImpl.h",
"PlatformManagerImpl.h",
Expand Down
40 changes: 0 additions & 40 deletions src/platform/telink/DiagnosticDataProviderImpl.cpp

This file was deleted.

40 changes: 0 additions & 40 deletions src/platform/telink/DiagnosticDataProviderImpl.h

This file was deleted.

0 comments on commit 1158afe

Please sign in to comment.