构建版本V9.9.8提交
This commit is contained in:
+20
-24
@@ -387,8 +387,15 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
|
||||
//智能联机
|
||||
-(void)smartLinkConnect{
|
||||
WEAK_SELF;
|
||||
[[GWP2PDeviceLinker shareInstance] p2pStopSmartLink];
|
||||
|
||||
[[GWP2PDeviceLinker shareInstance] p2pStopSmartLink];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(90 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
//
|
||||
if (!self.isDeviceLinkIn) {//90秒之后还未连接上,连接超时
|
||||
[[GWP2PDeviceLinker shareInstance] p2pStopSmartLink];
|
||||
[self connectNormalView];
|
||||
[self.view makeToast:@"WiFi连接失败"];
|
||||
}
|
||||
});
|
||||
[[GWP2PDeviceLinker shareInstance] p2pSmartLinkDeviceWithWiFiSSID:weakSelf.wifiName password:weakSelf.wifiPwd useSimpleConfig:YES deviceLinkIn:^(NSDictionary *deviceDict) {
|
||||
NSLog(@"声波配网成功,返回数据:%@",deviceDict);
|
||||
if (weakSelf.isDeviceLinkIn) {
|
||||
@@ -399,30 +406,20 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
|
||||
//如果智能联机,设备配网成功,就断开发送智能联机
|
||||
[[GWP2PDeviceLinker shareInstance] p2pStopSmartLink];
|
||||
NSString *deviceID = [deviceDict[@"deviceID"] stringValue];
|
||||
// NSString *deviceIP = deviceDict[@"deviceIP"];
|
||||
NSString *deviceIP = deviceDict[@"deviceIP"];
|
||||
// NSString *devicePassword = deviceDict[@"devicePassword"];
|
||||
weakSelf.deviceID = deviceID;
|
||||
[self resetPassWord];//初始化密码
|
||||
[weakSelf bindCameraDevice];
|
||||
//如果重置之后,则重新设置密码
|
||||
// if (IsEmptyStr(devicePassword)) { //设备没有初始化密码,设置密码
|
||||
// [[GWP2PClient sharedClient] setDeviceInitialPassword:GIWEI_INITPASS withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
// NSLog(@"success:%i %@",success,dataDictionary);
|
||||
// [weakSelf resetPassWord];//初始化密码
|
||||
// [weakSelf bindCameraDevice];
|
||||
// if (success) {
|
||||
// [weakSelf initPwdResault:dataDictionary];
|
||||
// }else{
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// //只为做 dissPogress处理并非成功
|
||||
// weakSelf.lodviewMissStyle =lodingViewdissMissSuccsess;
|
||||
// [weakSelf connectNormalView];
|
||||
// _canDissMissController = YES;
|
||||
// [weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)];
|
||||
// });
|
||||
// }
|
||||
// }];
|
||||
// }else{
|
||||
if (![deviceDict[@"isInitPassword"] boolValue]){ //设备没有初始化密码,设置密码
|
||||
[[GWP2PClient sharedClient] setDeviceInitialPassword:self.lastSetPassword withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
NSLog(@"success:%i %@",success,dataDictionary);
|
||||
[weakSelf resetPassWord];//初始化密码
|
||||
[weakSelf bindCameraDevice];
|
||||
}];
|
||||
}else{//如果已经设置过初始密码,则直接使用
|
||||
[weakSelf bindCameraDevice];
|
||||
}
|
||||
// else{
|
||||
// [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:@"123" completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
|
||||
// NSLog(@"success:%i %@",success,dataDictionary);
|
||||
// [weakSelf resetPassWord];//更新密码
|
||||
@@ -718,7 +715,6 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
|
||||
}
|
||||
//绑定成功之后,重新获取用户信息
|
||||
-(void)setWindowRootWith:(IfishCameraModel *)cameraMdel{
|
||||
[[GWP2PClient sharedClient] disconnect];
|
||||
[self.view makeToast:@"添加成功"];
|
||||
[self getMoreUserData:cameraMdel];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user