构建版本V9.9.8提交

This commit is contained in:
wbzhan 2019-07-22 15:15:01 +08:00
parent e8fd85f3dd
commit 0b7755866e
6 changed files with 107 additions and 65 deletions

View File

@ -70,7 +70,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>9.9.6</string> <string>9.9.8</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>

View File

@ -37,7 +37,6 @@
#define DESCREPTION_CAMERANAME3_TAG 3013 #define DESCREPTION_CAMERANAME3_TAG 3013
#define DESCREPTION_CAMERANAME4_TAG 3014 #define DESCREPTION_CAMERANAME4_TAG 3014
#import "YooseConnectFirstViewController.h"
#import "DeviceCameraModel.h" #import "DeviceCameraModel.h"
#import "IfishP2PMonitorController.h" #import "IfishP2PMonitorController.h"

View File

@ -11,8 +11,6 @@
#import "MineKanHuNotBindSecondViewCell.h" #import "MineKanHuNotBindSecondViewCell.h"
#import "MineKanHuNormalViewCell.h" #import "MineKanHuNormalViewCell.h"
#import "PushMasssageWebViewController.h" #import "PushMasssageWebViewController.h"
#import "YooseConnectFirstViewController.h"
//#import "IfishSelectCardViewController.h"
#import "IfishBindDeviceSelectViewController.h" #import "IfishBindDeviceSelectViewController.h"
#import "IfishCameraModel.h" #import "IfishCameraModel.h"
#define CELL_KANHURAG1 555 #define CELL_KANHURAG1 555

View File

@ -23,8 +23,10 @@
BOOL _isCanAutoOrientation;// BOOL _isCanAutoOrientation;//
BOOL _connectDevice; //
BOOL _isStop;// BOOL _isStop;//
BOOL _connectDevice; //P2P
BOOL _isConnectCamera;//
BOOL _isconnecting;//
int _OnLine; int _OnLine;
} }
@ -38,6 +40,7 @@
self.isVideoModeHD = NO; self.isVideoModeHD = NO;
_isReject=YES; _isReject=YES;
_isStop = NO; _isStop = NO;
_isconnecting = NO;
[self addTitleViewWithTitle:@"看护"]; [self addTitleViewWithTitle:@"看护"];
[self connectDevice]; [self connectDevice];
//() //()
@ -74,23 +77,45 @@
UserModel *model=[dataContorl getUserInfo]; UserModel *model=[dataContorl getUserInfo];
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
// //
if (!_connectDevice) { if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
NSLog(@"正在初始化设备"); NSLog(@"正在检查P2P连接状态");
_connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; _connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
if (_connectDevice) {
[self connectCamera];
}else{
NSLog(@"p2pConnect failure.失败,不能操作设备");
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.view makeToast:@"连接失败"];
[self hiddenMonitoringUI:NO callWithErrorType:GWP2PCallErrorNone isReCall:NO];
});
}
}
}
//
-(void)connectCamera{
if (!_isconnecting) {
_isconnecting = YES;//
NSString *newPassword = GIWEI_INITPASS; NSString *newPassword = GIWEI_INITPASS;
NSString *cameraPass = [Utils GetTreatedPassword:newPassword]; NSString *cameraPass = [Utils GetTreatedPassword:newPassword];
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.kanHuCamera.cameraId password:cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) { [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.kanHuCamera.cameraId password:cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
// [self outputLog:dataDictionary success:success]; _isconnecting = NO;
// //
if (success) { if (success) {
NSLog(@"观看直播连接设备信息:%@",dataDictionary); _isConnectCamera = YES;
[self monitorP2PCall];
NSLog(@"当前连接设备信息:%@",dataDictionary);
}else{
_isConnectCamera = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.view makeToast:@"连接失败"];
[self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:NO];
});
return;
} }
}]; }];
} }else{
if(!_connectDevice){//p2p //
NSLog(@"p2pConnect failure.失败,不能操作设备");
[self hiddenMonitoringUI:YES callWithErrorType:GWP2PCallErrorTimeout isReCall:NO];
return;
} }
} }
#pragma mark -- #pragma mark --
@ -99,12 +124,14 @@
return; return;
} }
//p2p //p2p
if (!_connectDevice) { if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
[self connectDevice]; [self connectDevice];
if(_connectDevice){ return;
// }
[self monitorP2PCall]; //
} if (!_isConnectCamera) {
[self connectCamera];
return;
} }
WEAK_SELF; WEAK_SELF;
NSString *newPassword = GIWEI_INITPASS; NSString *newPassword = GIWEI_INITPASS;

View File

@ -73,11 +73,13 @@
UIButton* _btnDefence; UIButton* _btnDefence;
BOOL _isCanAutoOrientation;// BOOL _isCanAutoOrientation;//
BOOL _connectDevice; // BOOL _connectDevice; //P2P
BOOL _isConnectCamera;//
BOOL _isStop;// BOOL _isStop;//
dispatch_queue_t _xutoMainQueue; dispatch_queue_t _xutoMainQueue;
BOOL _isPushNextView; //push BOOL _isPushNextView; //push
BOOL _isNewXuanduo; // BOOL _isNewXuanduo; //
BOOL _isconnecting;//
} }
@property(nonatomic,strong) SetTimeController*SetTimeVC; @property(nonatomic,strong) SetTimeController*SetTimeVC;
@ -236,6 +238,7 @@ Strong UIImage *screenShotImage;//截图
_isReject=YES; _isReject=YES;
_isStop = NO; _isStop = NO;
_isPushNextView = NO; _isPushNextView = NO;
_isConnectCamera = NO;
if ([self.contact.isActive isEqualToString:@"1"]) { if ([self.contact.isActive isEqualToString:@"1"]) {
[self connectDevice]; [self connectDevice];
} }
@ -276,26 +279,44 @@ Strong UIImage *screenShotImage;//截图
UserModel *model=[dataContorl getUserInfo]; UserModel *model=[dataContorl getUserInfo];
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
// //
if (!_connectDevice) { if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
NSLog(@"正在检查P2P连接状态"); NSLog(@"正在检查P2P连接状态");
if ([GWP2PClient sharedClient].linkStatus == P2PLinkStatusOK) {
[[GWP2PClient sharedClient] disconnect];
}
_connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; _connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
if (_connectDevice) { if (_connectDevice) {
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.contact.cameraId password:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) { [self connectCamera];
// }else{
if (success) { NSLog(@"p2pConnect failure.失败,不能操作设备");
NSLog(@"当前连接设备信息:%@",dataDictionary); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
} [self.view makeToast:@"连接失败"];
}]; [self hiddenMonitoringUI:NO callWithErrorType:GWP2PCallErrorNone isReCall:NO];
});
} }
} }
if(!_connectDevice){//p2p
NSLog(@"p2pConnect failure.失败,不能操作设备"); }
[self hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO]; //
return; -(void)connectCamera{
if (!_isconnecting) {
_isconnecting = YES;//
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.contact.cameraId password:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
_isconnecting = NO;
//
if (success) {
_isConnectCamera = YES;
[self monitorP2PCall];
NSLog(@"当前连接设备信息:%@",dataDictionary);
}else{
_isConnectCamera = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.view makeToast:@"连接设备失败"];
[self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:NO];
});
return;
}
}];
}else{
//
} }
} }
#pragma mark -- #pragma mark --
@ -304,12 +325,14 @@ Strong UIImage *screenShotImage;//截图
return; return;
} }
//p2p //p2p
if (!_connectDevice) { if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
[self connectDevice]; [self connectDevice];
if(_connectDevice){ return;
// }
[self monitorP2PCall]; //
} if (!_isConnectCamera) {
[self connectCamera];
return;
} }
WEAK_SELF; WEAK_SELF;
dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_async(dispatch_get_global_queue(0, 0), ^{
@ -2750,7 +2773,6 @@ Strong UIImage *screenShotImage;//截图
-(void)hiddenMonitoringUI:(BOOL)isHidden callWithErrorType:(GWP2PCallError)errorType isReCall:(BOOL)isReCall{ -(void)hiddenMonitoringUI:(BOOL)isHidden callWithErrorType:(GWP2PCallError)errorType isReCall:(BOOL)isReCall{
if (isHidden) { if (isHidden) {
[self.yProgressView stop]; [self.yProgressView stop];
// self.yProgressView.angle = 0.0f;
[self.yProgressView setHidden:YES]; [self.yProgressView setHidden:YES];
[self.promptButton setEnabled:NO]; [self.promptButton setEnabled:NO];
[self.promptButton setHidden:YES]; [self.promptButton setHidden:YES];

View File

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