V4.9.9测试版第一次提交 构建版本9.9.1

This commit is contained in:
wbzhan
2019-07-12 14:09:23 +08:00
parent 8693efe121
commit 33254ad734
54 changed files with 1019 additions and 3719 deletions
@@ -21,7 +21,7 @@
@param errorString 描述具体的错误原因
@param json 具体的返回数据
*/
typedef void(^GWNetCompletionBlock)(BOOL success, NSString *errorCode, NSString *errorString, NSDictionary *json);
typedef void(^GWNetCompletionBlock)(BOOL success, NSString *errorCode, NSString *errorString, NSDictionary<NSString*,id> *json);
//调接口时会话ID错误发出的通知,会话ID超时/错误时所有接口无法调用,应该让用户重新登录获取新的Session。每个接口处理过于麻烦,所以增加通知。
extern NSString * const kGWNetSessionIdErrorNotification;
@@ -154,7 +154,6 @@ extern NSString * const kGWNetSessionIdErrorNotification;
withUserId:(NSString *)userId
sessionId:(NSString *)sessionId
completion:(GWNetCompletionBlock)completion;
#pragma mark 退出登录
/**
退出登录
@@ -40,7 +40,7 @@
#define GWNET_RET_PHONE_FORMAT_ERROR @"10901022" //手机号数据格式不符合要求
#define GWNET_RET_LACK_PARAMETER_ERROR @"10901020" //缺少输入参数
#define GWNET_RET_GET_EMAIL_CODE_TOO_OFTEN @"10902027" //获取邮件太频繁
#define GWNET_RET_GET_EMAIL_CODE_COUNT_LIMIT @"10902028" //获取邮件已到达30分钟内的上限
#define GWNET_RET_GET_EMAIL_CODE_COUNT_LIMIT @"10902028" //邮件验证码超时
#define GWNET_RET_EMAIL_CODE_ERROR @"10902029" //邮件验证码不正确
#define GWNET_RET_EMAIL_CODE_TIMEOUT @"10902030" //邮件验证码超时
@@ -24,6 +24,7 @@
#import "GWP2PClient+GarageLight.h"
#import "GWP2PClient+HXVision.h"
#import "GWP2PDefine.h"
#import "GWP2PClient+P2PInfo.h"
//监控、视频通话、回放
@@ -58,5 +58,10 @@
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)setDeviceWifiPassword:(NSString *)wifiPassword inAPModeWithCompletionBlock:(CompletionBlock)completionBlock;
/**
设置设备列表将设备版本号传给sdk
@param deviceAry 设备数组[@{@"deviceID":.@"p2p version of device",}]
*/
-(void)p2pSetDevieAry:(NSArray *)deviceAry;
@end
@@ -91,6 +91,45 @@ typedef enum GWUnbindAlarmAccountOperationType {
devicePassword:(NSString *)devicePassword
completionBlock:(CompletionBlock)completionBlock;
/**
设置设备报警声开关状态
获取设备报警声开关状态请调 getMultipledeviceStatusWithDeviceID:password:completionBlock:
@param alarmOn 开关状0关,1开
@param deviceID 设备ID
@param devicePassword 设备密码
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)setDeviceSpecialAlarmState:(NSUInteger)alarmOn
withDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
completionBlock:(CompletionBlock)completionBlock;
/**
设置设备报警白光灯状态
获取设备备报警白光灯状态请调 getMultipledeviceStatusWithDeviceID:password:completionBlock:
@param alarmOn 开关状0关,1开
@param deviceID 设备ID
@param devicePassword 设备密码
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)setDeviceWhiteAlarmLightState:(NSUInteger)alarmOn
withDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
completionBlock:(CompletionBlock)completionBlock;
/**
设置设备红蓝灯开关状态
获取设备红蓝灯开关状态请调 getMultipledeviceStatusWithDeviceID:password:completionBlock:
@param alarmOn 开关状0关,1开
@param deviceID 设备ID
@param devicePassword 设备密码
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)setDeviceRedBluelAlarmLightState:(NSUInteger)alarmOn
withDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
completionBlock:(CompletionBlock)completionBlock;
/**
设置设备人体红外开关状态
@@ -93,7 +93,7 @@ typedef NS_ENUM(NSUInteger, GWDeviceRTSPPasswordMode) {
@"type" (设备主类型): GWDeviceType 类型,(如IPC、NPC...) (设备返回的主类型不准)
@"subtype" (设备子类型): GWDeviceSubtype 类型,(如30只支持86831支持868+情景模式;32支持868+情景模式+分享)
@"device subtype" (设备子类型): GWDeviceSubtype 类型,(如30只支持86831支持868+情景模式;32支持868+情景模式+分享)
@"preset position suppurted" (是否支持预置位): @(BOOL) NO 不支持; YES 支持
@@ -456,6 +456,39 @@ typedef NS_ENUM(NSUInteger, GWDeviceRTSPPasswordMode) {
- (void)getDeviceResolutionAndIpAndMacAddressWithDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
completionBlock:(CompletionBlock)completionBlock;
#pragma mark - 获取设备DNS,网关,子网,ip
/**
获取设备获取设备DNS,网关,子网,ip
@param deviceID 设备ID
@param devicePassword 设备密码
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)getDeviceDNSAndIpAndGetWayAndSubNetMaskWithDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
completionBlock:(CompletionBlock)completionBlock;
#pragma mark - 设置设备DNS,网关,子网,ip
/**
设置设备DNS,网关,子网,ip
@param deviceID 设备ID
@param devicePassword 设备密码
@param isAuto 0为静态,1为动态,为动态时后面的参数都为无效
@param dNS 设置静态 DNS 值时填255.255.255.255 .动态时填 0
@param IP 设置静态 ip 值时填192.168.1.1。动态时填 0
@param subNetMask 设置静态子网掩码值时填255.255.255.0 动态时填 0
@param getWay 设置静态网关值时填。动态时填255.255.255.255 动态时填 0
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)setDeviceDNSAndIpAndGetWayAndSubNetMaskWithDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
isAuto:(NSInteger)isAuto
deviceDNS:(NSString*)dNS
deviceIP:(NSString*)IP
deviceSubNetMask:(NSString*)subNetMask
deviceGetWay:(NSString *)getWay
completionBlock:(CompletionBlock)completionBlock;
#pragma mark - 获取用户及设备列表在线状态等信息
/**
@@ -10,6 +10,7 @@
#import <Foundation/Foundation.h>
#import "GWP2PPlayerDefine.h"
#import <UIKit/UIKit.h>
/**
操作预置位方式
*/
@@ -44,5 +45,7 @@ typedef enum GWHXVisonPreseSubcmdType {
devicePassword:(NSString *)devicePassword
point:(CGPoint)point
size:(CGSize)size;
- (void)sendHXCommandTypeandOption:(int)option;
- (void)sendHXCommandTypeandOption:(GWP2PHXVisonDirection)direction;
@end
@@ -0,0 +1,17 @@
//
// GWP2PClient+P2PInfo.h
// GWP2P
//
// Created by yuguihua on 2019/6/10.
// Copyright © 2019 apple. All rights reserved.
//
#import <GWP2P/GWP2P.h>
NS_ASSUME_NONNULL_BEGIN
@interface GWP2PClient (P2PInfo)
-(NSString *)getP2PVersion;
@end
NS_ASSUME_NONNULL_END
@@ -16,7 +16,14 @@ typedef enum GWP2PRecordType{
GWP2PRecordTypeAlarm,/**< 报警时录像 */
GWP2PRecordTypeSchedule,/**< 定时录像 */
}GWP2PRecordType;
/**
云录像质量
*/
typedef enum GWP2PCloudRecordType{
GWP2PRecordTypeQuilty = 0,/**< 质量优先 */
GWP2PRecordTypeSmooth = 1,/**< 流畅优先 */
}GWP2PCloudRecordType;
/**
录像质量
*/
@@ -45,6 +52,9 @@ typedef enum GWP2PRecordDefinition {
@property (nonatomic, strong) NSDate *date;/**< 记录上面的时间 */
@property (nonatomic, assign) NSInteger totalSec;/**< 记录上面的时间 */
@property (nonatomic, assign) NSInteger totalEndSec;/**< 记录上面的时间结束为totalsec + time */
@property (nonatomic, copy) NSString *cType; /**< 文件类型 一个字符 */
@property (nonatomic, assign) NSInteger time; /**< 文件播放时长 若不支持,则为-1 */
@@ -222,5 +232,36 @@ typedef enum GWP2PRecordDefinition {
startDate:(NSDate *)startDate
endDate:(NSDate *)endDate
completionBlock:(CompletionBlock)completionBlock;
#pragma mark - 获取某一天的回放文件
/**
获取设备回放文件
一次只能获取64个文件,如果给定的时间差大于64个文件,会分多次获取,一次返回多次获取文件,为保证每次数据都能正常返回,若无特殊要求,两次给定的时间差尽量小点
completionBlock返回字典:
@"files" 键对应一个 NSMutableArray<GWPlaybackFileModel *> *
@param deviceID 设备ID
@param devicePassword 设备密码
@param dayDate 当天日期,如果传空返回当天日期的回放列表
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)getDeviceOneDayPlaybackFilesOWithDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
dayDate:(NSDate *)dayDate
completionBlock:(CompletionBlock)completionBlock;
/**
设置设备云回放上传的质量
@param recordType 设置类型。质量优先与流畅优先
@param deviceID 设备ID
@param devicePassword 设备密码
@param completionBlock 与设备交互完成后的回调Block
*/
- (void)setDeviceCloudPlayBackQuality:(GWP2PCloudRecordType)recordType
WithDeviceID:(NSString *)deviceID
devicePassword:(NSString *)devicePassword
completionBlock:(CompletionBlock)completionBlock;
@end
@@ -72,6 +72,15 @@ typedef NS_ENUM(uint8_t, GWProtectionSettingState) {
GWProtectionSettingStateOn = 1, /**< 状态开 */
GWProtectionSettingStateOff, /**< 状态关 */
};
/**
各传感器的防护设置状态
*/
typedef NS_ENUM(uint8_t, GWProtectionSettingBodyState) {
GWProtectionSettingBodyStateNotSurpport = 0, /**< 设备不支持 */
GWProtectionSettingBodyStateOn = 3, /**< 状态开 */
GWProtectionSettingBodyStateOnlyBodyOff =7, /**< 状态关 */
};
/**
@@ -89,6 +98,7 @@ typedef NS_ENUM(uint8_t, GWProtectionSettingState) {
@property (nonatomic, assign) GWProtectionSettingState externalAlarmInputState; /**< 外部报警输入 */
@property (nonatomic, assign) GWProtectionSettingState externalAlarmOutputState; /**< 外部报警输出 */
@property (nonatomic, assign) GWProtectionSettingState externalSensorState; /**< 外部传感器 */
@property (nonatomic, assign) GWProtectionSettingBodyState body_detect; /**< 人体侦测 &1 bit 0 表示不支持 1 支持 &4 bit 3 0表示仅人形 1表示物件跟人形都支持 人形侦测 0不支持 3打开 7关闭*/
@end
@@ -128,6 +128,7 @@
@property (nonatomic, weak) id<GWP2PClientProtocol> delegate;/**< GWP2PClient的代理,一些设备事件的通知对象 */
@property (nonatomic, assign) BOOL isAPMode;/**< 是不是AP模式。此属性只保存上次与路由器交互后的数据,调 getDeviceIDInAPMode 方法会重新与路由器交互更新APMode状态,每次app进入前台时会更新APMode状态 */
@property (nonatomic, assign) NSInteger port;/**< 广播端口 */
@property (nonatomic, copy) NSString *serverList; /**< P2P服务器列表,自建服务器需要设置此属性,格式"|p2p1.cloudlinks.cn|p2p2.cloudlinks.cn|p2p3.cloud-links.net" */
@@ -219,5 +220,4 @@
data:(NSData *)data
completionBlock:(CompletionBlock)completionBlock;
@end
@@ -140,4 +140,23 @@ typedef NS_ENUM(NSUInteger, GWSensorAlarmType) {
};
/**
发送设备指令后返回的错误类型
*/
typedef NS_ENUM(NSInteger, P2PCloudPlayBackError) {
P2PCloudPlayBackErrorNone = 0, /**< 没有错误 */
P2PCloudPlayBackErrorForbidden = -1011, /**< 鉴权过期禁止访问 */
P2PCloudPlayBackErrorNoPermission = 10903001 , /**<//没有回放权限 */
P2PCloudPlayBackErrorNoPlayback = 10908103, /**< 没有回放视频 */
P2PCloudPlayBackErrorLoginError =10903007 , /**< 登录错误 */
P2PCloudPlayBackErrorMessageIsSending = 9996, /**< 当前请求正在进行 */
P2PCloudPlayBackErrorUnKnow = 9999 /**< 未知错误,返回结果一般不会描述错误原因 */
};
//extern void *gwdebug;
extern void (*gwdebug)(NSInteger level, NSString *file, NSString *func, NSInteger line, NSString *msg);
#endif /* GWP2PDefine_h */
@@ -45,7 +45,7 @@ typedef NS_ENUM(NSUInteger, GWP2PDeviceIPCSubtype) {
GWP2PDeviceIPCSubtype38X38, //38板,不带马达,不带人体红外,不带回音消除
GWP2PDeviceIPCSubtypeDoorbell, //门铃,不带马达,带语音优化
GWP2PDeviceIPCSubtypeCostdown, //costdown版的摇头机,不带人体红外,不带外部无线传感器. 不带回音消除
GWP2PDeviceIPCSubtype38Module,
GWP2PDeviceIPCSubtype38Module, //不带马达
GWP2PDeviceIPCSubtypeNvrPtz = 6, //预留
GWP2PDeviceIPCSubtypeNvrNoPtz, //预留
@@ -57,7 +57,7 @@ typedef NS_ENUM(NSUInteger, GWP2PDeviceIPCSubtype) {
GWP2PDeviceIPCSubtype130w38X38, //130w,38板,不带马达,不带人体红外,不带回音消除
GWP2PDeviceIPCSubtype130wDoorbell, //130w,门铃,不带马达,带语音优化
GWP2PDeviceIPCSubtype130wCostdown, //130w,costdown版的摇头机,不带人体红外,不带外部无线传感器. 不带回音消除
GWP2PDeviceIPCSubtype130w38Module,
GWP2PDeviceIPCSubtype130w38Module, //不带马达
GWP2PDeviceIPCSubtype130wNvrPtz = 16, //预留
GWP2PDeviceIPCSubtype130wNvrNoPtz, //预留
@@ -69,7 +69,7 @@ typedef NS_ENUM(NSUInteger, GWP2PDeviceIPCSubtype) {
GWP2PDeviceIPCSubtype200w38X38, //200w,38板,不带马达,不带人体红外,不带回音消除
GWP2PDeviceIPCSubtype200wDoorbell, //200w,门铃,不带马达,带语音优化
GWP2PDeviceIPCSubtype200wCostdown, //200w,costdown版的摇头机,不带人体红外,不带外部无线传感器. 不带回音消除
GWP2PDeviceIPCSubtype200w38Module,
GWP2PDeviceIPCSubtype200w38Module, //不带马达
GWP2PDeviceIPCSubtype200wNvrPtz = 26, //预留
GWP2PDeviceIPCSubtype200wNvrNoPtz, //预留
@@ -68,9 +68,9 @@ typedef void (^DeviceReceiveBlock)(NSString *deviceId, BOOL isSupport);
/**
刷新局域网设备。lanDevices每30刷新,调用此方法马上发送一次刷新指令。
强制刷新局域网设备
*/
- (void)refreshLanDevices;
- (void)forceScanLanDevices;
@@ -28,6 +28,9 @@
/** 回放的状态 */
@property (nonatomic, readonly) GWP2PPlaybackState playbackState;
/** 播放倍速 */
@property (nonatomic, assign) GWPlaybackSpeed speed;
/**
播放设备远程录像文件,原理和监控设备是一样的,需要先呼叫连接设备
@@ -60,6 +63,10 @@
*/
- (void)p2pPauseOrResume;
/**
暂停
*/
- (void)p2pPause;
/**
快进或者取消快进
@@ -66,7 +66,7 @@ typedef void (^ScreenshotCompletionBlock)(UIImage *screenshot, NSTimeInterval ti
@param gesture 手势
*/
- (void)p2pPlayer:(GWP2PPlayer *)player recieveGestureRecognizer:(UIGestureRecognizer *)gesture;
- (BOOL)p2pPlayer:(GWP2PPlayer *)player shouldHandlerSwipeGesture:(UIGestureRecognizer *)gesture;
/**
@@ -45,6 +45,11 @@ typedef NS_ENUM(NSUInteger, GWP2PPlaybackState) { //回放状态
GWP2PPlaybackStateStop //停止
};
typedef NS_ENUM(NSUInteger, GWPlaybackSpeed) { //回放倍速
GWPlaybackSpeedNormal,
GWPlaybackSpeedFastForward
};
/**
呼叫失败的错误枚举
@@ -65,6 +70,8 @@ typedef NS_ENUM(NSUInteger, GWP2PCallError) {
GWP2PCallErrorPwdWrong, //12密码错误(在远程监控时用到密码,在视频通话是不需要)
GWP2PCallErrorConnFail,
GWP2PCallErrorNotSupport,
GWP2PCallErrorNotPermissions, //15无监控权限
};
/**
@@ -146,26 +153,28 @@ typedef NS_ENUM(NSUInteger, GWP2PPlaybackControl) {
GWP2PPlaybackControlPlay, //播放
GWP2PPlaybackControlPause, //暂停
GWP2PPlaybackControlStop, //停止
GWP2PPlaybackControlFileEnd, //文件播放完毕
GWP2PPlaybackControlFileEnd, //文件读取完毕,但不等于播放完毕
GWP2PPlaybackControlFastForward, //快进
GWP2PPlaybackControlFastForwardCancel, //取消快进
GWP2PPlaybackControlNextFile, //切换文件播放
GWP2PPlaybackControlSeekTime, //指定时间播放
};
/**
汇讯视通控制镜头
*/
typedef NS_ENUM(NSUInteger, GWP2PHXVisonDirection) {
GWP2PHXVisonDirectionLeft = 0, //左
GWP2PHXVisonDirectionRight, //右
GWP2PHXVisonDirectionUp, //上
GWP2PHXVisonDirectionDown, //下
GWP2PHXVisonDirectionShort, //缩小
GWP2PHXVisonDirectionLong, //放大
GWP2PHXVisonDirectionStop, //停止
GWP2PHXVisonDirectionLeft = 0, //左,保持移动
GWP2PHXVisonDirectionRight, //右,保持移动
GWP2PHXVisonDirectionUp, //上,保持移动
GWP2PHXVisonDirectionDown, //下,保持移动
GWP2PHXVisonDirectionZoomOut, //缩小
GWP2PHXVisonDirectionZoomIn, //放大
GWP2PHXVisonDirectionStop, //停止,停止移动
};
/**
汇讯视通3D手势
*/
@@ -19,6 +19,11 @@
*/
extern NSString * const kGWP2PDeviceIsCallingNotification;
/**
NPC设备主动拒绝的通知
*/
extern NSString * const kGWP2PDeviceIsRejectNotification;
/**
@brief GWP2PVideoPlayerProtocol协议包含监控时的设备状态信息的回调,按需要选择性实现
@@ -98,7 +103,8 @@ extern NSString * const kGWP2PDeviceIsCallingNotification;
calling:(P2PCallingBlock)callingBlock
accept:(P2PAcceptBlock)acceptBlock
reject:(P2PRejectBlock)rejectBlock
ready:(P2PReadyBlock)readyBlock;
ready:(P2PReadyBlock)readyBlock
allowLAN:(BOOL)allowLAN;
/**
呼叫一个NPC设备,进行视频对讲,目前只有NPC一种设备存在对讲视频对讲功能,所以不需要设备类型等参数
@@ -33,9 +33,9 @@ szPassword: 130位字符串
szUserID:登陆账号关联的ID
szOutputBuffer:用于保存明文的缓存,由用户提供
iLength:用于保存明文的缓存的长度
返回值:0-成功 1-因输出缓存太小而执行失败
返回值:YES成功 NO因输出缓存太小而执行失败
*/
+(unsigned int)PassswrodDecrypt:(char*)szSrcData UserID:(char*)szUserID Dst:(char*)szOutputBuffer Len:(unsigned int)iLength;
+(BOOL)PassswrodDecrypt:(char*)szSrcData UserID:(char*)szUserID Dst:(char*)szOutputBuffer Len:(unsigned int)iLength;
/*
函数功能:服务器保存的设备密码的加密函数(应用场景:上传设备列表到服务器)
@@ -43,9 +43,9 @@ szPassword: 130位字符串
szUserID:登陆账号关联的ID
szOutputBuffer:用于保存密文的缓存,由用户提供
iLength:用于保存密文的缓存的长度
返回值:0-成功 1-因输出缓存太小而执行失败
返回值:YES成功 NO因输出缓存太小而执行失败
*/
+(unsigned int)PasswordEncrypt:(char*)szSrcData UserID:(char*)szUserID Dst:(char*)szOutputBuffer Len:(unsigned int)iLength;
+(BOOL)PasswordEncrypt:(char*)szSrcData UserID:(char*)szUserID Dst:(char*)szOutputBuffer Len:(unsigned int)iLength;
/*
函数功能:base64解密,扫描二维码用到。