From 8f147378dce24d2c8b978afc34eaad8f1ffae08d Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 1 Nov 2022 15:20:18 -0700 Subject: [PATCH] Remove DeviceNetworkProvisioningDelegate interface --- .../DeviceNetworkProvisioningDelegate.h | 58 ---------------- src/lib/shell/commands/WiFi.cpp | 12 +--- src/platform/Ameba/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 43 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 34 ---------- src/platform/BUILD.gn | 1 - .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/EFR32/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 64 ----------------- .../DeviceNetworkProvisioningDelegateImpl.h | 37 ---------- src/platform/ESP32/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 59 ---------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/Infineon/CYW30739/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 39 ----------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/Infineon/PSOC6/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 57 ---------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/Linux/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 47 ------------- .../DeviceNetworkProvisioningDelegateImpl.h | 36 ---------- src/platform/Tizen/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 47 ------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/Zephyr/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 44 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/android/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 43 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/bouffalolab/BL602/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 48 ------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/bouffalolab/BL702/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 68 ------------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/cc13x2_26x2/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 44 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/cc32xx/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 44 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/mbed/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 55 --------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/mt793x/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 63 ----------------- .../DeviceNetworkProvisioningDelegateImpl.h | 37 ---------- src/platform/nrfconnect/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 44 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/nxp/k32w/k32w0/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 44 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/nxp/mw320/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 59 ---------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/qpg/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 44 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/telink/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 43 ------------ .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- src/platform/webos/BUILD.gn | 2 - .../DeviceNetworkProvisioningDelegateImpl.cpp | 47 ------------- .../DeviceNetworkProvisioningDelegateImpl.h | 33 --------- 67 files changed, 3 insertions(+), 1894 deletions(-) delete mode 100644 src/include/platform/internal/DeviceNetworkProvisioningDelegate.h delete mode 100644 src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/Darwin/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/android/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/android/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/telink/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/telink/DeviceNetworkProvisioningDelegateImpl.h delete mode 100644 src/platform/webos/DeviceNetworkProvisioningDelegateImpl.cpp delete mode 100644 src/platform/webos/DeviceNetworkProvisioningDelegateImpl.h diff --git a/src/include/platform/internal/DeviceNetworkProvisioningDelegate.h b/src/include/platform/internal/DeviceNetworkProvisioningDelegate.h deleted file mode 100644 index 1a70d2ff6b61d7..00000000000000 --- a/src/include/platform/internal/DeviceNetworkProvisioningDelegate.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * Copyright (c) 2020 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 - * This file defines the CHIP Device Network Provisioning object. - * - */ - -#pragma once - -#include -#include -#include - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -class DLL_EXPORT DeviceNetworkProvisioningDelegate -{ -public: - /** - * @brief - * Called to provision WiFi credentials in a device - * - * @param ssid WiFi SSID - * @param passwd WiFi password - */ - virtual CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) = 0; - - /** - * @brief - * Called to provision Thread credentials in a device - * - */ - virtual CHIP_ERROR ProvisionThread(ByteSpan threadData) = 0; - - virtual ~DeviceNetworkProvisioningDelegate() {} -}; - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip diff --git a/src/lib/shell/commands/WiFi.cpp b/src/lib/shell/commands/WiFi.cpp index c54cba75c221c2..9bd891f20430da 100644 --- a/src/lib/shell/commands/WiFi.cpp +++ b/src/lib/shell/commands/WiFi.cpp @@ -22,13 +22,6 @@ #include #include -// Include DeviceNetworkProvisioningDelegateImpl for WiFi provisioning. -// TODO: Enable wifi network should be done by ConnectivityManager. (Or other platform neutral interfaces) -#if defined(CHIP_DEVICE_LAYER_TARGET) -#define DEVICENETWORKPROVISIONING_HEADER -#include DEVICENETWORKPROVISIONING_HEADER -#endif - using chip::DeviceLayer::ConnectivityManager; using chip::DeviceLayer::ConnectivityMgr; @@ -115,8 +108,9 @@ static CHIP_ERROR WiFiConnectHandler(int argc, char ** argv) { return CHIP_ERROR_INVALID_ARGUMENT; } - DeviceLayer::DeviceNetworkProvisioningDelegateImpl deviceDelegate; - return deviceDelegate.ProvisionWiFi(argv[0], argv[1]); + + // TODO:Provision WiFi using WirelessDriver + return CHIP_ERROR_NOT_IMPLEMENTED; } static CHIP_ERROR WiFiDispatch(int argc, char ** argv) diff --git a/src/platform/Ameba/BUILD.gn b/src/platform/Ameba/BUILD.gn index 650b744f0d4ea1..e8ea5e3a6ef680 100755 --- a/src/platform/Ameba/BUILD.gn +++ b/src/platform/Ameba/BUILD.gn @@ -33,8 +33,6 @@ static_library("Ameba") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "FactoryDataProvider.cpp", diff --git a/src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 89fa92e9ff6367..00000000000000 --- a/src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * 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. - */ - -#include -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" -#include "NetworkCommissioningDriver.h" - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "AmebaNetworkProvisioningDelegate: SSID: %s", ssid); - err = NetworkCommissioning::AmebaWiFiDriver::GetInstance().ConnectWiFiNetwork(ssid, strlen(ssid), key, strlen(key)); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 2ae4e39e7a58cf..00000000000000 --- a/src/platform/Ameba/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 0ccde369725abc..44c6d26421a8d3 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -343,7 +343,6 @@ if (chip_device_platform != "none") { "../include/platform/internal/BLEManager.h", "../include/platform/internal/CHIPDeviceLayerInternal.h", "../include/platform/internal/DeviceNetworkInfo.h", - "../include/platform/internal/DeviceNetworkProvisioningDelegate.h", "../include/platform/internal/EventLogging.h", "../include/platform/internal/GenericConfigurationManagerImpl.h", "../include/platform/internal/GenericConfigurationManagerImpl.ipp", diff --git a/src/platform/Darwin/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/Darwin/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index adcdfb65dc7208..00000000000000 --- a/src/platform/Darwin/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 7e82963582d72e..239dcc5d1d5b4f 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -44,8 +44,6 @@ static_library("EFR32") { "ConfigurationManagerImpl.cpp", "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "EFR32Config.cpp", diff --git a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index b0c946429f9b6f..00000000000000 --- a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" -#include "NetworkCommissioningWiFiDriver.h" -#include -#include - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "EFR Wifi provision: SSID: %s", ssid); - err = NetworkCommissioning::SlWiFiDriver::GetInstance().ConnectWiFiNetwork(ssid, strlen(ssid), key, strlen(key)); - - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "ERR:WiFi:Provision network: %s", chip::ErrorStr(err)); - } - - return err; -} -#endif - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 16ec2e9283bb9f..00000000000000 --- a/src/platform/EFR32/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; -#else - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -#endif - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/ESP32/BUILD.gn b/src/platform/ESP32/BUILD.gn index d3f8026ec43859..d5f8b2d1590dea 100644 --- a/src/platform/ESP32/BUILD.gn +++ b/src/platform/ESP32/BUILD.gn @@ -41,8 +41,6 @@ static_library("ESP32") { "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", "ConnectivityManagerImpl_Ethernet.cpp", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "ESP32Config.cpp", diff --git a/src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 198a04f108d444..00000000000000 --- a/src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" -#include "NetworkCommissioningDriver.h" - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI - CHIP_ERROR err = CHIP_NO_ERROR; - ChipLogProgress(NetworkProvisioning, "ESP32NetworkProvisioningDelegate: SSID: %s", ssid); - err = NetworkCommissioning::ESPWiFiDriver::GetInstance().ConnectWiFiNetwork(ssid, strlen(ssid), key, strlen(key)); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - return err; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif -} - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - CHIP_ERROR err = CHIP_NO_ERROR; - - SuccessOrExit(err = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(err = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(err = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return err; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index c69309c92b9a99..00000000000000 --- a/src/platform/ESP32/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Infineon/CYW30739/BUILD.gn b/src/platform/Infineon/CYW30739/BUILD.gn index 623cd188bd8343..9feef2ba2880e4 100644 --- a/src/platform/Infineon/CYW30739/BUILD.gn +++ b/src/platform/Infineon/CYW30739/BUILD.gn @@ -37,8 +37,6 @@ static_library("CYW30739") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index aec09109d7af26..00000000000000 --- a/src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif /* CHIP_DEVICE_CONFIG_ENABLE_THREAD */ -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 9eb0cb979ebaf8..00000000000000 --- a/src/platform/Infineon/CYW30739/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Infineon/PSOC6/BUILD.gn b/src/platform/Infineon/PSOC6/BUILD.gn index d2ed65a9bdf1d4..614b0f849c7b5b 100644 --- a/src/platform/Infineon/PSOC6/BUILD.gn +++ b/src/platform/Infineon/PSOC6/BUILD.gn @@ -36,8 +36,6 @@ static_library("PSOC6") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index d7f36db4423c02..00000000000000 --- a/src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,57 +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. - */ - -#include -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" -#include - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * passwd) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "P6NetworkProvisioningDelegate: SSID: %s", ssid); - err = ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled); - SuccessOrExit(err); - - // Set the wifi configuration - wifi_config_t wifi_config; - Internal::P6Utils::populate_wifi_config_t(&wifi_config, WIFI_IF_STA, (const cy_wcm_ssid_t *) ssid, - (const cy_wcm_passphrase_t *) passwd, - (strlen(passwd)) ? CHIP_DEVICE_CONFIG_DEFAULT_STA_SECURITY : CY_WCM_SECURITY_OPEN); - - err = Internal::P6Utils::p6_wifi_set_config(WIFI_IF_STA, &wifi_config); - SuccessOrExit(err); - - err = ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Enabled); - SuccessOrExit(err); - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 1880572b69030f..00000000000000 --- a/src/platform/Infineon/PSOC6/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Linux/BUILD.gn b/src/platform/Linux/BUILD.gn index 2088bfb83daf00..b90ae87bbfab83 100644 --- a/src/platform/Linux/BUILD.gn +++ b/src/platform/Linux/BUILD.gn @@ -60,8 +60,6 @@ static_library("Linux") { "ConnectivityUtils.h", "DeviceInstanceInfoProviderImpl.cpp", "DeviceInstanceInfoProviderImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 693921e8235293..00000000000000 --- a/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "LinuxNetworkProvisioningDelegate: SSID: %s", ssid); - -#if CHIP_DEVICE_CONFIG_ENABLE_WPA - err = ConnectivityMgrImpl().ProvisionWiFiNetwork(ssid, key); -#else - err = CHIP_ERROR_NOT_IMPLEMENTED; -#endif - - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index fee3eebdf984ce..00000000000000 --- a/src/platform/Linux/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -/** - * Concrete implementation of the DeviceNetworkProvisioningDelegate for Linux platforms. - */ -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Tizen/BUILD.gn b/src/platform/Tizen/BUILD.gn index 37ce8507c7f6cc..e25ab001e591c7 100644 --- a/src/platform/Tizen/BUILD.gn +++ b/src/platform/Tizen/BUILD.gn @@ -47,8 +47,6 @@ static_library("Tizen") { "ConnectivityUtils.h", "DeviceInstanceInfoProviderImpl.cpp", "DeviceInstanceInfoProviderImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index a0a04c2dc8caac..00000000000000 --- a/src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,47 +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. - */ - -#include -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "TizenNetworkProvisioningDelegate: SSID: %s", ssid); - -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI - err = ConnectivityMgrImpl().ProvisionWiFiNetwork(ssid, key); -#else - err = CHIP_ERROR_NOT_IMPLEMENTED; -#endif - - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 1880572b69030f..00000000000000 --- a/src/platform/Tizen/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Zephyr/BUILD.gn b/src/platform/Zephyr/BUILD.gn index c4f2820b4da8df..61444b0fe43631 100644 --- a/src/platform/Zephyr/BUILD.gn +++ b/src/platform/Zephyr/BUILD.gn @@ -34,8 +34,6 @@ static_library("Zephyr") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 287550032082a8..00000000000000 --- a/src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright (c) 2022 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index adcdfb65dc7208..00000000000000 --- a/src/platform/Zephyr/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/android/BUILD.gn b/src/platform/android/BUILD.gn index be0da30f597b29..65fb67e76b5f2e 100644 --- a/src/platform/android/BUILD.gn +++ b/src/platform/android/BUILD.gn @@ -46,8 +46,6 @@ static_library("android") { "ConnectivityManagerImpl.h", "DeviceInstanceInfoProviderImpl.cpp", "DeviceInstanceInfoProviderImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "DnssdImpl.cpp", diff --git a/src/platform/android/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/android/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 99063904d843d3..00000000000000 --- a/src/platform/android/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Copyright (c) 2020-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. - */ - -#include -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "AndroidNetworkProvisioningDelegate: SSID: %s", ssid); - - err = ConnectivityMgrImpl().ProvisionWiFiNetwork(ssid, key); - - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/android/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/android/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index a5f581798c31fe..00000000000000 --- a/src/platform/android/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020-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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/bouffalolab/BL602/BUILD.gn b/src/platform/bouffalolab/BL602/BUILD.gn index d82cb53b1ab3b0..b8de255d60b8af 100644 --- a/src/platform/bouffalolab/BL602/BUILD.gn +++ b/src/platform/bouffalolab/BL602/BUILD.gn @@ -36,8 +36,6 @@ static_library("BL602") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 495c8cf65ba4ac..00000000000000 --- a/src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" -#include "NetworkCommissioningDriver.h" - -#include - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -using namespace ::chip::DeviceLayer::Internal; - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - // BL602Config::WriteWifiInfo(ssid, passwd); - - CHIP_ERROR err = CHIP_NO_ERROR; - ChipLogProgress(NetworkProvisioning, "BL602NetworkProvisioningDelegate: SSID: %s", ssid); - err = NetworkCommissioning::BLWiFiDriver::GetInstance().ConnectWiFiNetwork(ssid, strlen(ssid), key, strlen(key)); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 4439c841f31874..00000000000000 --- a/src/platform/bouffalolab/BL602/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/bouffalolab/BL702/BUILD.gn b/src/platform/bouffalolab/BL702/BUILD.gn index efd5564e963b43..310c721a699d8e 100644 --- a/src/platform/bouffalolab/BL702/BUILD.gn +++ b/src/platform/bouffalolab/BL702/BUILD.gn @@ -34,8 +34,6 @@ static_library("BL702") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index ba6c0fba20d1c7..00000000000000 --- a/src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include "virt_net_spi.h" -extern virt_net_t vnet_spi; - -#include -using namespace ::chip::DeviceLayer::Internal; -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * passwd) -{ -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI - CHIP_ERROR err = CHIP_NO_ERROR; - - BL702Config::WriteWiFiInfo(ssid, passwd); - - virt_net_connect_ap(vnet_spi, ssid, passwd); - - return err; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_WIFI -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 803f4c8aafd973..00000000000000 --- a/src/platform/bouffalolab/BL702/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/cc13x2_26x2/BUILD.gn b/src/platform/cc13x2_26x2/BUILD.gn index 22292330ce3108..85d3fde0466553 100644 --- a/src/platform/cc13x2_26x2/BUILD.gn +++ b/src/platform/cc13x2_26x2/BUILD.gn @@ -35,8 +35,6 @@ static_library("cc13x2_26x2") { "ConfigurationManagerImpl.cpp", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index d893a9170b16b6..00000000000000 --- a/src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 9eb0cb979ebaf8..00000000000000 --- a/src/platform/cc13x2_26x2/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/cc32xx/BUILD.gn b/src/platform/cc32xx/BUILD.gn index 5932becd949778..ab82558b3a82f9 100644 --- a/src/platform/cc32xx/BUILD.gn +++ b/src/platform/cc32xx/BUILD.gn @@ -29,8 +29,6 @@ static_library("cc32xx") { "ConfigurationManagerImpl.cpp", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index d893a9170b16b6..00000000000000 --- a/src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 9eb0cb979ebaf8..00000000000000 --- a/src/platform/cc32xx/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/mbed/BUILD.gn b/src/platform/mbed/BUILD.gn index 1e13e2cfd2fa00..452c1e8f3d7ccf 100644 --- a/src/platform/mbed/BUILD.gn +++ b/src/platform/mbed/BUILD.gn @@ -26,8 +26,6 @@ static_library("mbed") { "ConfigurationManagerImpl.cpp", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "KeyValueStoreManagerImpl.cpp", diff --git a/src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 5a3debf5059bd1..00000000000000 --- a/src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" -#include "NetworkCommissioningDriver.h" - -using namespace ::chip::DeviceLayer::NetworkCommissioning; - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI - MutableCharSpan emptyBufferForDebugText; - uint8_t outNetworkIndex; - auto err = WiFiDriverImpl::GetInstance().AddOrUpdateNetwork(ByteSpan(Uint8::from_const_char(ssid), strlen(ssid)), - ByteSpan(Uint8::from_const_char(key), strlen(key)), - emptyBufferForDebugText, outNetworkIndex); - if (err != Status::kSuccess) - { - ChipLogError(NetworkProvisioning, "Failed to add WiFi network: 0x%x", int(err)); - return CHIP_ERROR_INTERNAL; - } - NetworkCommissioning::WiFiDriverImpl::GetInstance().ConnectNetwork(ByteSpan(Uint8::from_const_char(ssid), strlen(ssid)), - nullptr); - return CHIP_NO_ERROR; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif -} - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index c69309c92b9a99..00000000000000 --- a/src/platform/mbed/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/mt793x/BUILD.gn b/src/platform/mt793x/BUILD.gn index 0715833c6c4cd6..1a79b36a9757df 100644 --- a/src/platform/mt793x/BUILD.gn +++ b/src/platform/mt793x/BUILD.gn @@ -34,8 +34,6 @@ static_library("mt793x") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "DnssdImpl.cpp", diff --git a/src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 48417c74eced76..00000000000000 --- a/src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" -#include "NetworkCommissioningWiFiDriver.h" -#include -#include - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "MT793x Wifi provision: SSID: %s", ssid); - err = NetworkCommissioning::GenioWiFiDriver::GetInstance().ConnectWiFiNetwork(ssid, strlen(ssid), key, strlen(key)); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "MT793x:WiFi:Provision network: %s", chip::ErrorStr(err)); - } - - return err; -} -#endif - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 16ec2e9283bb9f..00000000000000 --- a/src/platform/mt793x/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; -#else - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -#endif - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/nrfconnect/BUILD.gn b/src/platform/nrfconnect/BUILD.gn index 3af24f2a72d0b5..7d32f8102b2558 100644 --- a/src/platform/nrfconnect/BUILD.gn +++ b/src/platform/nrfconnect/BUILD.gn @@ -41,8 +41,6 @@ static_library("nrfconnect") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "InetPlatformConfig.h", "KeyValueStoreManagerImpl.h", "PlatformManagerImpl.h", diff --git a/src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index d893a9170b16b6..00000000000000 --- a/src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 9eb0cb979ebaf8..00000000000000 --- a/src/platform/nrfconnect/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/nxp/k32w/k32w0/BUILD.gn b/src/platform/nxp/k32w/k32w0/BUILD.gn index 35228093e77f0a..753e62917fd8b7 100644 --- a/src/platform/nxp/k32w/k32w0/BUILD.gn +++ b/src/platform/nxp/k32w/k32w0/BUILD.gn @@ -39,8 +39,6 @@ static_library("k32w0") { "ConnectivityManagerImpl.h", "DefaultTestEventTriggerDelegate.cpp", "DefaultTestEventTriggerDelegate.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "K32W0Config.cpp", diff --git a/src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 51add4ccb43963..00000000000000 --- a/src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,44 +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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 0fb033a5d1f8de..00000000000000 --- a/src/platform/nxp/k32w/k32w0/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; }; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/nxp/mw320/BUILD.gn b/src/platform/nxp/mw320/BUILD.gn index c47fc3ba8d43a8..dda195b94979ef 100644 --- a/src/platform/nxp/mw320/BUILD.gn +++ b/src/platform/nxp/mw320/BUILD.gn @@ -39,8 +39,6 @@ static_library("mw320") { "ConnectivityUtils.h", "DeviceInfoProviderImpl.cpp", "DeviceInfoProviderImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "KeyValueStoreManagerImpl.cpp", diff --git a/src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 0d7171246956ec..00000000000000 --- a/src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,59 +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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "NetworkProvisioningDelegate: SSID: %s", ssid); - - err = ConnectivityMgrImpl().ProvisionWiFiNetwork(ssid, key); - - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index c69309c92b9a99..00000000000000 --- a/src/platform/nxp/mw320/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/qpg/BUILD.gn b/src/platform/qpg/BUILD.gn index 3e786aacceafdb..c6ec711e70f4b3 100644 --- a/src/platform/qpg/BUILD.gn +++ b/src/platform/qpg/BUILD.gn @@ -36,8 +36,6 @@ static_library("qpg") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "FactoryDataProvider.cpp", diff --git a/src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index d893a9170b16b6..00000000000000 --- a/src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR -DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 9eb0cb979ebaf8..00000000000000 --- a/src/platform/qpg/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/telink/BUILD.gn b/src/platform/telink/BUILD.gn index d0b799c187b44b..d5644b09f5ceb0 100644 --- a/src/platform/telink/BUILD.gn +++ b/src/platform/telink/BUILD.gn @@ -40,8 +40,6 @@ static_library("telink") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "InetPlatformConfig.h", "KeyValueStoreManagerImpl.h", "PlatformManagerImpl.h", diff --git a/src/platform/telink/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/telink/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 72e25522953f64..00000000000000 --- a/src/platform/telink/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,43 +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. - */ - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#endif - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionThread(ByteSpan threadData) -{ -#if CHIP_ENABLE_OPENTHREAD - CHIP_ERROR error = CHIP_NO_ERROR; - - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(false)); - SuccessOrExit(error = ThreadStackMgr().SetThreadProvision(threadData)); - SuccessOrExit(error = ThreadStackMgr().SetThreadEnabled(true)); -exit: - return error; -#else - return CHIP_ERROR_NOT_IMPLEMENTED; -#endif // CHIP_ENABLE_OPENTHREAD -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/telink/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/telink/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 53d7e4d1c34441..00000000000000 --- a/src/platform/telink/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR ProvisionThread(ByteSpan threadData) override; -}; - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/webos/BUILD.gn b/src/platform/webos/BUILD.gn index 19fe96cf0857fd..7ab184f2442a84 100644 --- a/src/platform/webos/BUILD.gn +++ b/src/platform/webos/BUILD.gn @@ -80,8 +80,6 @@ static_library("webos") { "ConnectivityUtils.h", "DeviceInstanceInfoProviderImpl.cpp", "DeviceInstanceInfoProviderImpl.h", - "DeviceNetworkProvisioningDelegateImpl.cpp", - "DeviceNetworkProvisioningDelegateImpl.h", "DiagnosticDataProviderImpl.cpp", "DiagnosticDataProviderImpl.h", "InetPlatformConfig.h", diff --git a/src/platform/webos/DeviceNetworkProvisioningDelegateImpl.cpp b/src/platform/webos/DeviceNetworkProvisioningDelegateImpl.cpp deleted file mode 100644 index 693921e8235293..00000000000000 --- a/src/platform/webos/DeviceNetworkProvisioningDelegateImpl.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#include -#include - -#include "DeviceNetworkProvisioningDelegateImpl.h" - -namespace chip { -namespace DeviceLayer { - -CHIP_ERROR DeviceNetworkProvisioningDelegateImpl::ProvisionWiFi(const char * ssid, const char * key) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - ChipLogProgress(NetworkProvisioning, "LinuxNetworkProvisioningDelegate: SSID: %s", ssid); - -#if CHIP_DEVICE_CONFIG_ENABLE_WPA - err = ConnectivityMgrImpl().ProvisionWiFiNetwork(ssid, key); -#else - err = CHIP_ERROR_NOT_IMPLEMENTED; -#endif - - if (err != CHIP_NO_ERROR) - { - ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); - } - - return err; -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/webos/DeviceNetworkProvisioningDelegateImpl.h b/src/platform/webos/DeviceNetworkProvisioningDelegateImpl.h deleted file mode 100644 index 4439c841f31874..00000000000000 --- a/src/platform/webos/DeviceNetworkProvisioningDelegateImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2020 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. - */ - -#pragma once - -#include - -namespace chip { -namespace DeviceLayer { - -class DeviceNetworkProvisioningDelegateImpl final : public Internal::DeviceNetworkProvisioningDelegate -{ -public: - CHIP_ERROR ProvisionWiFi(const char * ssid, const char * passwd) override; - CHIP_ERROR ProvisionThread(ByteSpan threadData) override { return CHIP_ERROR_NOT_IMPLEMENTED; } -}; - -} // namespace DeviceLayer -} // namespace chip