添加设备log日志显示

This commit is contained in:
wbzhan 2019-07-15 18:44:29 +08:00
parent 33254ad734
commit 43bfceb262
4 changed files with 32 additions and 80 deletions

View File

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

View File

@ -241,20 +241,21 @@ Strong UIImage *screenShotImage;//截图
- (void)viewDidLoad {
[super viewDidLoad];
[self checkNetStatus];
self.isShowControllerBar = YES;
self.isVideoModeHD = NO;
_isReject=YES;
_isStop = NO;
_isPushNextView = NO;
if ([self.contact.isActive isEqualToString:@"1"]) {
[self connectDevice];
}
//()
[self initComponentForPortrait];
//()
[self initComponentForHorizontalScreen];
if ([self.contact.isActive isEqualToString:@"1"]) {
[self connectDevice];
}else{
[self.yProgressView stop];
@ -278,20 +279,21 @@ Strong UIImage *screenShotImage;//截图
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
//
if (!_connectDevice) {
NSLog(@"正在初始化设备");
NSLog(@"正在检查P2P连接状态");
_connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.contact.cameraId password:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
// [self outputLog:dataDictionary success:success];
//
if (success) {
NSLog(@"当前连接设备信息:%@",dataDictionary);
}
}];
if (_connectDevice) {
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.contact.cameraId password:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
//
if (success) {
NSLog(@"当前连接设备信息:%@",dataDictionary);
}
}];
}
}
if(!_connectDevice){//p2p
NSLog(@"p2pConnect failure.失败,不能操作设备");
[self hiddenMonitoringUI:YES callWithErrorType:GWP2PCallErrorTimeout isReCall:NO];
[self hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO];
return;
}
}
@ -311,7 +313,7 @@ Strong UIImage *screenShotImage;//截图
WEAK_SELF;
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[weakSelf.player p2pCallDeviceWithDeviceId:self.contact.cameraId password:weakSelf.contact.cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) {
[weakSelf.player p2pCallDeviceWithDeviceId:self.contact.cameraId password:self.contact.cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) {
//
NSLog(@"[p2pCallDevice-Calling],paras=%@",parameters);
@ -323,6 +325,7 @@ Strong UIImage *screenShotImage;//截图
_isReject=YES;
NSLog(@"摄像头连接失败");
dispatch_async(dispatch_get_main_queue(), ^{
[self.view makeToast:@"连接失败"];
[self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO];
});
@ -1292,49 +1295,6 @@ Strong UIImage *screenShotImage;//截图
}
}
}
#pragma mark
-(void)onVerticalBtnTouchDown:(UIButton *)button{
switch(button.tag){
case SOUND_BUTTON_H_TAG://
{
}
break;
case SWITCH_SCREEN_BUTTON_H_TAG://
{
}
break;
case DEFENCE_BUTTON_H_TAG://
{
}
break;
case TALK_BUTTON_H_TAG://
{
//
NSInteger deviceType1 = [AppDelegate sharedDefault].contact.contactType;
//
NSInteger deviceType2 = [[FListManager sharedFList] getType:[[P2PClient sharedClient] callId]];
if (deviceType1 != CONTACT_TYPE_DOORBELL && deviceType2 != CONTACT_TYPE_DOORBELL) {//
[self.pressView setHidden:NO];
//[[PAIOUnit sharedUnit] setSpeckState:NO];
}
}
break;
case SCREENSHOT_BUTTON_H_TAG://
{
}
break;
case PROMPT_BUTTON_TAG://
{
}
break;
}
}
#define MESG_SET_GPIO_PERMISSION_DENIED 86
#define MESG_GPIO_CTRL_QUEUE_IS_FULL 87
@ -1827,12 +1787,10 @@ Strong UIImage *screenShotImage;//截图
if(rightItemCount==2){//NPC
//
if(i==0){
//label.text = NSLocalizedString(@"SD", nil);
label.text = NSLocalizedString(@"标清", nil);
label.tag = CONTROLLER_LABEL_TAG_SD;
button.tag = CONTROLLER_BTN_TAG_SD;
}else if(i==1){
//label.text = NSLocalizedString(@"LD", nil);
label.text = NSLocalizedString(@"流畅", nil);
label.tag = CONTROLLER_LABEL_TAG_LD;
label.textColor = XBlue;
@ -2292,10 +2250,7 @@ Strong UIImage *screenShotImage;//截图
[self getLastImgGoback];
}
if(!_isReject){
_isReject = YES;
[self.player p2pStop];
}
[self.player p2pStop];
[Socketsingleton sharedInstance].communiteDelegate=nil;
[[Socketsingleton sharedInstance] cutOffSocket];
[AppDelegate sharedDefault].canFullScreen = NO;
@ -2637,7 +2592,7 @@ Strong UIImage *screenShotImage;//截图
break;
case CONTROLLER_BTN_TAG_LD:
{
[self.player p2pSetDefinition:GWP2PPTZDefinitionLD];
[self.player p2pSetDefinition:GWP2PPTZDefinitionLD];//
[self updateRightButtonState:CONTROLLER_BTN_TAG_LD];
}
break;
@ -2795,9 +2750,8 @@ Strong UIImage *screenShotImage;//截图
-(void)hiddenMonitoringUI:(BOOL)isHidden callWithErrorType:(GWP2PCallError)errorType isReCall:(BOOL)isReCall{
if (isHidden) {
[self.yProgressView stop];
// self.yProgressView.angle = 0.0f;
[self.yProgressView setHidden:YES];
[self.promptButton setEnabled:NO];
[self.promptButton setHidden:YES];
@ -2815,7 +2769,7 @@ Strong UIImage *screenShotImage;//截图
}else{
self.yProgressView.angle = 0.0f;
// self.yProgressView.angle = 0.0f;
self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start");
self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png");
[self.yProgressView stop];
@ -3595,10 +3549,8 @@ GWP2PCallErrorNotSupport,
//
//frame
self.promptButton.frame = self.canvasView.frame;
NSString *labelTipText = [NSString stringWithFormat:@"%@",NSLocalizedString(@"玩命加载中...", nil)];
CGSize size = [labelTipText sizeWithFont:XFontBold_16];
//
CGFloat tipHeight = size.height + LOADINGPRESSVIEW_WIDTH_HEIGHT;
CGFloat tipHeight = LOADINGPRESSVIEW_WIDTH_HEIGHT;
self.yProgressView.frame = CGRectMake((width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (height-tipHeight)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT);
//remoteViewframe
@ -4517,7 +4469,6 @@ GWP2PCallErrorNotSupport,
if (indexPath.row ==0) {
//
[self screenShot];
// [self.remoteView setIsScreenShotting:YES];
}else if (indexPath.row ==1){
//
if ([self.player isPlaying]) {
@ -4617,7 +4568,6 @@ GWP2PCallErrorNotSupport,
-(void)pushkankanView{
//IfishKanKanListViewController *kankanVc=[[IfishKanKanListViewController alloc] init];
LoveFishLiveListBaseViewController *kankanVc=[[LoveFishLiveListBaseViewController alloc] init];
[self.navigationController pushViewController:kankanVc animated:YES];

View File

@ -348,9 +348,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
NSString *newPassword = GIWEI_INITPASS;
self.lastSetPassword = [Utils GetTreatedPassword:newPassword];;
// [[P2PClient sharedClient] setInitPasswordWithId:self.contactID initPassword:self.lastSetPassword];
}else{
}
@ -398,10 +396,12 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
NSString *deviceID = [deviceDict[@"deviceID"] stringValue];
NSString *deviceIP = deviceDict[@"deviceIP"];
NSString *devicePassword = deviceDict[@"devicePassword"];
weakSelf.contactID = [NSString stringWithFormat:@"%d",deviceID];
if (![deviceDict[@"isInitPassword"] boolValue]) { //设备没有初始化密码,设置密码
[[GWP2PClient sharedClient] setDeviceInitialPassword:@"123" withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"success:%i %@",success,dataDictionary);
[weakSelf.view makeToast:[NSString stringWithFormat:@"未初始化过设备密码,初始化设备密码失败 result = %i",dataDictionary]];
[weakSelf resetPassWord];//初始化密码
if (success) {
[weakSelf initPwdResault:dataDictionary];
@ -411,14 +411,15 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
weakSelf.lodviewMissStyle =lodingViewdissMissSuccsess;
[weakSelf connectNormalView];
_canDissMissController = YES;
[weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)];
// [weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)];
});
}
}];
} else { //设备已经初始化密码,可以让用户输入正确的密码验证通过后加到本地列表,这里直接使用123
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:@"123" completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
} else {
//设备已经初始化过密码,则直接获取设备信息
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:devicePassword completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"success:%i %@",success,dataDictionary);
[weakSelf.view makeToast:[NSString stringWithFormat:@"获取设备信息失败 result = %i",dataDictionary]];
[weakSelf resetPassWord];//更新密码
if (success) {
dispatch_async(dispatch_get_main_queue(), ^{
@ -438,7 +439,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
self.lodviewMissStyle =lodingViewdissMissSuccsess;
[self connectNormalView];
_canDissMissController = YES;
[self.view makeToast:NSLocalizedString(@"operator_failure", nil)];
// [self.view makeToast:NSLocalizedString(@"operator_failure", nil)];
});
}
@ -449,6 +450,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
//初始化设备密码回调
-(void)initPwdResault:(NSDictionary *)parameter{
NSString * contactName = [NSString stringWithFormat:@"Cam%@", self.contactID];
ContactDAO *contactDAO = [[ContactDAO alloc] init];

View File

@ -56,7 +56,7 @@
self.isStartAnim = NO;
// img
dispatch_async(dispatch_get_main_queue(), ^{
self.backgroundView.transform = CGAffineTransformMakeRotation(self.angle);
self.backgroundView.transform = CGAffineTransformIdentity;
});
}