From 8b88ffd415ea0274c92b4371c216ad7009066add Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 22 Nov 2021 08:50:05 -0800 Subject: [PATCH] Address review comments --- .../Zephyr/DiagnosticDataProviderImpl.cpp | 5 --- src/platform/Zephyr/PlatformManagerImpl.cpp | 1 + src/platform/nrfconnect/BUILD.gn | 4 +- .../nrfconnect/DiagnosticDataProviderImpl.cpp | 40 ------------------- .../nrfconnect/DiagnosticDataProviderImpl.h | 40 ------------------- src/platform/telink/BUILD.gn | 4 +- .../telink/DiagnosticDataProviderImpl.cpp | 40 ------------------- .../telink/DiagnosticDataProviderImpl.h | 40 ------------------- 8 files changed, 5 insertions(+), 169 deletions(-) delete mode 100644 src/platform/nrfconnect/DiagnosticDataProviderImpl.cpp delete mode 100644 src/platform/nrfconnect/DiagnosticDataProviderImpl.h delete mode 100644 src/platform/telink/DiagnosticDataProviderImpl.cpp delete mode 100644 src/platform/telink/DiagnosticDataProviderImpl.h diff --git a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp index 839369d33630b9..5b9809a1d9d525 100644 --- a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp @@ -21,17 +21,12 @@ * for Zephy platform. */ -#if !CONFIG_NORDIC_SECURITY_BACKEND -#include // nogncheck -#endif // !CONFIG_NORDIC_SECURITY_BACKEND - #include #include #include #include -#include #include namespace chip { diff --git a/src/platform/Zephyr/PlatformManagerImpl.cpp b/src/platform/Zephyr/PlatformManagerImpl.cpp index dab0812c135240..7bbe3f215380f6 100644 --- a/src/platform/Zephyr/PlatformManagerImpl.cpp +++ b/src/platform/Zephyr/PlatformManagerImpl.cpp @@ -73,6 +73,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 diff --git a/src/platform/nrfconnect/BUILD.gn b/src/platform/nrfconnect/BUILD.gn index de3d7de0afc6aa..d2296794185015 100644 --- a/src/platform/nrfconnect/BUILD.gn +++ b/src/platform/nrfconnect/BUILD.gn @@ -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", @@ -39,8 +41,6 @@ static_library("nrfconnect") { "ConnectivityManagerImpl.h", "DeviceNetworkProvisioningDelegateImpl.cpp", "DeviceNetworkProvisioningDelegateImpl.h", - "DiagnosticDataProviderImpl.cpp", - "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", "KeyValueStoreManagerImpl.h", "PlatformManagerImpl.h", diff --git a/src/platform/nrfconnect/DiagnosticDataProviderImpl.cpp b/src/platform/nrfconnect/DiagnosticDataProviderImpl.cpp deleted file mode 100644 index 4a629b128e3a92..00000000000000 --- a/src/platform/nrfconnect/DiagnosticDataProviderImpl.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation of the DiagnosticDataProvider object - * for mbed platform. - */ - -#include - -#include -#include -#include - -namespace chip { -namespace DeviceLayer { - -DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() -{ - static DiagnosticDataProviderImpl sInstance; - return sInstance; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/nrfconnect/DiagnosticDataProviderImpl.h b/src/platform/nrfconnect/DiagnosticDataProviderImpl.h deleted file mode 100644 index 731f445fec8671..00000000000000 --- a/src/platform/nrfconnect/DiagnosticDataProviderImpl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation of the DiagnosticDataProvider object. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -/** - * Concrete implementation of the PlatformManager singleton object for Linux platforms. - */ -class DiagnosticDataProviderImpl : public DiagnosticDataProvider -{ -public: - static DiagnosticDataProviderImpl & GetDefaultInstance(); -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/telink/BUILD.gn b/src/platform/telink/BUILD.gn index bf9ce7345b355d..b4c5c22962ac3e 100644 --- a/src/platform/telink/BUILD.gn +++ b/src/platform/telink/BUILD.gn @@ -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", @@ -39,8 +41,6 @@ static_library("telink") { "ConnectivityManagerImpl.h", "DeviceNetworkProvisioningDelegateImpl.cpp", "DeviceNetworkProvisioningDelegateImpl.h", - "DiagnosticDataProviderImpl.cpp", - "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", "KeyValueStoreManagerImpl.h", "PlatformManagerImpl.h", diff --git a/src/platform/telink/DiagnosticDataProviderImpl.cpp b/src/platform/telink/DiagnosticDataProviderImpl.cpp deleted file mode 100644 index 37a31a86f63951..00000000000000 --- a/src/platform/telink/DiagnosticDataProviderImpl.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation of the DiagnosticDataProvider object - * for telink platform. - */ - -#include - -#include -#include -#include - -namespace chip { -namespace DeviceLayer { - -DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() -{ - static DiagnosticDataProviderImpl sInstance; - return sInstance; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/telink/DiagnosticDataProviderImpl.h b/src/platform/telink/DiagnosticDataProviderImpl.h deleted file mode 100644 index 731f445fec8671..00000000000000 --- a/src/platform/telink/DiagnosticDataProviderImpl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation of the DiagnosticDataProvider object. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -/** - * Concrete implementation of the PlatformManager singleton object for Linux platforms. - */ -class DiagnosticDataProviderImpl : public DiagnosticDataProvider -{ -public: - static DiagnosticDataProviderImpl & GetDefaultInstance(); -}; - -} // namespace DeviceLayer -} // namespace chip