From 54ada3b3c6c58da67dda2ecaea4b19b42ab5c257 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 29 三月 2023 17:51:47 +0800 Subject: [PATCH] 1.改用萤石动态库,解决openssl版本冲突问题 2.设备回调成功增加返回设备序列号 3.优化部分功能 --- EZSDK/EZSDK/EZ/UIViewControllers/EZAPWiFiConfigViewController.m | 62 +++++++++++++++++++++++++------ 1 files changed, 50 insertions(+), 12 deletions(-) diff --git a/EZSDK/EZSDK/EZ/UIViewControllers/EZAPWiFiConfigViewController.m b/EZSDK/EZSDK/EZ/UIViewControllers/EZAPWiFiConfigViewController.m index 0b9d955..37e9a63 100644 --- a/EZSDK/EZSDK/EZ/UIViewControllers/EZAPWiFiConfigViewController.m +++ b/EZSDK/EZSDK/EZ/UIViewControllers/EZAPWiFiConfigViewController.m @@ -9,7 +9,7 @@ #import "EZAPWiFiConfigViewController.h" #import "GlobalKit.h" #import <SystemConfiguration/CaptiveNetwork.h> -#import "EZHCNetDeviceSDK.h" +#import <EZOpenSDKFramework/EZHCNetDeviceSDK.h> #import "EZAPConfigResultViewController.h" #import "Toast+UIView.h" @@ -139,17 +139,55 @@ password:self.password deviceSerial:[GlobalKit shareKit].deviceSerialNo verifyCode:[GlobalKit shareKit].deviceVerifyCode - result:^(BOOL ret) { - if (ret) - { - [self configSuccess]; - } - else - { - [self configFailed]; - NSLog(@"config failed"); - } - }]; + deviceStatus:^(EZWifiConfigStatus status, NSString * _Nonnull deviceSerial) { +// EZStrong(self); + switch (status) { + case DEVICE_WIFI_SENT_SUCCESS:// 鍚戣澶囧彂閫乄iFi淇℃伅鎴愬姛 + // 绛夊緟璁惧閰嶇綉锛屽鏋渨ifi瀵嗙爜閿欒锛屾渶鍚庝細鍥炶皟DEVICE_PLATFORM_REGIST_FAILED + NSLog(@"鍚戣澶囧彂閫乄iFi淇℃伅鎴愬姛"); + [self configSuccess]; + +// [EZToast show:@"鍚戣澶囧彂閫乄iFi淇℃伅鎴愬姛"]; + break; + case DEVICE_WIFI_SENT_FAILED:// 鍚戣澶囧彂閫乄iFi淇℃伅澶辫触 + // 閰嶇綉澶辫触锛屽彲浠ラ噸璇� + NSLog(@"閰嶇綉澶辫触锛岃绋嶅悗閲嶈瘯"); +// [EZToast show:@"閰嶇綉澶辫触锛岃绋嶅悗閲嶈瘯"]; + break; + case DEVICE_PLATFORM_REGISTED:// 璁惧娉ㄥ唽骞冲彴鎴愬姛 + // TODO 灏嗚澶囨坊鍔犲埌鑷繁璐﹀彿涓� + NSLog(@"璁惧娉ㄥ唽骞冲彴鎴愬姛"); +// [EZToast show:@"璁惧娉ㄥ唽骞冲彴鎴愬姛"]; + +// [self stopAction]; +// self.addBtn.hidden = NO; + break; + case DEVICE_PLATFORM_REGIST_FAILED:// 璁惧娉ㄥ唽骞冲彴澶辫触 + // TODO 鍙互鑷寮�鍚柊涓�杞疆璇� + NSLog(@"璁惧娉ㄥ唽骞冲彴澶辫触"); +// [EZToast show:@"璁惧娉ㄥ唽骞冲彴澶辫触"]; + [self stopAction]; + + break; + default: + break; + } + }]; +// [EZOPENSDK startAPConfigWifiWithSsid:self.ssid +// password:self.password +// deviceSerial:[GlobalKit shareKit].deviceSerialNo +// verifyCode:[GlobalKit shareKit].deviceVerifyCode +// result:^(BOOL ret) { +// if (ret) +// { +// [self configSuccess]; +// } +// else +// { +// [self configFailed]; +// NSLog(@"config failed"); +// } +// }]; } - (void) stopConfigWifi -- Gitblit v1.8.0