From 36ce66153eacc83b5bd209bc4c151a0e4ccd40fd Mon Sep 17 00:00:00 2001 From: Rohit Jadhav Date: Fri, 27 May 2022 11:05:42 +0530 Subject: [PATCH] Resolved conflict --- src/controller/AutoCommissioner.cpp | 1 + src/platform/ESP32/NetworkCommissioningDriver.cpp | 14 ++++---------- src/platform/ESP32/NetworkCommissioningDriver.h | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/controller/AutoCommissioner.cpp b/src/controller/AutoCommissioner.cpp index 4ddd081e46ed04..89bd3054221666 100644 --- a/src/controller/AutoCommissioner.cpp +++ b/src/controller/AutoCommissioner.cpp @@ -295,6 +295,7 @@ CHIP_ERROR AutoCommissioner::StartCommissioning(DeviceCommissioner * commissione Optional AutoCommissioner::GetCommandTimeout(DeviceProxy * device, CommissioningStage stage) const { +<<<<<<< HEAD // Network clusters can indicate the time required to connect, so if we are // connecting, use that time as our "how long it takes to process server // side" time. Otherwise pick a time that should be enough for the command diff --git a/src/platform/ESP32/NetworkCommissioningDriver.cpp b/src/platform/ESP32/NetworkCommissioningDriver.cpp index 7df6244650638a..2ab5e90bc88b7f 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.cpp +++ b/src/platform/ESP32/NetworkCommissioningDriver.cpp @@ -177,7 +177,7 @@ void ESPWiFiDriver::OnConnectWiFiNetwork() { if (mpConnectCallback) { - DeviceLayer::SystemLayer().CancelTimer(ConnectWifiNetworkTimeout, NULL); + DeviceLayer::SystemLayer().CancelTimer(OnConnectWiFiNetworkFailed, NULL); mpConnectCallback->OnResult(Status::kSuccess, CharSpan(), 0); mpConnectCallback = nullptr; } @@ -192,14 +192,9 @@ void ESPWiFiDriver::OnConnectWiFiNetworkFailed() } } -void ESPWiFiDriver::ConnectWifiNetworkTimeout(chip::System::Layer * aLayer, void * aAppState) +void ESPWiFiDriver::OnConnectWiFiNetworkFailed(chip::System::Layer * aLayer, void * aAppState) { - CHIP_ERROR error = chip::DeviceLayer::Internal::ESP32Utils::ClearWiFiStationProvision(); - if (error != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "ClearWiFiStationProvision failed: %s", chip::ErrorStr(error)); - } - NetworkCommissioning::ESPWiFiDriver::GetInstance().OnConnectWiFiNetworkFailed(); + ESPWiFiDriver::GetInstance().OnConnectWiFiNetworkFailed(); } void ESPWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) @@ -217,8 +212,7 @@ void ESPWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callbac reinterpret_cast(mStagingNetwork.credentials), mStagingNetwork.credentialsLen); err = DeviceLayer::SystemLayer().StartTimer( - static_cast((kWiFiConnectNetworkTimeoutSeconds - 1) * secToMiliSec), ConnectWifiNetworkTimeout, - NULL); + static_cast((kWiFiConnectNetworkTimeoutSeconds) *secToMiliSec), OnConnectWiFiNetworkFailed, NULL); mpConnectCallback = callback; exit: if (err != CHIP_NO_ERROR) diff --git a/src/platform/ESP32/NetworkCommissioningDriver.h b/src/platform/ESP32/NetworkCommissioningDriver.h index cf99755b17404a..fd3f1ddaa2ed64 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.h +++ b/src/platform/ESP32/NetworkCommissioningDriver.h @@ -109,8 +109,8 @@ class ESPWiFiDriver final : public WiFiDriver CHIP_ERROR ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen); void OnConnectWiFiNetwork(); - static void ConnectWifiNetworkTimeout(chip::System::Layer * aLayer, void * aAppState); void OnConnectWiFiNetworkFailed(); + static void OnConnectWiFiNetworkFailed(chip::System::Layer * aLayer, void * aAppState); void OnScanWiFiNetworkDone(); void OnNetworkStatusChange();