From 4ccc85ecdb02631d48b1599245f5f5441ab36ab3 Mon Sep 17 00:00:00 2001 From: Vikas Chandra Date: Fri, 17 Jul 2020 16:55:39 +0530 Subject: [PATCH 1/2] Checked device capabilities before Wi-Fi scan. --- ESPProvision.podspec | 2 +- ESPProvision/ESPDevice.swift | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ESPProvision.podspec b/ESPProvision.podspec index 7ea866f..62b192b 100644 --- a/ESPProvision.podspec +++ b/ESPProvision.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |spec| spec.name = "ESPProvision" - spec.version = "2.0.2" + spec.version = "2.0.4" spec.summary = "ESP-IDF provisioning in Swift" spec.description = "It provides mechanism to provide network credentials and/or custom data to an ESP32, ESP32-S2 or ESP8266 devices" spec.homepage = "https://github.com/espressif/esp-idf-provisioning-ios" diff --git a/ESPProvision/ESPDevice.swift b/ESPProvision/ESPDevice.swift index d6b4fcc..0f0eaa4 100644 --- a/ESPProvision/ESPDevice.swift +++ b/ESPProvision/ESPDevice.swift @@ -363,11 +363,15 @@ public class ESPDevice { } private func scanDeviceForWifiList(completionHandler: @escaping ([ESPWifiNetwork]?,ESPWiFiScanError?) -> Void) { - self.wifiListCompletionHandler = completionHandler - let scanWifiManager: ESPWiFiManager = ESPWiFiManager(session: self.session!) - scanWifiManager.delegate = self - wifiListCompletionHandler = completionHandler - scanWifiManager.startWifiScan() + if let capability = self.capabilities, capability.contains(ESPConstants.wifiScanCapability) { + self.wifiListCompletionHandler = completionHandler + let scanWifiManager: ESPWiFiManager = ESPWiFiManager(session: self.session!) + scanWifiManager.delegate = self + wifiListCompletionHandler = completionHandler + scanWifiManager.startWifiScan() + } else { + completionHandler(nil,.emptyResultCount) + } } /// Initialise session with `ESPDevice`. /// From 0e7e70a856d853b2b15f3f4090db1ea0e9c5183c Mon Sep 17 00:00:00 2001 From: Vikas Chandra Date: Fri, 17 Jul 2020 16:57:01 +0530 Subject: [PATCH 2/2] ESPProvision sample bundle name and version update. --- .../project.pbxproj | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Example/ESPProvisionSample/ESPProvisionSample.xcodeproj/project.pbxproj b/Example/ESPProvisionSample/ESPProvisionSample.xcodeproj/project.pbxproj index dce7db8..0d5dd9e 100644 --- a/Example/ESPProvisionSample/ESPProvisionSample.xcodeproj/project.pbxproj +++ b/Example/ESPProvisionSample/ESPProvisionSample.xcodeproj/project.pbxproj @@ -705,7 +705,7 @@ baseConfigurationReference = 6666AA3DAEAA14F81770F363 /* Pods-ESPProvisionSample.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; - APP_DISPLAY_NAME = "ESP PROV DEMO"; + APP_DISPLAY_NAME = "ESP Prov"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "ESPProvisionSample/ESP BLE PROV.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -723,7 +723,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.espressif.provsoftap; PRODUCT_NAME = "ESP PROV SAMPLE"; PROVISIONING_PROFILE_SPECIFIER = "ESP SoftAP Provisioning With Capability"; @@ -737,7 +737,7 @@ baseConfigurationReference = A600497E31230F4B3C5197C8 /* Pods-ESPProvisionSample.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; - APP_DISPLAY_NAME = "ESP PROV DEMO"; + APP_DISPLAY_NAME = "ESP Prov"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "ESPProvisionSample/ESP BLE PROV.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -755,7 +755,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.espressif.provsoftap; PRODUCT_NAME = "ESP PROV SAMPLE"; PROVISIONING_PROFILE_SPECIFIER = "ESP SoftAP Provisioning With Capability"; @@ -912,7 +912,7 @@ baseConfigurationReference = EC84FE067C3D5E9CDC5AEF05 /* Pods-ESPProvisionSample.ble.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; - APP_DISPLAY_NAME = "ESP PROV BLE"; + APP_DISPLAY_NAME = "ESP BLE Prov"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-BLE"; CODE_SIGN_ENTITLEMENTS = "ESPProvisionSample/ESP BLE PROV.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -930,7 +930,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.espressif.provble; PRODUCT_NAME = "ESP PROV SAMPLE"; PROVISIONING_PROFILE_SPECIFIER = "ESP BLE Provisioning App Development"; @@ -1043,11 +1043,11 @@ baseConfigurationReference = B36C550D24F7A5870D2A8184 /* Pods-ESPProvisionSample.softap.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; - APP_DISPLAY_NAME = "ESP PROV SOFTAP"; + APP_DISPLAY_NAME = "ESP SoftAP Prov"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-SoftAP"; CODE_SIGN_ENTITLEMENTS = "ESPProvisionSample/ESP BLE PROV.entitlements"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = QWXF6GB4AV; ESP_ALLOW_PREFIX_SEARCH = YES; @@ -1061,10 +1061,10 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.2; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.espressif.provsoftap; PRODUCT_NAME = "ESP PROV SAMPLE"; - PROVISIONING_PROFILE_SPECIFIER = "ESP SoftAP Provisioning With Capability"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; };