开发版本-developer——01 first commit

This commit is contained in:
wbzhan
2019-07-08 18:24:03 +08:00
parent 5a10dfa182
commit 8693efe121
386 changed files with 7069 additions and 1951 deletions
@@ -46,9 +46,6 @@
#import "UIButton+WebCache.h"
//老版本选择设备界面
//#import "SelectDeviceViewController.h"
//#import "IfishSelectCardViewController.h"
#import "IfishBindDeviceSelectViewController.h"
#import "IfishMianTabViewController.h"
@@ -10,6 +10,10 @@
#import "ShopKanHuP2PViewController.h"
#import "IfishKankanListModel.h"
#import "P2PShareViewBootomView.h"
/**
观看鱼友直播内容
*/
@interface IfishP2PLivePlayViewController : ShopKanHuP2PViewController
@property(nonatomic,strong) P2PShareViewBootomView * subHbottomView;
@@ -20,11 +20,6 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
[self addTitleViewWithTitle:@"分享中"];
//自定义封装播放器 由于xib创建OPGLview 无法显示(暂未找到方法)暂时不用 纯代码建UI可以试试
//[self setupVideoPlayView];
//现采用继承ShopKanHuP2PViewController 替换底部 HbootmView
// self.HbootmView.hidden= YES;
self.view.backgroundColor = TABLE_BACKGROUD_COLOR;
[self resetBootomView];
@@ -11,7 +11,7 @@
#import "ProgressImageView.h"
#import "OpenGLView.h"
#import "TouchButton.h"
#import<GWP2P/GWP2P.h>
#import "CustomBorderButton.h"
#import "CustomView.h"
#define FocalLength_Elongation_btnTag 300
@@ -8,6 +8,9 @@
#import "BaseViewController.h"
/**
首页点击添加设备进入此添加设备页面
*/
@interface IfishBindDeviceSelectViewController : BaseViewController
@end
@@ -8,7 +8,7 @@
#import "IfishBindDeviceSelectViewController.h"
#import "FishSelectDeviceListViewCell.h"
#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
#import "UDPManager.h"
#import "YooseeNextConnectViewController.h"
#import "SecondConnectWifiController.h"
@@ -19,7 +19,6 @@
@interface IfishBindDeviceSelectViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong) UITableView *tableView;
@property(nonatomic)BOOL islogInGewell;
@end
extern BOOL isfromCameraView;
@implementation IfishBindDeviceSelectViewController
@@ -30,49 +29,23 @@ extern BOOL isfromCameraView;
// Do any additional setup after loading the view.
[self addTitleViewWithTitle:@"选择设备"];
[self creatTab];
[self loginGewell];
[self loginGWP2P];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
// [self loginGewell];
// if( _islogInGewell){
//
// NSLog(@"p2pConnect success.成功,你可以操作设备了");
//
// }else{//new added
// [self loginGewell];
// NSLog(@"p2pConnect failure.失败,你将不能操作设备");
//
//// return;
// }
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
//CGPoint curentpoint= [self.cardScrollView contentOffsetWithIndex:[self.cardScrollView currentCard]];
//[self.cardScrollView.scrollView setContentOffset:curentpoint animated:NO];
// [self loginGewell];
}
#pragma mark - loginGewell
-(void)loginGewell{
#pragma mark - loginGWP2P
-(void)loginGWP2P{
[SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeBlack];
[[UDPManager sharedDefault] ScanLanDevice];
_islogInGewell = NO;
// LoginResult *loginResult = [UDManager getLoginInfo];
// NSString * P2PVerifyCode1 = @"1528438234";
// NSString * P2PVerifyCode2 = @"992805759";
// NSString *UserID = @"-2144354932";
UserModel *model=[dataContorl getUserInfo];
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
NSLog(@"%@%@%@",userIDName,model.P2PVerifyCode1,model.P2PVerifyCode2);
@@ -95,8 +68,8 @@ extern BOOL isfromCameraView;
dispatch_queue_t queue = dispatch_queue_create("net.bujige.testQueue", DISPATCH_QUEUE_CONCURRENT);
dispatch_async(queue, ^{
// 追加任务1
[[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
// // 追加任务1
// self.islogInGewell = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
dispatch_async(dispatch_get_main_queue(), ^{
@@ -165,35 +138,24 @@ extern BOOL isfromCameraView;
//wifi环境下转跳下一界面
switch (indexPath.row) {
case 0:
{
//摄像头
NSArray * cameraArr =[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"];
if ([cameraArr count]>=5) {
[self.view makeToast:@"设备已达上线限"];
[self.view makeToast:@"设备已达上限"];
return;
}
if ( self.islogInGewell) {
if ( [GWP2PClient sharedClient].linkStatus==P2PLinkStatusOK) {
self.hidesBottomBarWhenPushed = YES;
YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init];
[self.navigationController pushViewController:nextvc animated:YES];
nextvc.conectType = 0;
}else{
UserModel *model=[dataContorl getUserInfo];
[self loginGewellWith:model];
}
}
break;
case 1:
@@ -204,7 +166,7 @@ extern BOOL isfromCameraView;
if ([deviceArr count]>=5) {
[self.view makeToast:@"设备已达上线"];
[self.view makeToast:@"设备已达上限"];
return;
}
@@ -245,13 +207,13 @@ extern BOOL isfromCameraView;
}
-(void)loginGewellWith:(UserModel *)model;
-(void)loginGewellWith:(UserModel *)model
{
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
NSString *accountId =[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
if ([userIDName isEqualToString:@"0"]) {
if ([accountId isEqualToString:@"0"]) {
[self.view makeToast:@"暂未检测到设备"];
@@ -266,10 +228,11 @@ extern BOOL isfromCameraView;
[self.view makeToast:@"暂未检测到设备"];
return;
}
self.islogInGewell = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
if ([GWP2PClient sharedClient]!=P2PLinkStatusOK) {
[[GWP2PClient sharedClient] connectWithAccount:accountId codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
}
//loginResult.contactId 用户ID号
NSLog(@"%@%@%@",userIDName,model.P2PVerifyCode1,model.P2PVerifyCode2);
NSLog(@"%@%@%@",accountId,model.P2PVerifyCode1,model.P2PVerifyCode2,model.sessionID,model.sessionID2);
}
@@ -1158,6 +1158,7 @@ Assign NSInteger messageCount;//消息个数
//切换时主动 断开 soket
[[Socketsingleton sharedInstance] cutOffSocket];
//进入摄像头页面
IfishP2PMonitorController *p2pVC=[[IfishP2PMonitorController alloc] init];
p2pVC.contact = model.camera;
UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:p2pVC];
@@ -1,14 +0,0 @@
//
// IfishSelectCardViewController.h
// ShotViewAnimation
//
// Created by imac on 16/10/25.
// Copyright © 2016年 xiang. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BaseViewController.h"
//v4.4 之前版本界面 滑动选项卡选择绑定设备类型
@interface IfishSelectCardViewController : BaseViewController
@end
@@ -1,375 +0,0 @@
//
// IfishSelectCardViewController.m
// ShotViewAnimation
//
// Created by imac on 16/10/25.
// Copyright © 2016年 xiang. All rights reserved.
//
#import "IfishSelectCardViewController.h"
#import "IfishCardScrollView.h"
#import "Reachability.h"
/**
* color config
*/
#define GCUIColorFromRGB(rgbValue) \
[UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 \
green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 \
blue:((float)(rgbValue & 0xFF)) / 255.0 \
alpha:1.0]
#define kGCCardRatio 0.8
#define kGCCardWidth CGRectGetWidth(self.view.frame)*kGCCardRatio
#define kGCCardHeight kGCCardWidth/kGCCardRatio
#import "SecondConnectWifiController.h"
#import "UDPManager.h"
#import "UDManager.h"
#import "LoginResult.h"
#import "P2PClient.h"
#import "AFNetworking.h"
#import "YooseeNextConnectViewController.h"
@interface IfishSelectCardViewController ()<CardScrollViewDelegate,CardScrollViewDataSource>
@property (nonatomic, strong) IfishCardScrollView *cardScrollView;
@property (nonatomic, strong) NSMutableArray *cards;
@property (nonatomic, strong) NSArray *cardsImg;
@property(nonatomic)BOOL islogInGewell;
@end
extern BOOL isfromCameraView;
@implementation IfishSelectCardViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
// 添加鱼缸设备不是来自摄像头界面
isfromCameraView = NO;
[self addTitleViewWithTitle:@"选择设备"];
self.view.backgroundColor = COLOR_MIAN;
self.cardScrollView = [[IfishCardScrollView alloc] initWithFrame:CGRectMake(0,0, self.view.frame.size.width, self.view.frame.size.height)];
self.cardScrollView.cardDelegate = self;
self.cardScrollView.cardDataSource = self;
[self.view addSubview:self.cardScrollView];
self.cards = [NSMutableArray array];
for (NSInteger i = 0; i < 2; i++) {
[self.cards addObject:@(i)];
}
self.cardsImg = @[@"equipment_background",@"equipment_background_camera"];
self.automaticallyAdjustsScrollViewInsets = NO;
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[self loginGewell];
if( _islogInGewell){
NSLog(@"p2pConnect success.成功,你可以操作设备了");
}else{//new added
[self loginGewell];
NSLog(@"p2pConnect failure.失败,你将不能操作设备");
return;
}
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
//CGPoint curentpoint= [self.cardScrollView contentOffsetWithIndex:[self.cardScrollView currentCard]];
//[self.cardScrollView.scrollView setContentOffset:curentpoint animated:NO];
[self loginGewell];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
[self.cardScrollView loadCard];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
}
-(void)goBackAction{
//充血返回事件 防止在选择水族箱 时 返回卡顿
[self.cardScrollView.scrollView setContentOffset:CGPointMake(0, 0) animated:NO];
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - CardScrollViewDelegate
- (void)updateCard:(UIView *)card withProgress:(CGFloat)progress direction:(CardMoveDirection)direction {
if (direction == CardMoveDirectionNone) {
if (card.tag != [self.cardScrollView currentCard]) {
CGFloat scale = 1 - 0.1 * progress;
card.layer.transform = CATransform3DMakeScale(scale, scale, 1.0);
card.layer.opacity = 1 - 0.2*progress;
} else {
card.layer.transform = CATransform3DIdentity;
card.layer.opacity = 1;
}
} else {
NSInteger transCardTag = direction == CardMoveDirectionLeft ? [self.cardScrollView currentCard] + 1 : [self.cardScrollView currentCard] - 1;
if (card.tag != [self.cardScrollView currentCard] && card.tag == transCardTag) {
card.layer.transform = CATransform3DMakeScale(0.9 + 0.1*progress, 0.9 + 0.1*progress, 1.0);
card.layer.opacity = 0.8 + 0.2*progress;
} else if (card.tag == [self.cardScrollView currentCard]) {
card.layer.transform = CATransform3DMakeScale(1 - 0.1 * progress, 1 - 0.1 * progress, 1.0);
card.layer.opacity = 1 - 0.2*progress;
}
}
}
#pragma mark - CardScrollViewDataSource
- (NSInteger)numberOfCards {
return self.cards.count;
}
- (UIView *)cardReuseView:(UIView *)reuseView atIndex:(NSInteger)index {
if (reuseView) {
// you can set new style
return reuseView;
}
// UIView *card = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kGCCardWidth * 0.9, kGCCardHeight)];
// card.layer.backgroundColor = [UIColor whiteColor].CGColor;
// card.layer.cornerRadius = 4;
// card.layer.masksToBounds = YES;
UIView *card = [[UIView alloc] initWithFrame:CGRectMake(0, 0,kGCCardWidth * 0.9, kGCCardWidth * 0.9 *1.55)];
card.layer.backgroundColor = [UIColor whiteColor].CGColor;
card.layer.cornerRadius = 4;
card.layer.masksToBounds = YES;
UIImageView *cardImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0 , 0, kGCCardWidth * 0.9, kGCCardWidth * 0.9 *1.55)];
NSString *imagename=self.cardsImg[index];
cardImgView.image = [UIImage imageNamed:imagename];
cardImgView.userInteractionEnabled = YES;
[card addSubview:cardImgView];
//前往绑定按钮
CGFloat qianWangBtnW = kGCCardWidth * 0.9 - 20*2;
CGFloat qianWangBtnY = kGCCardWidth * 0.9 *1.55 - 20 -qianWangBtnW *0.18;
UIButton *qianWangBtn=[UIButton buttonWithType:UIButtonTypeCustom];
qianWangBtn.frame = CGRectMake(CGRectGetMaxX(cardImgView.frame)/2 - qianWangBtnW/2, qianWangBtnY, qianWangBtnW , qianWangBtnW *0.18);
[qianWangBtn setTitle:@"前往绑定" forState:UIControlStateNormal];
[qianWangBtn addTarget:self action:@selector(qianWangBtnAction:) forControlEvents:UIControlEventTouchUpInside];
qianWangBtn.tag = index *100;
// qianWangBtn.layer.masksToBounds = YES;
// qianWangBtn.layer.cornerRadius = 5;
[qianWangBtn setBackgroundImage:[UIImage imageNamed:@"equipment_button"] forState:UIControlStateNormal];
[cardImgView addSubview:qianWangBtn];
return card;
}
-(void)qianWangBtnAction:(UIButton *)btn{
[self testwifiWithBtn:btn];
}
/**
* 检测是否wifi环境
*/
-(void)testwifiWithBtn:(UIButton *)btn{
Reachability *currReach = [Reachability reachabilityForLocalWiFi];
NetworkStatus status = [currReach currentReachabilityStatus];
NSLog(@"NetworkStatus%ld", (long)status);
if (status==AFNetworkReachabilityStatusReachableViaWiFi) {
//wifi环境下转跳下一界面
switch (btn.tag) {
case 0:
{
//水族箱
NSArray * deviceArr =[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
if ([deviceArr count]>=5) {
[self.view makeToast:@"设备已达上线限"];
return;
}
self.hidesBottomBarWhenPushed = YES;
SecondConnectWifiController*wifivc=[[SecondConnectWifiController alloc]init];
[self.navigationController pushViewController:wifivc animated:YES];
}
break;
case 100:
{
//摄像头
NSArray * cameraArr =[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"];
if ([cameraArr count]>=5) {
[self.view makeToast:@"设备已达上线限"];
return;
}
if ( self.islogInGewell) {
self.hidesBottomBarWhenPushed = YES;
YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init];
[self.navigationController pushViewController:nextvc animated:YES];
nextvc.conectType = 0;
}else{
UserModel *model=[dataContorl getUserInfo];
[self loginGewellWith:model];
}
}
break;
default:
break;
}
}else{
[self.view makeToast:@"请切换到WiFi环境下绑定"];
}
}
-(void)loginGewellWith:(UserModel *)model;
{
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
if ([userIDName isEqualToString:@"0"]) {
[self.view makeToast:@"暂未检测到设备"];
//请求GewellCodes
//[self getGewellCodes];
return;
}
if ([model.P2PVerifyCode1 isEqualToString:@""]) {
[self.view makeToast:@"暂未检测到设备"];
return;
}
if ([model.P2PVerifyCode2 isEqualToString:@""]) {
[self.view makeToast:@"暂未检测到设备"];
return;
}
self.islogInGewell = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
//loginResult.contactId 用户ID号
NSLog(@"%@%@%@",userIDName,model.P2PVerifyCode1,model.P2PVerifyCode2);
}
#pragma mark - loginGewell
-(void)loginGewell{
[[UDPManager sharedDefault] ScanLanDevice];
_islogInGewell = NO;
// LoginResult *loginResult = [UDManager getLoginInfo];
// NSString * P2PVerifyCode1 = @"1528438234";
// NSString * P2PVerifyCode2 = @"992805759";
// NSString *UserID = @"-2144354932";
UserModel *model=[dataContorl getUserInfo];
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
NSLog(@"%@%@%@",userIDName,model.P2PVerifyCode1,model.P2PVerifyCode2);
if ([userIDName isEqualToString:@"0"]) {
//
[self.view makeToast:@"摄像头用户名空错误码10001"];
return;
}
if ([model.P2PVerifyCode1 isEqualToString:@""]) {
[self.view makeToast:@"摄像头P2PVerifyCode1空错误码10002"];
return;
}
if ([model.P2PVerifyCode2 isEqualToString:@""]) {
[self.view makeToast:@"摄像头P2PVerifyCode2空错误码10003"];
return;
}
_islogInGewell = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
}
-(void)getGewellCodes{
[self.view makeToast:@"连接服务器中。。"];
UserModel *model= [dataContorl getUserInfo];
NSString *userid = [NSString stringWithFormat:@"%@",model.userId];
[AFHttpTool getGwellCodes:userid success:^(id response) {
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSDictionary *data=reDic[@"data"];
if ([reDic[@"result"] isEqualToString:@"100"]) {
model.P2PVerifyCode1 =data[@"P2PVerifyCode1"];
model.P2PVerifyCode2 =data[@"P2PVerifyCode2"];
model.gwellUserID =data[@"gwellUserID"];
[dataContorl resetUser:model];
[self loginGewellWith:model];
[self.view makeToast:@"连接服务器成功请继续"];
}else{
}
} failure:^(NSError *err) {
NSLog(@"错误err%@",err);
}];
}
//- (void)deleteCardWithIndex:(NSInteger)index {
// [self.cards removeObjectAtIndex:index];
//}
@end
@@ -18,7 +18,6 @@
@property(nonatomic,copy) NSString * isMaster;
//是否授权
@property(nonatomic,copy) NSString * isActive;
//摄像头密码写死 全一样 123 md5 加密
@property(nonatomic,copy) NSString *cameraPass;
//
@@ -4,26 +4,22 @@
//
// Created by imac on 16/6/7.
// Copyright © 2016年 xiang. All rights reserved.
//
//摄像头详情页面
#import <UIKit/UIKit.h>
#import "P2PClient.h"
#import <AVFoundation/AVFoundation.h>
#import "TouchButton.h"
#import "OpenGLView.h"
//#import "OpenGLView.h"
#import <GWP2P/GWP2P.h>
#import "CustomBorderButton.h"
#import "CustomView.h"
#import "ProgressImageView.h"
//#import "MainController.h"
//#import "CustomTopBar.h"
#import "AppDelegate.h"
#define FocalLength_Elongation_btnTag 300
#define FocalLength_Shorten_btnTag 301
#define FocalLength_Change_sliderTag 302
#import "MonitorBootmView.h"
//#import "Socketsingleton.h"
#import "SongBaoViewController.h"
//竖屏
#define STOPBTN_TAG 1603227
@@ -53,10 +49,10 @@
#import "IifshSegmentView.h"
@interface IfishP2PMonitorController : UIViewController<
AVCaptureVideoDataOutputSampleBufferDelegate,UIGestureRecognizerDelegate,TouchButtonDelegate,
OpenGLViewDelegate,UIScrollViewDelegate,UIAlertViewDelegate,P2PClientDelegate,MonitorBottomCollcetionSelectDelegate,LxPopViewDelegate,CameraBottomHViewDelegate,IfishSegmentViewDelegate>
AVCaptureVideoDataOutputSampleBufferDelegate,UIGestureRecognizerDelegate,TouchButtonDelegate,UIScrollViewDelegate,UIAlertViewDelegate,MonitorBottomCollcetionSelectDelegate,LxPopViewDelegate,CameraBottomHViewDelegate,IfishSegmentViewDelegate>
@property (nonatomic, strong) OpenGLView *remoteView;
//@property (nonatomic, strong) OpenGLView *remoteView;
@property (nonatomic, strong) GWP2PVideoPlayer *player;//摄像头页面
@property (nonatomic) BOOL isReject;
@property (nonatomic) BOOL isFullScreen4B3;
@property (nonatomic) BOOL isShowControllerBar;
File diff suppressed because it is too large Load Diff
@@ -1331,9 +1331,6 @@
}
NSString* pwdHead = PASSWORD_HEAD; //30
self.camera.cameraPass = [NSString stringWithFormat:@"%@%@", pwdHead, box.yMsgInputText];
//[[FListManager sharedFList] updatee:self.camera];
//[[FListManager sharedFList] getDefenceStates];
if ([box.theTagString isEqualToString:@"Msg_flist_pwd_error"]) {//,
[[P2PClient sharedClient] setCurrentLabel:1];
[[P2PClient sharedClient] getPlaybackFilesWithId:self.camera.cameraId password:self.camera.cameraPass timeInterval:1];
@@ -651,7 +651,7 @@
}
}else if([[P2PClient sharedClient] gwplaybackState]==PLAYBACK_STATE_STOP){
_isPause=YES;
[[P2PClient sharedClient] sendCommandType:USR_CMD_PLAY_CTL
[[P2PClient sharedClient] sendCommandType:USR_CMD_REMOTLY_PLAY_CTL
andOption:USR_CMD_OPTION_PLAY];
if (!_isSilence) {
[self stSilence:NO];
@@ -12,7 +12,8 @@
#import "UDPManager.h"
#import "UDManager.h"
#import "LoginResult.h"
#import "P2PClient.h"
//#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
@interface YooseConnectFirstViewController ()
@property(nonatomic)BOOL isInitDevice;
@@ -62,10 +63,7 @@
_isInitDevice = NO;
// LoginResult *loginResult = [UDManager getLoginInfo];
// NSString * P2PVerifyCode1 = @"1528438234";
// NSString * P2PVerifyCode2 = @"992805759";
// NSString *UserID = @"-2144354932";
UserModel *model=[[DataCenter defaultDtacenter] valueForKey:@"UserLogIn"];
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
@@ -84,9 +82,7 @@
[self.view makeToast:@"摄像头P2PVerifyCode2空错误码10003"];
return;
}
_isInitDevice = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
_isInitDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
}
- (void)didReceiveMemoryWarning {
@@ -185,7 +181,8 @@
[self showTitle:@"" messsage:@" 暂未检测到设备"];
self.isInitDevice = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
// self.isInitDevice = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
self.isInitDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
//loginResult.contactId ID号
NSLog(@"%@%@%@",userIDName,model.P2PVerifyCode1,model.P2PVerifyCode2);
@@ -20,6 +20,9 @@ enum
conectType_qrcode
};
/**
*/
@interface YooseeNextConnectViewController : BaseViewController
@property (nonatomic,strong) NSString *uuidString;
@property (nonatomic,strong) NSString *wifiPwd;
@@ -31,7 +31,7 @@
#import "UDManager.h"
#import "LoginResult.h"
#import "Utils.h"
#import "MD5Manager.h"
#import <GWP2P/MD5Manager.h>
#import "RightViewController.h"
#import "LeftViewController.h"
#import "ICSDrawerController.h"
@@ -91,11 +91,8 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
- (void)viewDidLoad {
[super viewDidLoad];
//[self getWifiLoop];
// Do any additional setup after loading the view from its nib.
//智能联机
_initPwSuc = NO;
// [[P2PClient sharedClient] setDelegate:self];
self.conectType = conectType_Intelligent;
self.addresses = [[NSMutableDictionary alloc] initWithCapacity:1];
self.view.backgroundColor = [UIColor whiteColor];
@@ -30,8 +30,6 @@
-(NSInteger)getMessageCount:(NSString*)contactId;
-(void)setMessageCountWithId:(NSString*)contactId count:(NSInteger)count;
-(void)getDefenceStates;
-(void)setIsClickDefenceStateBtnWithId:(NSString*)contactId isClick:(BOOL)isClick;
-(BOOL)getIsClickDefenceStateBtn:(NSString*)contactId;
@end
@@ -11,7 +11,7 @@
#import "ContactDAO.h"
#import "Constants.h"
#import "UDManager.h"
#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
#import "ShakeManager.h"
#import "LocalDevice.h"
#import "AppDelegate.h"
@@ -234,17 +234,4 @@
oldContact = contact;
}
-(void)getDefenceStates{
NSArray *array = [self getContacts];
for(Contact *contact in array){
if(contact.contactType==CONTACT_TYPE_NPC||
contact.contactType==CONTACT_TYPE_IPC||
contact.contactType==CONTACT_TYPE_DOORBELL){
[[P2PClient sharedClient] getDefenceState:contact.contactId password:contact.contactPassword];
}
}
}
@end
@@ -14,8 +14,7 @@
#import <OpenGLES/ES2/glext.h>
#import "Constants.h"
#import "Utils.h"
#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
#import "AppDelegate.h"
#import "ShapeRenderNotifyMsg.h"
//////////////////////////////////////////////////////////
@@ -428,9 +427,9 @@ static GLfloat modelviewProj[16];
const char * cVersion = [strSysVersion UTF8String];
NSLog(@"系统版本号:%@", strSysVersion);// e.g. @"4.0"
NSString *contactId = [[P2PClient sharedClient] callId];
int callID = [contactId intValue];
NSLog(@"callid%@", contactId);// e.g. @"4.0"
// NSString *contactId = [[P2PClient sharedClient] callId];
int callID = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
// NSLog(@"callid%@", contactId);// e.g. @"4.0"
if (self.isFisheyeDevice) {//can delete
_shapeWarp.initData(self.bounds.size.width, self.bounds.size.height, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.width, _shapeWarp.SHAPE_CIRCLE, cVersion, callID, uuid, _uniformMatrix,_shapeWarp.FISHEYE_360);
@@ -591,13 +590,13 @@ static GLfloat modelviewProj[16];
UIImage *image = [[UIImage alloc] initWithCGImage:[self glToUIImage].CGImage];
NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(image)];
NSString* contactid = [[P2PClient sharedClient] callId];
int contactid = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
int dwApContactID = [[AppDelegate sharedDefault] dwApContactID];
if (dwApContactID != 0)
{
contactid = [NSString stringWithFormat:@"%d", dwApContactID];
contactid = dwApContactID;
}
[Utils saveHeaderFileWithId:contactid data:imgData];
[Utils saveHeaderFileWithId:[NSString stringWithFormat:@"%d",contactid] data:imgData];
if (dwApContactID != 0)
{
@@ -1072,13 +1071,13 @@ exit:
NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(image)];
NSString* contactid = [[P2PClient sharedClient] callId];
int contactid = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
int dwApContactID = [[AppDelegate sharedDefault] dwApContactID];
if (dwApContactID != 0)
{
contactid = [NSString stringWithFormat:@"%d", dwApContactID];
contactid = dwApContactID;
}
[Utils saveHeaderFileWithId:contactid data:imgData];
[Utils saveHeaderFileWithId:[NSString stringWithFormat:@"%d",contactid] data:imgData];
if (dwApContactID != 0)
{
@@ -1137,12 +1136,9 @@ exit:
if (!image) {
return;
}
NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(image)];
NSString* contactid = [[P2PClient sharedClient] callId];
[Utils saveHeaderFileWithId:contactid data:imgData];
int contactid = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
[Utils saveHeaderFileWithId:[NSString stringWithFormat:@"%d",contactid] data:imgData];
}
@@ -9,8 +9,8 @@
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import <MediaPlayer/MediaPlayer.h>
#import "P2PClient.h"
//#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
@interface PAIOUnit : NSObject
@property (nonatomic, assign) BOOL isRunning;
@@ -9,7 +9,7 @@
#import "PAIOUnit.h"
#import <AudioUnit/AudioUnit.h>
#import "AppDelegate.h"
#import "P2PCInterface.h"
//
#define kOutputBus 0
#define kInputBus 1
@@ -122,7 +122,8 @@ static OSStatus playbackCallback(void *inRefCon,
AudioBufferList *ioData)
{
BOOL isGetAudioOk = NO;
if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
// if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
if ([[GWP2PClient sharedClient] linkStatus] == P2PLinkStatusOK)
{
isGetAudioOk = fgGetAudioDataToPlay(ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize );
}
@@ -366,7 +367,8 @@ static OSStatus playbackCallback(void *inRefCon,
}
else
{
if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
// if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
if ([[GWP2PClient sharedClient] linkStatus] == P2PLinkStatusOK)
{
vFillAudioRawData(bufferList->mBuffers[0].mData, bufferList->mBuffers[0].mDataByteSize);
}
@@ -475,20 +477,4 @@ static OSStatus playbackCallback(void *inRefCon,
AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof(UInt32), &audioRoute);
}
-(void)setSpeckState:(BOOL)state{
if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P) {
self.silentAudio = state;
if(self.callType==P2PCALL_TYPE_MONITOR){
if(self.silentAudio){
fgSendUserData(5, 0, NULL, 0);
}else{
fgSendUserData(5, 1, NULL, 0);
}
}
}
}
@end
@@ -120,7 +120,7 @@
NSString* ssid = [Utils currentWifiSSID];
//ap模式不搜索
int dwApContactID = [[AppDelegate sharedDefault]dwApContactID];
int dwApContactID = [[AppDelegate sharedDefault] dwApContactID];
//
UIApplicationState iState = [UIApplication sharedApplication].applicationState;
@@ -7,7 +7,6 @@
//
#import "P2PClient.h"
#import "P2PCInterface.h"
#import "Utils.h"
#import "Constants.h"
#import "config.h"
@@ -439,7 +438,7 @@ void commandSettingInAction(DWORD dwCmd, DWORD dwOption , DWORD * pdwData, DWO
if (dwCmd == USR_CMD_PLAY_CTL) {
if (dwCmd == USR_CMD_REMOTLY_PLAY_CTL) {
DLog(@"%i",dwOption);
switch (dwOption) {
@@ -568,7 +567,7 @@ void commandSettingInAction(DWORD dwCmd, DWORD dwOption , DWORD * pdwData, DWO
BYTE prm[8];
playbackCurrentFileIndex -= 1;
memcpy(prm, &(playbackFiles[playbackCurrentFileIndex]), sizeof(sRecFilenameType));
fgSendUserData(USR_CMD_PLAY_CTL, USR_CMD_OPTION_NEXT_FILE, prm, sizeof(sRecFilenameType));
fgSendUserData(USR_CMD_REMOTLY_PLAY_CTL, USR_CMD_OPTION_NEXT_FILE, prm, sizeof(sRecFilenameType));
}
@@ -585,7 +584,7 @@ void commandSettingInAction(DWORD dwCmd, DWORD dwOption , DWORD * pdwData, DWO
BYTE prm[8];
playbackCurrentFileIndex += 1;
memcpy(prm, &(playbackFiles[playbackCurrentFileIndex]), sizeof(sRecFilenameType));
fgSendUserData(USR_CMD_PLAY_CTL, USR_CMD_OPTION_NEXT_FILE, prm, sizeof(sRecFilenameType));
fgSendUserData(USR_CMD_REMOTLY_PLAY_CTL, USR_CMD_OPTION_NEXT_FILE, prm, sizeof(sRecFilenameType));
vSetSupperDrop(TRUE);
}
@@ -593,7 +592,7 @@ void commandSettingInAction(DWORD dwCmd, DWORD dwOption , DWORD * pdwData, DWO
UInt64 jumpValue = (self.playback_startTime+value*1000000);
fgSendUserData(USR_CMD_PLAY_CTL, USR_CMD_OPTION_JUMP, (BYTE*)(&jumpValue), sizeof(UInt64));
fgSendUserData(USR_CMD_REMOTLY_PLAY_CTL, USR_CMD_OPTION_JUMP, (BYTE*)(&jumpValue), sizeof(UInt64));
vSetSupperDrop(TRUE);
}
@@ -603,7 +602,7 @@ void commandSettingInAction(DWORD dwCmd, DWORD dwOption , DWORD * pdwData, DWO
// UInt64 jumpValue =32;
NSLog(@"fastBeginValue=%lld",(long long)jumpValue);
fgSendUserData(USR_CMD_PLAY_CTL, USR_CMD_OPTION_FAST_PLAY, (BYTE*)(&jumpValue), sizeof(UInt64));
fgSendUserData(USR_CMD_REMOTLY_PLAY_CTL, USR_CMD_OPTION_FAST_PLAY, (BYTE*)(&jumpValue), sizeof(UInt64));
vSetSupperDrop(TRUE);
}
/**不要快进*/
@@ -612,7 +611,7 @@ void commandSettingInAction(DWORD dwCmd, DWORD dwOption , DWORD * pdwData, DWO
// UInt64 jumpValue =32;
NSLog(@"fastEndValue=%lld",(long long)jumpValue);
fgSendUserData(USR_CMD_PLAY_CTL, USR_CMD_OPTION_FAST_PLAY_CANCEL, (BYTE*)(&jumpValue), sizeof(UInt64));
fgSendUserData(USR_CMD_REMOTLY_PLAY_CTL, USR_CMD_OPTION_FAST_PLAY_CANCEL, (BYTE*)(&jumpValue), sizeof(UInt64));
vSetSupperDrop(TRUE);
}
@@ -944,7 +943,7 @@ void vP2PConnReady(void)
tables[i] = contactId.intValue;
}
}
fgP2PGetFriendsStatus(tables, [contacts count]);
fgGetFriendsStatusFromP2PServer(tables, [contacts count]);
}
//线
@@ -3844,7 +3843,7 @@ void vRecvRemoteMessage(DWORD dwSrcID, unsigned int fgHasCheckdPassword, void
memcpy(sMessage.cString, messageStr, length);
mesg_id++;
fgP2PSendRemoteMessage(contactId.intValue|0x80000000, 0, mesg_id, &sMessage, length+4, sMessage.cString, length, (DWORD)PUSH_MESG_FRIEND);
fgP2PSendRemoteMessage(contactId.intValue|0x80000000, 0, mesg_id, &sMessage, length+4, sMessage.cString, length, (DWORD)PUSH_MESG_TYPE_NORMAL);
return mesg_id;
}
@@ -16,7 +16,7 @@
#import <CommonCrypto/CommonCrypto.h>
#import <AudioToolbox/AudioToolbox.h>
#import <SystemConfiguration/CaptiveNetwork.h>
#import "MD5Manager.h"
#import <GWP2P/MD5Manager.h>
#import "AppDelegate.h"
#import "IfishCameraModel.h"
@implementation Utils
@@ -1,4 +1,4 @@
#ifndef _P2PC_INTERFACE_H_
#ifndef _P2PC_INTERFACE_H_
#define _P2PC_INTERFACE_H_
#ifdef WIN32
@@ -14,39 +14,78 @@
#define KTRUE 1
#define KFALSE 0
#define DWORD unsigned int //32bits
#define WORD unsigned short //16bits
#define BYTE unsigned char //8bits
#define KBOOL unsigned int //32bits
#define UINT64 unsigned long long //64bits
#define KFALSE 0
#define DWORD unsigned int //32bits
#define WORD unsigned short //16bits
#define BYTE unsigned char //8bits
#define KBOOL unsigned int //32bits
#define UINT64 unsigned long long //64bits
enum{
DEV_TYPE_NULL,
DEV_TYPE_SERVER,
DEV_TYPE_NPC,
DEV_TYPE_NPC, // 2
DEV_TYPE_MOBILE,
DEV_TYPE_PC,
DEV_TYPE_DOORBELL,
DEV_TYPE_ALERTOR,
DEV_TYPE_IPC
DEV_TYPE_IPC, // 7
DEV_TYPE_LOCK, //8
DEV_TYPE_WIFI, //9
DEV_TYPE_QQ_IPC, //10
DEV_TYPE_NVR,
};
///dwServerType
enum{
SERVER_TYPE_NULL,
SERVER_TYPE_P2P,
SERVER_TYPE_LIST,
SERVER_TYPE_EMAIL,
SERVER_TYPE_IOS_PUSH,
SERVER_TYPE_INDEX = 9,
SERVER_TYPE_DEV_UPG = 10,
SERVER_TYPE_LOG = 11,
enum
{
IPC_DEV_SUB_TYPE_NORMAL, ////摇头机,全功能
IPC_DEV_SUB_TYPE_SIMPLE, ////卡片机, 不带马达,
IPC_DEV_SUB_TYPE_38X38, ////38板,不带马达,不带人体红外, 不带回音消除
IPC_DEV_SUB_TYPE_DOORBELL,//门铃 ,不带马达,带语音优化
IPC_DEV_SUB_TYPE_COSTDOWN_IPC, //costdown版的摇头机,不带人体红外,不带外部无线传感器. 不带回音消除
IPC_DEV_SUB_TYPE_38_MODULE,
IPC_DEV_SUB_TYPE_NVR_PTZ,//预留
IPC_DEV_SUB_TYPE_NVR_NO_PTZ,//预留
IPC_DEV_SUB_TYPE_SMARTHOME_868,//预留
IPC_DEV_SUB_TYPE_Rsv4,//预留 //9
IPC_DEV_SUB_TYPE_130W_NORMAL, ////摇头机,全功能
IPC_DEV_SUB_TYPE_130W_SIMPLE, ////卡片机, 不带马达,
IPC_DEV_SUB_TYPE_130W_38X38, ////38板,不带马达,不带人体红外, 不带回音消除
IPC_DEV_SUB_TYPE_130W_DOORBELL,//门铃 ,不带马达,带语音优化
IPC_DEV_SUB_TYPE_130W_COSTDOWN_IPC, //costdown版的摇头机,不带人体红外,不带外部无线传感器. 不带回音消除
IPC_DEV_SUB_TYPE_130W_38_MODULE,
IPC_DEV_SUB_TYPE_130W_NVR_PTZ,//预留
IPC_DEV_SUB_TYPE_130W_NVR_NO_PTZ,//预留
IPC_DEV_SUB_TYPE_130W_SMARTHOME_868,//预留
IPC_DEV_SUB_TYPE_130W_Rsv4,//预留 //19
IPC_DEV_SUB_TYPE_200W_NORMAL, ////摇头机,全功能
IPC_DEV_SUB_TYPE_200W_SIMPLE, ////卡片机, 不带马达,
IPC_DEV_SUB_TYPE_200W_38X38, ////38板,不带马达,不带人体红外, 不带回音消除
IPC_DEV_SUB_TYPE_200W_DOORBELL,//门铃 ,不带马达,带语音优化
IPC_DEV_SUB_TYPE_200W_COSTDOWN_IPC, //costdown版的摇头机,不带人体红外,不带外部无线传感器. 不带回音消除
IPC_DEV_SUB_TYPE_200W_38_MODULE,
IPC_DEV_SUB_TYPE_200W_NVR_PTZ,//预留
IPC_DEV_SUB_TYPE_200W_NVR_NO_PTZ,//预留
IPC_DEV_SUB_TYPE_200W_SMARTHOME_868,//预留
IPC_DEV_SUB_TYPE_200W_Rsv4,//预留 //29
IPC_DEV_SUB_TYPE_FISHEYE,//鱼眼
IPC_DEV_SUB_TYPE_SMARTHOME,//868 + 情景模式
IPC_DEV_SUB_TYPE_SMARTHOME_FISHEYE, //
IPC_DEV_SUB_TYPE_SC1135_FISHEYE_360D,
IPC_DEV_SUB_TYPE_SC1135_FISHEYE_180D,
IPC_DEV_SUB_TYPE_SC3035_FISHEYE_360D,
IPC_DEV_SUB_TYPE_SC3035_FISHEYE_180D,
IPC_DEV_SUB_TYPE_MAX
};
#define CONN_TYPE_VIDEO_CALL 0x00
@@ -78,6 +117,7 @@ enum
CALL_ERROR_NOT_SUPPORT,
};
enum
{
MESG_TYPE_GET_SETTING, // 0
@@ -132,10 +172,13 @@ enum
MESG_TYPE_UPG_CREATE_WHOLEFLASH_TO_FILE_RET, // 38
MESG_TYPE_GET_SYS_VERSION, // 39
MESG_TYPE_GET_SYS_VERSION_RET, // 40
LAN_TRANS_SET_INIT_PASSWD = 48, // 48
LAN_TRANS_RET_INIT_PASSWD, // 49
MESG_TYPE_CLEAR_MULTI_CODE, // 41
MESG_TYPE_CLEAR_MULTI_CODE_RET, // 42
MESG_TYPE_CLEAR_FILES, // 43
MESG_TYPE_CLEAR_FILES_RET, // 44
MESG_TYPE_DRBL_ACK_GET = 58,
MESG_TYPE_DRBL_ACK_RET, // 59
@@ -154,6 +197,9 @@ enum
MESG_TYPE_SET_DEFENCE_SWITCH_STATE, //83 设置防区开关
MESG_TYPE_RET_DEFENCE_SWITCH_STATE, //84 设置返回值
MESG_TYPE_UART1_GPIO_CTL, //85
MESG_TYPE_UART1_GPIO_CTL_RET, //86
MESG_TYPE_SET_MOTOR_PRESET_POS = 87, //预置位
MESG_TYPE_RET_MOTOR_PRESET_POS = 88,
@@ -164,16 +210,67 @@ enum
MESG_TYPE_SET_GPIO_CTL = 95,
MESG_TYPE_RET_GPIO_CTL, //值:96
MESG_TYPE_WORKMODE_SETTING =149,
MESG_TYPE_GET_LOWVOLTAGE_STATE, //97
MESG_TYPE_SET_LOWVOLTAGE_STATE, //98
MESG_TYPE_RET_LOWVOLTAGE_STATE, //99
MESG_TYPE_QRCODE_LEARN_CODE =216,
MESG_TYPE_GET_ALARM_CENTER_PARAM, // 100
MESG_TYPE_SET_ALARM_CENTER_PARAM, // 101
MESG_TYPE_RET_ALARM_CENTER_PARAM, //102
MESG_TYPE_CUSTOM_CMD_NO_VERRIFY_SET = 127,
MESG_TYPE_CUSTOM_CMD_NO_VERRIFY_RET, //128
MESG_TYPE_GET_IP_CONFIG,//103
MESG_TYPE_SET_IP_CONFIG,//104
MESG_TYPE_RET_IP_CONFIG,//105
MESG_TYPE_GET_CSC_ATTR,//106
MESG_TYPE_SET_CSC_ATTR,//107
MESG_TYPE_RET_CSC_ATTR,//108
MESG_TYPE_SET_REMOTE_REBOOT,//109
MESG_TYPE_RET_REMOTE_REBOOT,//110
MESG_TYPE_GET_IRLED_STATE,//111
MESG_TYPE_SET_IRLED_STATE,//112
MESG_TYPE_RET_IRLED_STATE,//113
MESG_TYPE_SET_CERINFO, //114
MESG_TYPE_RET_CERINFO, //115
MESG_TYPE_GET_MOTOR_POS, //116
MESG_TYPE_RET_MOTOR_POS, //117
MESG_TYPE_GET_LOG_FILE, // 118
MESG_TYPE_RET_LOG_FILE, //119
MESG_TYPE_DEFENSE_NOTIFY, // 120
MESG_TYPE_GET_ALARM_INFO, // 121
MESG_TYPE_RET_ALARM_INFO, //122
MESG_TYPE_WHITELIST_RET,//123
MESG_TYPE_SET_CUSTOM_CMD, // 124
MESG_TYPE_RET_CUSTOM_CMD, // 125
MEST_TYPE_SET_FOCUS_LENS,//126
MESG_TYPE_CUSTOM_CMD_NO_VERRIFY_SET, // 127
MESG_TYPE_CUSTOM_CMD_NO_VERRIFY_RET, // 128
#ifdef PUSH_SERVER_REMOTE_CONFIG_SUPPORT
MESG_TYPE_SET_PUSH_SERVER_CONFIG_CMD,//129
MESG_TYPE_RET_PUSH_SERVER_CONFIG_CMD,//130
#endif
MESG_TYPE_GET_NVR_INFO = 131,
MESG_TYPE_RET_NVR_INFO,
MESG_TYPE_WORKMODE_SETTING =149, //DSD
//150 till 210 will be use on the smartJack device
MESG_TYPE_GET_DEVICE_LANGUAGE = 211,
MESG_TYPE_SET_DEVICE_LANGUAGE, //212
MESG_TYPE_RET_DEVICE_LANGUAGE, //213
@@ -181,23 +278,178 @@ enum
MESG_TYPE_GET_SCHEDULE_DEFENCE_INFO, //214 获取布撤防
MESG_TYPE_SET_SCHEDULE_DEFENCE_INFO, //215
MESG_TYPE_QRCODE_LEARN_CODE =216,
//MESG_TYPE_QRCODE_LEARN_CODE_RET,//
MESG_TYPE_SEND_UART2_DATA = 218,//
MESG_TYPE_GET_UART2_DATA,//219
MESG_TYPE_GET_MEMBER_LIST=220,
MESG_TYPE_GET_MEMBER_LIST_RET=221,
MESG_TYPE_MAIN_NONEED_PASSPWD=222,
MESG_TYPE_MAIN_NEED_PASSPWD = 223, //223 获取和修改433传感器名字 预置位转动好后截图
MESG_TYPE_SETORGET_LENS_FOCUS_PARAMS = 224, // 自动变焦 获取和设置变焦镜头马达当前位置的命令是一样滴 消息头命令
MESG_TYPE_GET_FTP, // 225
MESG_TYPE_SET_FTP, // 226
MESG_TYPE_RET_FTP, // 227
MESG_TYPE_GET_FISHEYE = 228, //获取当前全景相机配置信息
MESG_TYPE_SET_FISHEYE,//229 设置当前全景相机配置信息
MESG_TYPE_RET_FISHEYE,//230 返回当前全景相机配置信息
MESG_TYPE_EXT_ALARM_INFO =228,//科立信海思方案
MESG_TYPE_SET_AUTO_TEST_MODE=232,
MESG_TYPE_SET_AUTO_TEST_CAPTURE,
MESG_TYPE_TEST_IOS_PUSH,
MESG_TYPE_SET_AUTO_TEST_VOICELINK,//235
MESG_TYPE_SET_AUTO_TEST_STATS_SAVE,// 保存句柄、内存统计信息
MESG_TYPE_RET_RECORD_STATE = 237, //设备当前的录像状态、有没有TF卡
MESG_TYPE_TO_UART2_CMD,//238
MESG_TYPE_SET_VIDEO_CLEAR_LEVEL = 239, /**< 设置录像质量 */
MESG_TYPE_GET_VIDEO_CLEAR_LEVEL = 240, /**< 获取录像质量 */
MESG_TYPE_RET_VIDEO_CLEAR_LEVEL = 241, /**< 录像质量返回 */
MESG_TYPE_GET_IF_WIFI_SETTED = 242,
MESG_TYPE_RET_IF_WIFI_SETTED = 243,
MESG_TYPE_SET_STA_WIFI_INFO = 244, //ap转sta时设置wifi密码
MESG_TYPE_RET_STA_WIFI_INFO = 245,
MESG_TYPE_SET_WELOCK_INFO,//246
MESG_TYPE_GET_WELOCK_INFO,//247
MESG_TYPE_RET_WELOCK_INFO,//248
MESG_TYPE_DEVICE_NOT_SUPPORT_RET = 0XFF,
};
enum{
MESG_SUBTYPE_SETTING_WORKMODE_DEFAULT,//0
MESG_SUBTYPE_SETTING_IPC_WORKMODE, //1
MESG_SUBTYPE_SETTING_IPC_WORKMODE_RET,//2
MESG_SUBTYPE_SETTING_SENSOR_WORKMODE,//3
MESG_SUBTYPE_SETTING_SENSOR_WORKMODE_RET,//4
MESG_SUBTYPE_SETTING_SCHEDULE_WORKMODE,//5
MESG_SUBTYPE_SETTING_SCHEDULE_WORKMODE_RET,//6
MESG_SUBTYPE_DELETE_SCHEDULE,//7
MESG_SUBTYPE_DELETE_SCHEDULE_RET,//8
MESG_SUBTYPE_GET_CURRENTWORKMODE,//9
MESG_SUBTYPE_GET_CURRENTWORKMODE_RET,//10
MESG_SUBTYPE_GET_SENSORWORKMODE,//11
MESG_SUBTYPE_GET_SENSORWORKMODE_RET,//12
MESG_SUBTYPE_GET_WORKMODE_SCHEDULE, //13
MESG_SUBTYPE_GET_WORKMODE_SCHEDULE_RET,//14
MESG_SUBTYPE_SETTING_ALL_SENSOR_SWITCH,//15
MESG_SUBTYPE_SETTING_ALL_SENSOR_SWITCH_RET,//16
MESG_SUBTYPE_GET_ALL_SENSOR_SWITCH,//17
MESG_SUBTYPE_GET_ALL_SENSOR_SWITCH_RET,//18
MESG_SUBTYPE_SET_LOW_VOL_TIMEINTERVAL,//19
MESG_SUBTYPE_SET_LOW_VOL_TIMEINTERVAL_RET,//20
MESG_SUBTYPE_GET_LOW_VOL_TIMEINTERVAL,//21
MESG_SUBTYPE_GET_LOW_VOL_TIMEINTERVAL_RET,//22
MESG_SUBTYPE_DELETE_ONE_CONTROLER,//23
MESG_SUBTYPE_DELETE_ONE_CONTROLER_RET,//24
MESG_SUBTYPE_DELETE_ONE_SENSOR,//25
MESG_SUBTYPE_DELETE_ONE_SENSOR_RET,//26
MESG_SUBTYPE_CHANGE_CONTROLER_NAME,//27
MESG_SUBTYPE_CHANGE_CONTROLER_NAME_RET,//28
MESG_SUBTYPE_CHANGE_SENSOR_NAME,//29
MESG_SUBTYPE_CHANGE_SENSOR_NAME_RET,//30
MESG_SUBTYPE_INTO_LEARN_STATE,//31
MESG_SUBTYPE_INTO_LEARN_STATE_RET,//32
MESG_SUBTYPE_TURN_SENSOR,//33
MESG_SUBTYPE_TURN_SENSOR_RET,//34
MESG_SUBTYPE_SHARE_TO_MEMBER,//35
MESG_SUBTYPE_SHARE_TO_MEMBER_RET,//36
MESG_SUBTYPE_GOT_SHARE_MESG,//37
MESG_SUBTYPE_GOT_SHARE_MESG_RET,//38
MESG_SUBTYPE_DEV_RECV_MEMBER_FEEDBACK,//39
MESG_SUBTYPE_ADMIN_DELETE_ONE_MEMBER,//40
MESG_SUBTYPE_ADMIN_DELETE_ONE_MEMBER_RET,//41
MESG_SUBTYPE_DELETE_DEV,//42
MESG_SUBTYPE_DELETE_DEV_RET,//43
MESG_SUBTYPE_SET_ONE_SPECIAL_ALARM=46, //46
MESG_SUBTYPE_SET_ONE_SPECIAL_ALARM_RET, //47
MESG_SUBTYPE_GET_ALL_SPECIAL_ALARM, //48
MESG_SUBTYPE_GET_ALL_SPECIAL_ALARM_RET, //49
MESG_SUBTYPE_DEAL_LAMP, //50
MESG_SUBTYPE_DEAL_LAMP_RET, //51
MESG_SUBTYPE_KEEPCLIENT, //52
MESG_SUBTYPE_KEEPCLIENT_RET, //53
MESG_SUBTYPE_CONTROL_LED=60,//60 //2016-7-19 设置指示灯led
MESG_SUBTYPE_CONTROL_LED_RET=61, //61
MESG_SUBTYPE_GET_LED_STATU,//62 //2016-7-19 获取指示灯led
MESG_SUBTYPE_GET_LED_STATU_RET,//63
MESG_SUBTYPE_SET_SESOR_PRESET_POS = 64,
MESG_SUBTYPE_SET_SESOR_PRESET_POS_RET,//65
MESG_SUBTYPE_MAX
};
enum{
MESG_SUBTYPE_GET_MONITOR_LOG,//0
MESG_SUBTYPE_GET_MONITOR_LOG_RET,//1
MESG_SUBTYPE_GET_433_SENSOR_NAME,//2 获取433传感器名字
MESG_SUBTYPE_GET_433_SENSOR_NAME_RET,//3
MESG_SUBTYPE_EDIT_433_SENSOR_NAME,//4 修改433传感器名字
MESG_SUBTYPE_EDIT_433_SENSOR_NAME_RET,//5
MESG_SUBTYPE_SETTING_LIGHT_CONTROL,//6
MESG_SUBTYPE_SETTING_LIGHT_CONTROL_RET,//7
MESG_SUBTYPE_GET_LIGHT_CONTROL_SETTING,//8
MESG_SUBTYPE_GET_LIGHT_CONTROL_SETTING_RET,//9
MESG_SUBTYPE_SET_IRCUT_ADCVALUE,//10
MESG_SUBTYPE_SET_IRCUT_ADCVALUE_RET,//11
MESG_SUBTYPE_GET_IRCUT_ADCVALUE,//12
MESG_SUBTYPE_GET_IRCUT_ADCVALUE_RET,//13
MESG_SUBTYPE_SET_MANUAL_GRAY,//14 manual to gray mode
MESG_SUBTYPE_GET_MANUAL_GRAY,//15 manual to gray mode
MESG_SUBTYPE_SET_MANUAL_GRAY_RET,//16
MESG_SUBTYPE_TURNTO_PRESETPOS_OK =17 //17
};
enum{
MESG_SDCARD_DONOT_HAVE_ENOUGH_SPACE=2, //2
MESG_SDCARD_NOT_EXIST, //3
MESG_MONITOR_LOG_FILE_NOT_EXIST,//4
MESG_GET_MONITOR_LOG_NOT_SUPPORT,//5
};
enum
{
OS_ARM_LINUX,
@@ -213,14 +465,15 @@ enum
enum {
PUSH_MESG_SYSTEM,
PUSH_MESG_VERIFY,
PUSH_MESG_FRIEND,
PUSH_MESG_ALARM,
PUSH_MESG_CALL,
PUSH_MESG_DOORBELL
};
enum
{
PUSH_MESG_TYPE_SYSTEM,
PUSH_MESG_TYPE_VERIFY,
PUSH_MESG_TYPE_NORMAL,
PUSH_MESG_TYPE_ALARM,
PUSH_MESG_TYPE_CALLING,
PUSH_MESG_TYPE_BELL,
};
enum
{
@@ -240,6 +493,27 @@ typedef struct sFriendsType
}PACKED sFriendsType;
typedef struct sFriendsTypeV2
{
DWORD dwFriendsCount; //好友总数
BYTE bRequestResult; //请求结果,等于0,则代表请求失败
BYTE bReseve[3];
DWORD dwFriends[MAX_FRIENDS_NS]; //好友ID,注意:实际读取时为dwFriends[dwFriendsCount];
DWORD dwFriendsIdProperty[MAX_FRIENDS_NS]; //好友ID属性,注意:实际读取时为bFriendsIdProperty[dwFriendsCount];
BYTE bStatus[MAX_FRIENDS_NS]; //好友在线状态,注意:实际读取时为bStatus[dwFriendsCount];
BYTE bDevType[MAX_FRIENDS_NS]; //好友帐号大类型,注意:实际读取时为bDevType[dwFriendsCount];
BYTE bSubType[MAX_FRIENDS_NS]; //好友帐号子类型,注意:实际读取时为bSubType[dwFriendsCount];
BYTE bDefenceState[MAX_FRIENDS_NS]; //设备布防状态,注意:实际读取时为bSubType[dwFriendsCount], 0xFF则不支持Index服务器获取,需要从设备端获取此值;
DWORD dwDefenceFlag[MAX_FRIENDS_NS];
}PACKED sFriendsTypeV2;
/*
dwFriendsIdProperty ID属性说明
Bit 0 : 1 0
*/
typedef struct sCallingPrmType
{
KBOOL fgBCalled;
@@ -280,7 +554,10 @@ typedef struct sCallingPrmType
DWORD dwChBufSize[MAX_P2PCH_NS]; // 每个通道的缓存大小,请统一设置为(1024*512)
DWORD dwPassword; //密码,请设为十进制数: 123456
DWORD dwCustomerID[10];
DWORD SessionID1; // App端需要填写此ID,设备端不填
DWORD SessionID2; // App端需要填写此ID,设备端不填
// 被呼叫 时,当有人拨打进来,通过此函数 告知上层。
// 主叫时,拨打已经通了。对方正在响铃,也回调此函数。
// fgBCalled : TRUE 表示 被呼叫, FALSE 表示主叫。
@@ -293,7 +570,8 @@ typedef struct sCallingPrmType
//呼叫被拒绝或者连接断开的回调函数
// fgBCalled : TRUE 表示 被呼叫, FALSE 表示主叫。
// dwErrorOption: 断开的原因,请参见前述枚举。
void (* vRejectSignal )(BOOL fgBCalled, DWORD dwErrorOption);
// dwErrorCode : 断开的错误码,非0时要在UI呈现给用户
void (* vRejectSignal )(BOOL fgBCalled, DWORD dwErrorOption, DWORD dwErrorCode);
//接听回调函数, 当对方接通了或本机接听了来电,通过此函数告知上层。
// fgBCalled : TRUE 表示 被呼叫, FALSE 表示主叫。
@@ -306,19 +584,21 @@ typedef struct sCallingPrmType
void (* vSendMessageAck)(DWORD dwDesID, DWORD dwMesgID, DWORD dwError);
void (* vFriendsStatusUpdate)(sFriendsType * pFriends);
void (*vIndexFriendsStatusUpdate)(sFriendsTypeV2 *pFriends);
#ifdef UPDATE_FLAG_SUPPORT
void (* vFlagUpdate)(DWORD *pdwFlags );
void (* vFlagUpdate)(DWORD *pdwFlags );
#endif
//【远程获取文件结果回调】
//参数-dwDesID: 目标设备ID
//参数-pFilename: 文件名
//参数-dwErrorCode: 错误代码(详情见上枚举)
void (* vGetFileCmdACK)(DWORD dwDesID, char *pFilename, DWORD dwErrorCode);
}sP2PInitPrm;
//【远程获取文件结果回调】
//参数-dwDesID: 目标设备ID
//参数-pFilename: 文件名
//参数-dwErrorCode: 错误代码(详情见上枚举)
void (* vGetFileCmdACK)(DWORD dwDesID, char *pFilename, DWORD dwErrorCode);
void (* LoginInAnotherOne)(DWORD LoginStatus); //APP在别处登录
}sP2PInitPrm;
#ifdef UPDATE_FLAG_SUPPORT
void vP2PSetUpdateFlag(DWORD *pdwFlag);
@@ -335,6 +615,13 @@ enum
KBOOL fgP2PInit(sP2PInitPrm * pPrm); // 网络库初始化
void vP2PExit(void); // 网络库退出并释放资源
/*
DWORD ReLogin(DWORD SessionID1, DWORD SessionID2)
P2P重新登录
0 ; 1 P2P未初始化 ; 2 ;
*/
DWORD ReLogin(DWORD SessionID1, DWORD SessionID2);
KBOOL fgP2PLinkOK(void); // 查看网络库状态.(类似与QQ 是否在线)
@@ -349,8 +636,8 @@ void vP2PHungup(KBOOL fgWaitFinish); // 挂断连接
void vP2PAccept(DWORD *pdwPrm); // 接受呼叫
KBOOL fgP2PSendRemoteMessage(DWORD dwDesID, DWORD dwRemotePW, DWORD dwMesgID, void * pMesg, DWORD dwMesgSize, char * pPushMesg, DWORD dwPushMesgLen, DWORD dwType);
KBOOL fgP2PGetFriendsStatus(DWORD *pFriendsTable, DWORD dwCount);
KBOOL fgGetFriendsStatusFromP2PServer(DWORD *pFriendsTable, DWORD dwCount);
KBOOL fgGetFriendsStatusFromIndexServer(DWORD *pFriendsTable, DWORD dwCount);
//--------------------------------------------
//【获取远程文件】
@@ -414,20 +701,19 @@ typedef struct sAVBlockHeaderType
typedef struct sAVInfoType
{
WORD AudioType: 3; //音频编码格式
WORD AudioCodecOption: 4; //音频编码的参数
WORD AudioMode: 1; // 音频模式: 单声道/双声道
WORD AudioBitWidth: 2; // 音频位宽,目前只支持16bit
WORD AudioSampleRate : 3; // 音频采样率
WORD SampleNumPerFrame : 3; //每帧数据里的采样数
DWORD VideoType: 4; /// 视频类型,目前只支持H264
DWORD VideoWidth: 12; // 视频像素宽度
DWORD VideoHeight: 10; //视频像素高度
DWORD videoFrameRate: 6; // 视频帧率
WORD AudioType: 3; //音频编码格式
WORD AudioCodecOption: 4; //音频编码的参数
WORD AudioMode: 1; // 音频模式: 单声道/双声道
WORD AudioBitWidth: 2; // 音频位宽,目前只支持16bit
WORD AudioSampleRate : 3; // 音频采样率
WORD SampleNumPerFrame : 3; //每帧数据里的采样数
DWORD VideoType: 4; /// 视频类型,目前只支持H264
DWORD VideoWidth: 12; // 视频像素宽度
DWORD VideoHeight: 10; //视频像素高度
DWORD videoFrameRate: 6; // 视频帧率
}PACKED sAVInfoType;
@@ -445,6 +731,7 @@ typedef struct sAVBlockHeader2Type
}PACKED sAVBlockHeader2Type;
/////音频类型
enum
{
@@ -505,13 +792,12 @@ enum
////音频每帧采样数
enum
{
SAMPLE_NUM_80 = 0,
SAMPLE_NUM_160 ,
SAMPLE_NUM_320 ,
SAMPLE_NUM_480 ,
SAMPLE_NUM_1024 ,
SAMPLE_NUM_2048 ,
SAMPLE_NUM_80 = 0,
SAMPLE_NUM_160 ,
SAMPLE_NUM_320 ,
SAMPLE_NUM_480 ,
SAMPLE_NUM_1024 ,
SAMPLE_NUM_2048 ,
};
@@ -532,10 +818,14 @@ enum
USR_CMD_PTZ_CTL, //云台控制
USR_CMD_VIDEO_CTL, // 视频控制
USR_CMD_REMOTLY_DEFENCE_CTL, //
USR_CMD_PLAY_CTL,
USR_CMD_REMOTLY_PLAY_CTL,
USR_CMD_AUDIO_ONLY,
USR_CMD_FM1188_CTL,
USR_CMD_CURRENT_USERS_NS,
USR_CMD_CAR_DIR_CTL, // 车子方向控制
USR_CMD_FILE_INFO,
USER_CMD_FOCALIZE = 0x09,
USR_CMD_RECORD_STATUS,
USR_CMD_MAX_NS,
};
@@ -557,6 +847,9 @@ enum
USR_CMD_OPTION_VIDEO_FAST_FORWARD, // 快进
USR_CMD_OPTION_VIDEO_SLOW_FORWARD, //慢进
USR_CMD_OPTION_VIDEO_STEP, // 单步
USR_CMD_OPTION_VIDEO_LD, //high definition NPC:640*480 IPC:640*360
USR_CMD_OPTION_VIDEO_FL, //low definition NPC:320*240 IPC:320*180
USR_CMD_OPTION_VIDEO_HD, //low definition NPC:None IPC:1280*720
};
//bCommandOption
@@ -678,49 +971,49 @@ BOOL fgGetServerIPAddr(DWORD *pdwIPAddr,WORD *pwPort,const DWORD dwSerType);
#ifdef __cplusplus
class ShapeWarp
{
public:
ShapeWarp();
~ShapeWarp();
//key status
const static int KEY_NONE = -1;
const static int KEY_DOWN = 0;
const static int KEY_UP = 1;
const static int KEY_MOVE = 2;
//animation
const static int ANI_NONE = 0;
const static int ANI_ZOOM_AUTO_IN = 1;
const static int ANI_ZOOM_AUTO_OUT = 2;
const static int ANI_FLING = 3;
const static int ROTE_SLOWLY = 4;
// graph mode
const static int MANUL = 0; //manual
const static int PANORAMA = 1; //panorama
const static int PLAN = 2; //plan
//GestrueMode
const static int GESTRUE_MODE_NONE = -1;
const static int GESTRUE_MODE_FINGER = 0;
const static int GESTRUE_MODE_SENSOR = 1;
//fisheye position
const static int FISHEYE_TOP = 0;
const static int FISHEYE_BOTTOM = 1;
const static int FISHEYE_WALL = 2;
//fisheye type
const static int FISHEYE_360 = 0;
const static int FISHEYE_180 = 1;
// shape type
const static int SHAPE_CIRCLE = 0;
const static int SHAPE_180_HALF_SPHERE = 1;
const static int SHAPE_CYLIDER = 2;
const static int SHAPE_BOWLE = 3;
ShapeWarp();
~ShapeWarp();
//key status
const static int KEY_NONE = -1;
const static int KEY_DOWN = 0;
const static int KEY_UP = 1;
const static int KEY_MOVE = 2;
//animation
const static int ANI_NONE = 0;
const static int ANI_ZOOM_AUTO_IN = 1;
const static int ANI_ZOOM_AUTO_OUT = 2;
const static int ANI_FLING = 3;
const static int ROTE_SLOWLY = 4;
// graph mode
const static int MANUL = 0; //manual
const static int PANORAMA = 1; //panorama
const static int PLAN = 2; //plan
//GestrueMode
const static int GESTRUE_MODE_NONE = -1;
const static int GESTRUE_MODE_FINGER = 0;
const static int GESTRUE_MODE_SENSOR = 1;
//fisheye position
const static int FISHEYE_TOP = 0;
const static int FISHEYE_BOTTOM = 1;
const static int FISHEYE_WALL = 2;
//fisheye type
const static int FISHEYE_360 = 0;
const static int FISHEYE_180 = 1;
// shape type
const static int SHAPE_CIRCLE = 0;
const static int SHAPE_180_HALF_SPHERE = 1;
const static int SHAPE_CYLIDER = 2;
const static int SHAPE_BOWLE = 3;
const static int SHAPE_QUAD = 4;
typedef void (*ShapeNotify)(int MsgType, int MsgAction);
@@ -867,4 +1160,25 @@ public:
#endif
//return bytes per second
DWORD dwGetAvBytesPerSec();
/*
BYTE bMainVersion = (wValue >> 8) & 0xff
BYTE bSubVersion = wValue & 0xff
*/
WORD wGetSDKVersion();
#define LINK_OK 0 //link success
#define LINK_ERROR_NONE 0x20104001 //no error, opertion is running.
#define LINK_DNS_PARSE_FAILED 0x20104002 //parse DNS failed
#define LINK_CHECK_LISTSERVER_RESPONSE_FAILED 0x20104003 //response from ListServer is invalidate
#define LINK_GET_SERVERLIST_TIMEOUT 0x20104004 //get servers form ListServer timeout
#define LINK_GET_P2PSERVER_HEARTBEAT_RESPONSE_FAILED 0x20104005 //wait heart beat from P2PServer failed
#define LINK_LOGIN_ANOTHER_MACHINE 0x20104006 // login with another App Or Pc
unsigned int iP2PLinkStatus();
#endif //_P2PC_INTERFACE_H
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
//
// SelectDeviceViewController.h
// Ifish
//
// Created by imac on 16/6/27.
// Copyright © 2016年 lianxiang. All rights reserved.
//
#import "BaseViewController.h"
@interface SelectDeviceViewController : BaseViewController
@end
@@ -1,178 +0,0 @@
//
// SelectDeviceViewController.m
// Ifish
//
// Created by imac on 16/6/27.
// Copyright © 2016 lianxiang. All rights reserved.
//
#import "SelectDeviceViewController.h"
#import "FirstConnectWifiController.h"
#import "LeftViewController.h"
#import "ICSDrawerController.h"
#import "YooseConnectFirstViewController.h"
#import "IfishMianTabViewController.h"
@interface SelectDeviceViewController ()
@property(nonatomic,strong)ICSDrawerController*ics;
@end
extern BOOL formLogIn;//
extern BOOL isfromCameraView;
@implementation SelectDeviceViewController
- (void)viewDidLoad {
[super viewDidLoad];
//
isfromCameraView = NO;
[self initUI];
self.view.backgroundColor = COLOR_MIAN;
[self addTitleViewWithTitle:@"选择设备"];
// UIButton*rightButton = [[UIButton alloc]initWithFrame:CGRectMake(25,0,60,60)];
// [rightButton setTitle:@"跳过" forState:UIControlStateNormal];
// rightButton.backgroundColor=[UIColor clearColor];
// [rightButton addTarget:self action:@selector(passClick:) forControlEvents:UIControlEventTouchUpInside];
// UIImageView*imageView=[[UIImageView alloc]initWithFrame:CGRectMake(25,0,60,60)];
// [imageView addSubview:rightButton];
// imageView.userInteractionEnabled=YES;
// UIBarButtonItem*rightItem = [[UIBarButtonItem alloc]initWithCustomView:imageView];
// self.navigationItem.rightBarButtonItem = rightItem;
// if (formLogIn==YES) {//
// formLogIn=NO;
// rightButton.hidden=NO;
//
// self.bakbutton.hidden=YES;
// }else if (formLogIn==NO){
//
// rightButton.hidden=YES;
// self.bakbutton.hidden=NO;
//
// }
// Do any additional setup after loading the view.
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
self.navigationItem.backBarButtonItem = item;
}
#pragma mark - 暂时跳过
-(void)passClick:(UIButton*)btn{
IfishMianTabViewController *mianVC=[[IfishMianTabViewController alloc] init];
[UIApplication sharedApplication].delegate.window.rootViewController=mianVC;
}
-(void)initUI{
CGFloat BarHeit = 64;
CGFloat botomSpace = 44;
CGFloat spaceH = 50;
UILabel *bindLabel=[[UILabel alloc] initWithFrame:CGRectMake(0,BarHeit + 50, kScreenSize.width, 30)];
bindLabel.textColor = [UIColor whiteColor];
bindLabel.textAlignment = NSTextAlignmentCenter;
bindLabel.text = @"请选择您要绑定的设备类型";
[self.view addSubview:bindLabel];
CGFloat btnWid= (kScreenSize.height - 64 - botomSpace - 4*spaceH -30)/2 ;
UIButton *tankBtn=[UIButton buttonWithType:UIButtonTypeCustom];
tankBtn.frame =CGRectMake(kScreenSize.width/2 - btnWid/2, CGRectGetMaxY(bindLabel.frame) + spaceH, btnWid, btnWid);
[tankBtn setBackgroundImage:[UIImage imageNamed:@"ifish_tank_logo"] forState:UIControlStateNormal];
[tankBtn addTarget:self action:@selector(tankBtn:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:tankBtn];
UIButton *yooseeBtn=[UIButton buttonWithType:UIButtonTypeCustom];
yooseeBtn.frame =CGRectMake(kScreenSize.width/2 - btnWid/2, CGRectGetMaxY(tankBtn.frame) + spaceH, btnWid, btnWid);
[yooseeBtn setBackgroundImage:[UIImage imageNamed:@"ifish_yoosee_logo"] forState:UIControlStateNormal];
[yooseeBtn addTarget:self action:@selector(yooseeBtn:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:yooseeBtn];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)tankBtn:(UIButton*)btn{
NSArray * deviceArr =[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
if ([deviceArr count]>=5) {
[self.view makeToast:@"设备已达上线限"];
return;
}
self.hidesBottomBarWhenPushed = YES;
FirstConnectWifiController *first = [[FirstConnectWifiController alloc] init];
[self.navigationController pushViewController:first animated:YES];
}
-(void)yooseeBtn:(UIButton*)btn{
NSArray * cameraArr =[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"];
if ([cameraArr count]>=5) {
[self.view makeToast:@"设备已达上线限"];
return;
}
self.hidesBottomBarWhenPushed = YES;
YooseConnectFirstViewController *fistVC=[[YooseConnectFirstViewController alloc] init];
[self.navigationController pushViewController:fistVC animated:YES];
}
-(void)viewWillAppear:(BOOL)animated{
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -86,21 +86,9 @@
self.navigationItem.titleView=labe;
self.navigationItem.hidesBackButton=YES;
//
// UIButton*rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
// rightButton.frame = CGRectMake(25, 0, 60, 60);
// rightButton.backgroundColor = [UIColor redColor];
// [rightButton setTitle:@"注册" forState:UIControlStateNormal];
// [rightButton addTarget:self action:@selector(backItemBtn) forControlEvents:UIControlEventTouchUpInside];
// UIImageView*imageView=[[UIImageView alloc]initWithFrame:CGRectMake(25,0,60,60)];
// [imageView addSubview:rightButton];
// imageView.userInteractionEnabled=YES;
// UIBarButtonItem*rightItem = [[UIBarButtonItem alloc]initWithCustomView:imageView];
UIBarButtonItem*rightItem= [[UIBarButtonItem alloc] initWithTitle:@"注册" style:UIBarButtonItemStyleDone target:self action:@selector(backItemBtn)];
// rightItem.tintColor=[UIColor whiteColor];
// [rightItem setTintColor:[UIColor whiteColor]];
self.navigationItem.rightBarButtonItem= rightItem;
[self.navigationItem.rightBarButtonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:14],UITextAttributeFont, [UIColor whiteColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];
@@ -127,11 +115,7 @@
#pragma mark 定位
-(void)getLocation{
//BMKLocationService
// _locService=[[BMKLocationService alloc]init];
// _locService.delegate=self;
// //LocationService
// [_locService startUserLocationService];
// _geocodesearch=[[BMKGeoCodeSearch alloc]init];
if ([CLLocationManager locationServicesEnabled]) {
_locationManager = [[CLLocationManager alloc]init];
_locationManager.delegate = self;