EZOpenSDK  v4.7.1
 All Classes Functions Properties
EZGlobalSDK.h
1 //
2 // EZGlobalSDK.h
3 // EZGlobalSDK
4 //
5 // Created by DeJohn Dong on 16/7/14.
6 // Copyright © 2016Ezviz.. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 #import "EZConstants.h"
11 
12 @class EZPlayer;
13 @class EZAccessToken;
14 @class EZDeviceInfo;
15 @class EZCameraInfo;
16 @class EZDeviceVersion;
17 @class EZProbeDeviceInfo;
18 @class EZUserInfo;
20 @class EZLeaveMessage;
21 @class EZHiddnsDeviceInfo;
22 
24 @interface EZGlobalSDK : NSObject
25 
34 + (BOOL)initLibWithAppKey:(NSString *)appKey;
35 
45 + (BOOL)initLibWithAppKey:(NSString *)appKey url:(NSString *)url authUrl:(NSString *)authUrl;
46 
53 + (void)setAccessToken:(NSString *)accessToken;
54 
61 + (BOOL)destoryLib;
62 
69 + (NSString *)getVersion;
70 
77 + (void)enableP2P:(BOOL)enable;
78 
88 + (NSOperation *)getAreaList:(void (^)(NSArray *areaList, NSError *error))completion;
89 
96 + (void)openLoginPage:(NSString *)areaId
97  completion:(void (^)(EZAccessToken *accessToken))block;
98 
106 + (void)logout:(void (^)(NSError *error))completion;
107 
118 + (NSOperation *)deleteAlarm:(NSArray *)alarmIds
119  completion:(void (^)(NSError *error))completion;
120 
132 + (NSOperation *)setAlarmStatus:(NSArray *)alarmIds
133  alarmStatus:(EZMessageStatus)status
134  completion:(void (^)(NSError *error))completion;
135 
136 
148 + (NSOperation *)deleteDevice:(NSString *)deviceSerial
149  completion:(void (^)(NSError *error))completion;
150 
162 + (BOOL)startConfigWifi:(NSString *)ssid
163  password:(NSString *)password
164  deviceSerial:(NSString *)deviceSerial
165  deviceStatus:(void (^)(EZWifiConfigStatus status))statusBlock;
166 
173 + (BOOL)stopConfigWifi;
174 
187 + (NSOperation *)controlPTZ:(NSString *)deviceSerial
188  cameraNo:(NSInteger)cameraNo
189  command:(EZPTZCommand)command
190  action:(EZPTZAction)action
191  speed:(NSInteger)speed
192  result:(void (^)(NSError *error))resultBlock;
193 
204 + (void)controlVideoFlip:(NSString *)deviceSerial
205  cameraNo:(NSInteger)cameraNo
206  command:(EZDisplayCommand)command
207  result:(void (^)(NSError *error))resultBlock;
208 
218 + (EZPlayer *)createPlayerWithDeviceSerial:(NSString *)deviceSerial
219  cameraNo:(NSInteger)cameraNo;
220 
221 
230 + (EZPlayer *)createPlayerWithUrl:(NSString *)url;
231 
232 
241 + (BOOL)releasePlayer:(EZPlayer *)player;
242 
243 #pragma mark - V3.1 Added API
244 
254 + (NSData *)decryptData:(NSData *)data verifyCode:(NSString *)verifyCode;
255 
256 
257 #pragma mark - V3.2 Added API
258 
269 + (NSOperation *)getDeviceVersion:(NSString *)deviceSerial
270  completion:(void (^)(EZDeviceVersion *version, NSError *error))completion;
271 
272 
285 + (NSOperation *)setDeviceEncryptStatus:(NSString *)deviceSerial
286  verifyCode:(NSString *)verifyCode
287  encrypt:(BOOL)isEncrypt
288  completion:(void (^)(NSError *error))completion;
289 
301 + (NSOperation *)setDeviceName:(NSString *)deviceName
302  deviceSerial:(NSString *)deviceSerial
303  completion:(void (^)(NSError *error))completion;
304 
314 + (NSOperation *)getUserInfo:(void (^)(EZUserInfo *userInfo, NSError *error))completion;
315 
327 + (NSOperation *)getUnreadMessageCount:(NSString *)deviceSerial
328  messageType:(EZMessageType)type
329  completion:(void (^)(NSInteger count, NSError *error))completion;
330 
345 + (NSOperation *)getLeaveMessageList:(NSString *)deviceSerial
346  pageIndex:(NSInteger)pageIndex
347  pageSize:(NSInteger)pageSize
348  beginTime:(NSDate *)beginTime
349  endTime:(NSDate *)endTime
350  completion:(void (^)(NSArray *leaveMessageList, NSInteger totalCount, NSError *error))completion;
351 
363 + (NSOperation *)setLeaveMessageStatus:(NSArray *)leaveIds
364  messageStatus:(EZMessageStatus)status
365  completion:(void (^)(NSError *error))completion;
366 
377 + (NSOperation *)deleteLeaveMessage:(NSArray *)leaveIds
378  completion:(void (^)(NSError *error))completion;
379 
390 + (NSOperation *)getStorageStatus:(NSString *)deviceSerial
391  completion:(void (^)(NSArray *storageStatus, NSError *error))completion;
392 
404 + (NSOperation *)formatStorage:(NSString *)deviceSerial
405  storageIndex:(NSInteger)storageIndex
406  completion:(void (^)(NSError *error))completion;
418 + (NSOperation *)probeDeviceInfo:(NSString *)deviceSerial
419  completion:(void (^)(EZProbeDeviceInfo *deviceInfo, NSError *error))completion;
420 
431 + (NSOperation *)getDeviceUpgradeStatus:(NSString *)deviceSerial
432  completion:(void (^)(EZDeviceUpgradeStatus *status, NSError *error))completion;
433 
444 + (NSOperation *)upgradeDevice:(NSString *)deviceSerial
445  completion:(void (^)(NSError *error))completion;
446 
447 
456 + (NSOperation *)getLeaveMessageData:(EZLeaveMessage *)message
457  completion:(void (^)(NSData *data, NSInteger resultCode))completion;
458 
465 + (void)openCloudPage:(NSString *)deviceSerial;
466 
473 + (void)openChangePasswordPage:(void (^)(NSInteger resultCode))completion;
474 
483 + (BOOL)setDebugLogEnable:(BOOL)enable;
484 
496 + (NSOperation *)getDeviceList:(NSInteger)pageIndex
497  pageSize:(NSInteger)pageSize
498  completion:(void (^)(NSArray *deviceList, NSInteger totalCount, NSError *error))completion;
499 
511 + (NSOperation *)getSharedDeviceList:(NSInteger)pageIndex
512  pageSize:(NSInteger)pageSize
513  completion:(void (^)(NSArray *deviceList, NSInteger totalCount, NSError *error))completion;
514 
528 + (NSOperation *)searchRecordFileFromCloud:(NSString *)deviceSerial
529  cameraNo:(NSInteger)cameraNo
530  beginTime:(NSDate *)beginTime
531  endTime:(NSDate *)endTime
532  completion:(void (^)(NSArray *couldRecords, NSError *error))completion;
533 
547 + (NSOperation *)searchRecordFileFromDevice:(NSString *)deviceSerial
548  cameraNo:(NSInteger)cameraNo
549  beginTime:(NSDate *)beginTime
550  endTime:(NSDate *)endTime
551  completion:(void (^)(NSArray *deviceRecords, NSError *error))completion;
552 
567 + (NSOperation *)getAlarmList:(NSString *)deviceSerial
568  pageIndex:(NSInteger)pageIndex
569  pageSize:(NSInteger)pageSize
570  beginTime:(NSDate *)beginTime
571  endTime:(NSDate *)endTime
572  completion:(void (^)(NSArray *alarmList, NSInteger totalCount, NSError *error))completion;
573 
585 + (NSOperation *)addDevice:(NSString *)deviceSerial
586  verifyCode:(NSString *)verifyCode
587  completion:(void (^)(NSError *error))completion;
588 
601 + (NSOperation *)captureCamera:(NSString *)deviceSerial
602  cameraNo:(NSInteger)cameraNo
603  completion:(void (^)(NSString *url, NSError *error))completion;
604 
617 + (NSOperation *)setVideoLevel:(NSString *)deviceSerial
618  cameraNo:(NSInteger)cameraNo
619  videoLevel:(NSInteger)videoLevel
620  completion:(void (^)(NSError *error))completion;
621 
633 + (NSOperation *)setDefence:(EZDefenceStatus)defence
634  deviceSerial:(NSString *)deviceSerial
635  completion:(void (^)(NSError *error))completion;
636 
637 #pragma mark - V4.3 Added API
638 
648 + (NSOperation *)getDeviceInfo:(NSString *)deviceSerial
649  completion:(void (^)(EZDeviceInfo *deviceInfo, NSError *error))completion;
650 
657 + (NSString *) getTerminalId;
658 
659 #pragma mark - V4.4 Added API
660 
665 + (void) initPushService;
666 
667 #pragma mark - V4.5 Added API
668 
672 + (void) clearStreamInfoCache;
673 
674 
675 #pragma mark - V4.7 Added API
676 
686 + (NSOperation *)getHiddnsDeviceInfo:(NSString *)deviceSerial
687  domain:(NSString *) domain
688  completion:(void (^)(EZHiddnsDeviceInfo *ddnsDeviceInfo, NSError *error))completion;
689 
699 + (NSOperation *)setHiddnsDomain:(NSString *)deviceSerial
700  domain:(NSString *) domain
701  completion:(void (^)(NSError *error))completion;
702 
711 + (NSOperation *)setHiddnsModeAuto:(NSString *)deviceSerial
712  completion:(void (^)(NSError *error))completion;
713 
724 + (NSOperation *)setHiddnsModeManual:(NSString *)deviceSerial
725  httpPort:(NSInteger) httpPort
726  cmdPort:(NSInteger) cmdPort
727  completion:(void (^)(NSError *error))completion;
728 
738 + (NSOperation *)getHiddnsDeviceList:(NSInteger) pageIndex
739  pageSize:(NSInteger) pageSize
740  completion:(void (^)(NSArray *ddnsDeviceList, NSInteger totalCount, NSError *error))completion;
741 
752 + (NSOperation *)shareHiddnsDevice:(NSString *) deviceSerial
753  account:(NSString *) account
754  completion:(void (^)(NSError *error))completion;
755 
765 + (NSOperation *)getShareHiddnsDeviceList:(NSInteger) pageIndex
766  pageSize:(NSInteger) pageSize
767  completion:(void (^)(NSArray *ddnsDeviceList, NSInteger totalCount, NSError *error))completion;
768 
769 @end
NSString * getVersion()
Search device information (Before adding device)
Definition: EZProbeDeviceInfo.h:12
Camera information.
Definition: EZCameraInfo.h:12
BOOL destoryLib()
Device information.
Definition: EZDeviceInfo.h:12
Definition: EZHiddnsDeviceInfo.h:11
NSString * getTerminalId()
void clearStreamInfoCache()
Player class.
Definition: EZPlayer.h:79
Leave message.
Definition: EZLeaveMessage.h:12
Device version information.
Definition: EZDeviceVersion.h:12
BOOL stopConfigWifi()
void initPushService()
Device upgrade status.
Definition: EZDeviceUpgradeStatus.h:12
Hik-Connect system credential information after authorized login.
Definition: EZAccessToken.h:12
User information.
Definition: EZUserInfo.h:12
EZGlobalSDK API. Note: 110001 (parameter error), 110002 (AccessToken has expired), 149999, 150000 (server exception) are the general error code returned by the HTTP API (return value is NSOperation, for most of the HTTP API), 400002 is the general error code of parameter error.
Definition: EZGlobalSDK.h:24