此类为EZOpenSDK接口类 特别说明:110001(参数错误)、110002(AccessToken过期)、149999、150000(服务端异常)是所有http接口(返回值是NSOperation对象的大部分是http接口)都会返回的通用错误码,400002为接口参数错误的通用错误码 更多...
#import <EZOpenSDK.h>
此类为EZOpenSDK接口类 特别说明:110001(参数错误)、110002(AccessToken过期)、149999、150000(服务端异常)是所有http接口(返回值是NSOperation对象的大部分是http接口)都会返回的通用错误码,400002为接口参数错误的通用错误码
+ (NSOperation *) addDevice: | (NSString *) | deviceSerial | |
verifyCode: | (NSString *) | verifyCode | |
completion: | (void(^)(NSError *error)) | completion | |
deviceSerial | 设备序列号 |
verifyCode | 设备验证码 |
completion | 回调block,error为空时表示添加成功 |
+ (NSOperation *) captureCamera: | (NSString *) | deviceSerial | |
cameraNo: | (NSInteger) | cameraNo | |
completion: | (void(^)(NSString *url, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
cameraNo | 通道号 |
completion | 回调block,正常时返回url地址信息,错误时返回错误码 |
+ (void) clearStreamInfoCache |
清除取流时的缓存数据
+ (NSOperation *) controlPTZ: | (NSString *) | deviceSerial | |
cameraNo: | (NSInteger) | cameraNo | |
command: | (EZPTZCommand) | command | |
action: | (EZPTZAction) | action | |
speed: | (NSInteger) | speed | |
result: | (void(^)(NSError *error)) | resultBlock | |
deviceSerial | 设备序列号 |
cameraNo | 通道号 |
command | ptz控制命令 |
action | 控制启动/停止 |
speed | 云台速度:0-慢,1-适中,2-快 |
resultBlock | 回调block,当error为空时表示操作成功 |
+ (void) controlVideoFlip: | (NSString *) | deviceSerial | |
cameraNo: | (NSInteger) | cameraNo | |
command: | (EZDisplayCommand) | command | |
result: | (void(^)(NSError *error)) | resultBlock | |
deviceSerial | 设备序列号 |
cameraNo | 通道号 |
command | 显示控制命令 |
resultBlock | 回调block,当error为空时表示操作成功 |
+ (EZPlayer *) createPlayerWithDeviceSerial: | (NSString *) | deviceSerial | |
cameraNo: | (NSInteger) | cameraNo | |
deviceSerial | 设备序列号 |
cameraNo | 通道号 |
+ (EZPlayer *) createPlayerWithUrl: | (NSString *) | url |
url | 播放url,目前只支持该协议:ysproto://vtm.ys7.com:8554/live?dev=531993276&chn=1&stream=1&cln=1&isp=0&biz=3 |
+ (NSData *) decryptData: | (NSData *) | data | |
verifyCode: | (NSString *) | verifyCode | |
data | 需要解密的数据 |
verifyCode | 设备验证码 |
+ (NSOperation *) deleteAlarm: | (NSArray *) | alarmIds | |
completion: | (void(^)(NSError *error)) | completion | |
alarmIds | 告警信息Id数组(可以只有一个Id),最多为10个Id,否则会报错 |
completion | 回调block,error为空时表示删除成功 |
+ (NSOperation *) deleteDevice: | (NSString *) | deviceSerial | |
completion: | (void(^)(NSError *error)) | completion | |
deviceSerial | 设备序列号 |
completion | 回调block,error为空时表示删除成功 |
+ (NSOperation *) deleteLeaveMessage: | (NSArray *) | leaveIds | |
completion: | (void(^)(NSError *error)) | completion | |
leaveIds | 留言消息Id数组(最大数量为10,允许只有1个) |
completion | 回调block,error为空表示删除成功 |
+ (BOOL) destoryLib |
+ (void) enableP2P: | (BOOL) | enable |
enable | p2p是否开启 |
+ (BOOL) ezvizLoginWithAppType: | (EZAppType) | appType |
跳转到指定萤石APP进行授权登录
appType | 萤石APP类型 |
+ (NSOperation *) formatStorage: | (NSString *) | deviceSerial | |
storageIndex: | (NSInteger) | storageIndex | |
completion: | (void(^)(NSError *error)) | completion | |
deviceSerial | 设备序列号 |
storageIndex | 查询返回的分区号,0表示全部格式化,可能会有几块硬盘的情况 |
completion | 回调block,error为空表示设置成功 |
+ (NSString *) getAccesstoken |
获取当前accessToken
+ (NSOperation *) getAlarmList: | (NSString *) | deviceSerial | |
pageIndex: | (NSInteger) | pageIndex | |
pageSize: | (NSInteger) | pageSize | |
beginTime: | (NSDate *) | beginTime | |
endTime: | (NSDate *) | endTime | |
completion: | (void(^)(NSArray *alarmList, NSInteger totalCount, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
pageIndex | 分页当前页码(从0开始) |
pageSize | 分页每页数量(建议20以内) |
beginTime | 搜索时间范围开始时间 |
endTime | 搜索时间范围结束时间 |
completion | 回调block,正常时返回EZAlarmInfo的对象数据和查询时间范围内的告警个数的总数,错误时返回错误码 |
+ (NSOperation *) getDeviceInfo: | (NSString *) | deviceSerial | |
completion: | (void(^)(EZDeviceInfo *deviceInfo, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
completion | 回调block,正常时返回EZDeviceInfo的对象,错误时返回错误码 |
+ (NSOperation *) getDeviceList: | (NSInteger) | pageIndex | |
pageSize: | (NSInteger) | pageSize | |
completion: | (void(^)(NSArray *deviceList, NSInteger totalCount, NSError *error)) | completion | |
pageIndex | 分页当前页码(从0开始) |
pageSize | 分页每页数量(建议20以内) |
completion | 回调block,正常时返回EZDeviceInfo的对象数组和设备总数,错误时返回错误码 |
+ (NSOperation *) getDeviceUpgradeStatus: | (NSString *) | deviceSerial | |
completion: | (void(^)(EZDeviceUpgradeStatus *status, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
completion | 回调block,正常时返回EZDeviceUpgradeStatus对象,错误时返回错误码 |
+ (NSOperation *) getDeviceVersion: | (NSString *) | deviceSerial | |
completion: | (void(^)(EZDeviceVersion *version, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
completion | 回调block,正常时返回EZDeviceVersion的对象信息,错误时返回错误码 |
+ (NSOperation *) getLeaveMessageData: | (EZLeaveMessage *) | message | |
completion: | (void(^)(NSData *data, NSInteger resultCode)) | completion | |
message | 留言消息对象 |
completion | 回调block (resultCode = 1 表示语音下载成功,-1表示下载失败) |
+ (NSOperation *) getLeaveMessageList: | (NSString *) | deviceSerial | |
pageIndex: | (NSInteger) | pageIndex | |
pageSize: | (NSInteger) | pageSize | |
beginTime: | (NSDate *) | beginTime | |
endTime: | (NSDate *) | endTime | |
completion: | (void(^)(NSArray *leaveMessageList, NSInteger totalCount, NSError *error)) | completion | |
deviceSerial | 需要获取的设备序列号 |
beginTime | 开始时间 |
endTime | 结束时间 |
pageIndex | 分页页码 |
pageSize | 分页单页数量 |
completion | 回调block,正常时返回EZLeaveMessage的对象数组,错误时返回错误码 |
+ (NSOperation *) getSharedDeviceList: | (NSInteger) | pageIndex | |
pageSize: | (NSInteger) | pageSize | |
completion: | (void(^)(NSArray *deviceList, NSInteger totalCount, NSError *error)) | completion | |
pageIndex | 分页当前页码(从0开始) |
pageSize | 分页每页数量(建议20以内) |
completion | 回调block,正常时返回EZDeviceInfo的对象数组和设备总数,错误时返回错误码 |
+ (NSOperation *) getStorageStatus: | (NSString *) | deviceSerial | |
completion: | (void(^)(NSArray *storageStatus, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
completion | 回调block,正常时返回EZStorageInfo的对象数组,错误时返回错误码 |
+ (NSString *) getTerminalId |
+ (NSOperation *) getUnreadMessageCount: | (NSString *) | deviceSerial | |
messageType: | (EZMessageType) | type | |
completion: | (void(^)(NSInteger count, NSError *error)) | completion | |
deviceSerial | 需要获取的设备序列号,为空时返回账户下所有设备的未读消息数 |
type | 消息类型:EZMessageTypeAlarm 告警消息(1),EZMessageTypeLeave 留言消息(2) |
completion | 回调block,正常时返回未读数量,错误时返回错误码 |
+ (NSOperation *) getUserInfo: | (void(^)(EZUserInfo *userInfo, NSError *error)) | completion |
completion | 回调block, 正常时返回EZUserInfo的对象,错误时返回错误码 |
+ (NSString *) getVersion |
+ (BOOL) gotoEzvizAppPage: | (EZAppPageType) | pageType | |
appType: | (EZAppType) | appType | |
跳转到指定APP的指定界面
pageType | 界面类型 |
appType | APP类型 |
+ (BOOL) handleOpenUrl: | (NSURL *) | url | |
delegate: | (id< EZOpenSDKDelegate >) | delegate | |
外部跳转处理方法,适用于iOS8以下,包括iOS8
url | 跳转过来的url |
delegate | 委托 |
+ (BOOL) handleOpenUrl: | (NSURL *) | url | |
options: | (NSDictionary *) | opetions | |
delegate: | (id< EZOpenSDKDelegate >) | delegate | |
外部跳转处理方法,适用于iOS9以上,包括iOS9
url | 跳转过来的url |
opetions | 参数,默认为空,目前未进行处理,预留 |
delegate | 委托 |
+ (BOOL) handleOpenUrl: | (NSURL *) | url | |
sourceApplication: | (NSString *) | sourceApplication | |
annotation: | (id) | annotation | |
delegate: | (id< EZOpenSDKDelegate >) | delegate | |
外部跳转处理方法,适用于iOS8以下,包括iOS8
url | 跳转过来的url |
sourceApplication | 源APP |
annotation | 注释 |
delegate | 委托 |
+ (BOOL) initLibWithAppKey: | (NSString *) | appKey |
appKey | 传入申请的appKey |
+ (void) initPushService |
+ (BOOL) isEzvizAppInstalledWithType: | (EZAppType) | appType |
根据应用类型判断是否安装了对应的应用
appType | 应用类型 |
+ (BOOL) isLogin |
是否已经登录
+ (void) logout: | (void(^)(NSError *error)) | completion |
completion | 回调block,error为空表示登出成功 |
+ (void) openChangePasswordPage: | (void(^)(NSInteger resultCode)) | completion |
completion | 回调block resultCode为0时表示修改密码成功 |
+ (void) openCloudPage: | (NSString *) | deviceSerial |
deviceSerial | 设备序列号 |
+ (void) openLoginPage: | (void(^)(EZAccessToken *accessToken)) | block |
block | 回调block |
+ (NSOperation *) probeDeviceInfo: | (NSString *) | deviceSerial | |
deviceType: | (NSString *) | deviceType | |
completion: | (void(^)(EZProbeDeviceInfo *deviceInfo, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
deviceType | 设备型号,无法获取到设备型号则可传nil |
completion | 回调block,正常时返回EZProbeDeviceInfo对象,错误码返回错误码 |
+ (BOOL) releasePlayer: | (EZPlayer *) | player |
player | EZPlayer对象 |
+ (NSOperation *) searchRecordFileFromCloud: | (NSString *) | deviceSerial | |
cameraNo: | (NSInteger) | cameraNo | |
beginTime: | (NSDate *) | beginTime | |
endTime: | (NSDate *) | endTime | |
completion: | (void(^)(NSArray *couldRecords, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
cameraNo | 通道号 |
beginTime | 查询时间范围开始时间 |
endTime | 查询时间范围结束时间 |
completion | 回调block,正常时返回EZCloudRecordFile的对象数组,错误时返回错误码 |
+ (NSOperation *) searchRecordFileFromDevice: | (NSString *) | deviceSerial | |
cameraNo: | (NSInteger) | cameraNo | |
beginTime: | (NSDate *) | beginTime | |
endTime: | (NSDate *) | endTime | |
completion: | (void(^)(NSArray *deviceRecords, NSError *error)) | completion | |
deviceSerial | 设备序列号 |
cameraNo | 通道号 |
beginTime | 查询时间范围开始时间 |
endTime | 查询时间范围结束时间 |
completion | 回调block,正常时返回EZDeviceRecordFile的对象数组,错误时返回错误码 |
+ (void) setAccessToken: | (NSString *) | accessToken |
accessToken | 授权登录获取的accessToken |
+ (NSOperation *) setAlarmStatus: | (NSArray *) | alarmIds | |
alarmStatus: | (EZMessageStatus) | status | |
completion: | (void(^)(NSError *error)) | completion | |
alarmIds | 告警信息Id数组(可以只有一个Id),最多为10个id,否则会报错 |
status | 告警消息状态 |
completion | 回调block,error为空时表示设置成功 |
+ (BOOL) setDebugLogEnable: | (BOOL) | enable |
enable | 是否打印日志,默认关闭 |
+ (NSOperation *) setDefence: | (EZDefenceStatus) | defence | |
deviceSerial: | (NSString *) | deviceSerial | |
completion: | (void(^)(NSError *error)) | completion | |
defence | 布防状态, IPC布防状态只有0和1,A1有0:睡眠 8:在家 16:外出 |
deviceSerial | 设备序列号 |
completion | 回调block,error为空表示设置成功 |
+ (NSOperation *) setDeviceEncryptStatus: | (NSString *) | deviceSerial | |
verifyCode: | (NSString *) | verifyCode | |
encrypt: | (BOOL) | isEncrypt | |
completion: | (void(^)(NSError *error)) | completion | |
isEncrypt | 是否加密,只有NO(关闭)的时候需要设备验证码的相关参数(vaildateCode) |
deviceSerial | 设备序列号 |
verifyCode | 设备验证码 |
completion | 回调block,error为空时表示操作成功 |
+ (NSOperation *) setDeviceName: | (NSString *) | deviceName | |
deviceSerial: | (NSString *) | deviceSerial | |
completion: | (void(^)(NSError *error)) | completion | |
deviceSerial | 设备序列号 |
deviceName | 设备名称 |
completion | 回调block,error为空时表示修改成功 |
+ (NSOperation *) setLeaveMessageStatus: | (NSArray *) | leaveIds | |
messageStatus: | (EZMessageStatus) | status | |
completion: | (void(^)(NSError *error)) | completion | |
leaveIds | 留言消息Id数组(最大数量为10,允许只有1个) |
status | 需要设置的留言状态,目前只支持 EZMessageStatusRead(已读) |
completion | 回调block,error为空表示设置成功 |
+ (NSOperation *) setVideoLevel: | (NSString *) | deviceSerial | |
cameraNo: | (NSInteger) | cameraNo | |
videoLevel: | (EZVideoLevelType) | videoLevel | |
completion: | (void(^)(NSError *error)) | completion | |
deviceSerial | 设备序列号 |
cameraNo | 通道号 |
videoLevel | 通道清晰度,0-流畅,1-均衡,2-高清,3-超清 |
completion | 回调block,无error表示设置成功 |
+ (BOOL) startAPConfigWifiWithSsid: | (NSString *) | ssid | |
password: | (NSString *) | password | |
deviceSerial: | (NSString *) | deviceSerial | |
verifyCode: | (NSString *) | verifyCode | |
result: | (void(^)(BOOL ret)) | callback | |
AP配网接口
ssid | WiFi的ssid |
password | WiFi的密码 |
deviceSerial | 设备序列号 |
verifyCode | 设备验证码 |
callback | 结果回调 |
+ (BOOL) startConfigWifi: | (NSString *) | ssid | |
password: | (NSString *) | password | |
deviceSerial: | (NSString *) | deviceSerial | |
deviceStatus: | (void(^)(EZWifiConfigStatus status)) | statusBlock | |
ssid | 连接WiFi SSID |
password | 连接WiFi 密码 |
deviceSerial | 连接WiFi的设备的设备序列号 |
statusBlock | 返回连接设备的WiFi配置状态 |
+ (BOOL) startConfigWifi: | (NSString *) | ssid | |
password: | (NSString *) | password | |
deviceSerial: | (NSString *) | deviceSerial | |
mode: | (NSInteger) | mode | |
deviceStatus: | (void(^)(EZWifiConfigStatus status, NSString *deviceSerial)) | statusBlock | |
ssid | 连接WiFi SSID |
password | 连接WiFi 密码 |
deviceSerial | 连接WiFi的设备的设备序列号,批量配置时填nil |
mode | 配网的方式,EZWiFiConfigMode中列举的模式进行任意组合,例如:EZWiFiConfigSmart|EZWiFiConfigWave |
statusBlock | 返回设备序列号以及当前连接状态 |
+ (void) stopAPConfigWifi |
停止AP配网
+ (BOOL) stopConfigWifi |
+ (NSOperation *) upgradeDevice: | (NSString *) | deviceSerial | |
completion: | (void(^)(NSError *error)) | completion | |
deviceSerial | 设备序列号 |
completion | 回调block,error为空表示操作成功 |