Kalay1.0标准-升级版PSC

Kalay1.0 升级版PSC


IOS API

<p>[TOC]</p> <h1>1. IOTCamera</h1> <h2>1.1 Initialization</h2> <h3>TK_InitIOTCWithLiceseKey</h3> <pre><code> Function: IOTC initialization, confirm the legality of privateKey and sdkLicensekey Two Key values need to be applied to TUTK /** IOTC initialization @param licenseKey initialized by SDK @param privateKey initialized by PSC @param success verification successful @param failure verification failed */ + (void)TK_InitIOTCWithLiceseKey:(NSString *)licenseKey privateKey:(NSString *)privateKey success:(DictionaryBlock)success failure:(void (^)(NSError *error))failure;</code></pre> <pre><code class="language-objective-c">Example: [Camera TK_InitIOTCWithLiceseKey:LICENSEKEY privateKey:PRIVATEKEY                              success:^(NSDictionary * _Nonnull dic){ } failure:^(NSError *error) {         if (error.code == TUTK_ER_INVALID_ARG) {             NSLog(@&amp;quot;TK_InitIOTC:false(TUTK_ER_INVALID_ARG)&amp;quot;);         }else if (error.code == TUTK_ER_INVALID_LICENSE_KEY) {             NSLog(@&amp;quot;TK_InitIOTC:false(TUTK_ER_INVALID_LICENSE_KEY)&amp;quot;);         }else if (error.code == TUTK_ER_MEM_INSUFFICIENT) {             NSLog(@&amp;quot;TK_InitIOTC:false(TUTK_ER_MEM_INSUFFICIENT)&amp;quot;);         }     }];</code></pre> <p>&gt; Note: -10000 is returned when calling TK_InitIOTCWithLiceseKey, which is caused by the invalid privateKey. When encountering this problem, it is recommended:</p> <ul> <li>Confirm whether the package name and privateKey used in the current project are consistent with those provided by TUTK. If they are inconsistent, please modify the package name and privateKey provided by TUTK and rerun;</li> <li>If you need to change the package name and privateKey, please contact business or technical support personnel.</li> </ul> <h3>TK_uninitIOTC</h3> <pre><code>/** IOTC uninitialization */ + (void)TK_uninitIOTC;</code></pre> <pre><code class="language-objective-c">Example: [Camera TK_uninitIOTC];</code></pre> <h3>TK_initWithName</h3> <pre><code>/** Initialize Camera @param name camera name @return Camera initialized instance object */ - (id)TK_initWithName:(NSString *)name;</code></pre> <pre><code class="language-objective-c">Example: self.myCamera = [[MyCamera alloc] TK_initWithName:name];</code></pre> <h3>TK_getIOTCameraVersion</h3> <pre><code>/** Get IOTCamera version @return IOTCamera version */ + (NSString *)TK_getIOTCameraVersion;</code></pre> <pre><code class="language-objective-c">Example: [Camera TK_getIOTCameraVersion];</code></pre> <h3>TK_getIOTCAPIsVersion</h3> <pre><code>/** Get IOTCAPIs version @return IOTCAPIs version */ + (NSString *)TK_getIOTCAPIsVersion;</code></pre> <pre><code class="language-objective-c">Example: [Camera TK_getIOTCAPIsVersion];</code></pre> <h3>TK_getAVAPIsVersion</h3> <pre><code>/** Get AVAPIs version @return AVAPIs version */ + (NSString *)TK_getAVAPIsVersion;</code></pre> <pre><code class="language-objective-c">Example: [Camera TK_getAVAPIsVersion];</code></pre> <h3>TK_setMasterRegion: (TKRegion) regin</h3> <pre><code>/** Set up the region for the partition distribution plan @param regin sets the region in TKRegion that the traffic is diverted to @return TKRegionResult set the return value with reference to the structure TKRegionResult below. */ + (TKRegionResult) TK_setMasterRegion: (TKRegion) regin;</code></pre> <hr /> <pre><code>typedef NS_ENUM(NSInteger, TKRegion) { TKREGION_ALL, TKREGION_CN, TKREGION_EU, TKREGION_US , };</code></pre> <hr /> <pre><code>typedef NS_ENUM(NSInteger, TKRegionResult) { TKREGION_ER_NoERROR = 0,//set success TKREGION_ER_INVALID_ARG = -46,//the region is invalid TKREGION_ER_ALREADY_INITIALIZED = -3,//IOTC module is already initialized };</code></pre> <pre><code class="language-objective-c">Example: [Camera TK_setMasterRegion:TKREGION_CN];</code></pre> <h3>TK_setLogEnbale</h3> <pre><code>/** Set up Log records @param enable whether to enable log recording @param level log level */ + (void) TK_setLogEnbale:(BOOL)enable</code></pre> <h2>                   Level:(logLevel_t)level;</h2> <pre><code>typedef enum LogLevel {</code></pre> <h2>    LEVEL_VERBOSE = 0,     LEVEL_DEBUG = 1,     LEVEL_INFO = 2,     LEVEL_WARNING = 3,     LEVEL_ERROR = 4,     LEVEL_SILENCE = 5, } logLevel_t;</h2> <pre><code class="language-objective-c">Example:     [Camera TK_setLogEnbale:false Level:LEVEL_ERROR];</code></pre> <h2>1.2 Callback</h2> <h3>1.2.1 P2PDelegate</h3> <h4>didChangeSessionStatus</h4> <pre><code>/** Connection status callback  @param camera camera object  @param status session connection result 0 success other failure  @param errorCode TK_connect connection return result &amp;gt;=0 success, other failure  */ - (void)camera:(Camera *)camera didChangeSessionStatus:(NSInteger)status errorCode:(NSInteger)errorCode;</code></pre> <h4>didChangeChannelStatus</h4> <pre><code>/** Specify the connection status callback of the channel @param camera camera object @param channel av channel @param status connection status @param errorCode TK_start av channel returns result 0 success, other failure */ - (void)camera:(Camera *)camera didChangeChannelStatus:(NSInteger)channel ChannelStatus:(NSInteger)status errorCode:(NSInteger)errorCode;</code></pre> <h4>didChangeBindStatus</h4> <pre><code>/** Bind status callback @param camera camera object @param status bind result 0 success other failure @param credential connection credential value @param errorCode TK_nebulaBind returns result &amp;gt;=0 success, other failure */ - (void)camera:(Camera *)camera didChangeBindStatus:(NSInteger)status credentialInfo:(NSString *)credential errorCode:(NSInteger)errorCode;</code></pre> <h4>didSendIOCtrlWithType</h4> <pre><code>/**  Specify channel command to send callback  @param camera camera object  @param type command type  @param data command data  @param size command data length  @param channel av channel  @param errorCode return error code  */ - (void)camera:(Camera *)camera didSendIOCtrlWithType:(NSInteger)type Data:(const char*)data DataSize:(NSInteger)size Channel:(NSInteger)channel errorCode:(NSInteger)errorCode;</code></pre> <h4>didReceiveIOCtrlWithType</h4> <pre><code>/** Specify channel command receiving callback @param camera camera object @param type command type @param data command data @param size command data length @param channel av channel */ - (void)camera:(Camera *)camera didReceiveIOCtrlWithType:(NSInteger)type Data:(const char*)data DataSize:(NSInteger)size Channel:(NSInteger)channel;</code></pre> <h4>didRecvVideoChannel</h4> <pre><code>/** Video data reception error code for the specified channel</code></pre> <p>  @param camera camera object @param channel av channel @param errorCode avRecvFrameData2 return result is greater than 0 success, other failure */</p> <ul> <li>(void)camera:(Camera *)camera didRecvVideoChannel:(NSInteger)channel errorCode:(NSInteger)errorCode;</li> </ul> <h4>didRecvAudioChannel</h4> <pre><code>/** Audio data reception error code for the specified channel  @param camera camera object @param channel av channel @param errorCode avRecvAudioData av channel return result is greater than 0 success, other failure  */ - (void)camera:(Camera *)camera didRecvAudioChannel:(NSInteger)channel errorCode:(NSInteger)errorCode;</code></pre> <h4>didStartTalkSuccess</h4> <pre><code>/** Callback for successful intercom channel establishment @param camera camera object @param isSuccess whether the establishment is successful @param errorCode error code */ - (void)camera:(Camera *)camera didStartTalkSuccess:(BOOL)isSuccess ErrorCode:(NSInteger) errorCode;</code></pre> <h4>didStartListenSuccess</h4> <pre><code>/** Listen for callbacks when channel establishment is successful @param camera camera object @param isSuccess whether the establishment is successful @param channel av channel */ - (void)camera:(Camera *)camera didStartListenSuccess:(BOOL)isSuccess Channel:(NSInteger)channel;</code></pre> <h4>didSendVideoSuccess</h4> <pre><code>/**  Callback for video sending channel establishment  @param camera camera object  @param isSuccess whether the establishment is successful  @param errorCode error code (success: &amp;gt;=0 avIndex for sending data; fail: &amp;lt;0)  */ - (void)camera:(Camera *)camera didSendVideoSuccess:(BOOL)isSuccess ErrorCode:(NSInteger) errorCode;</code></pre> <h4>connection status</h4> <pre><code>CONNECTION_STATE_NONE = 0; //Initialize connection status CONNECTION_STATE_CONNECTING = 1; //The device is connecting CONNECTION_STATE_CONNECTED = 2; //The device is connected &amp;gt;= 0 CONNECTION_STATE_DISCONNECTED = 3; //The device is not connected -22 AV other CONNECTION_STATE_UNKNOWN_DEVICE = 4; //Unknown device -15 CONNECTION_STATE_WRONG_PASSWORD = 5; //Incorrect device connection password -20009 CONNECTION_STATE_TIMEOUT = 6; //Device connection timeout IOTC -13 -23 AV -20016 -20011 CONNECTION_STATE_UNSUPPORTED = 7; //The device is not supported -40 CONNECTION_STATE_CONNECT_FAILED = 8; //Device connection failure IOTC others CONNECTION_STATE_UNKNOWN_LICENSE = 9; //The device uid is not in the license -10 CONNECTION_STATE_SLEEP = 10; //Device sleep state -64 CONNECTION_STATE_DEVICE_MAX_SESSION = 11; //Exceeded the maximum number of device connections -48 CONNECTION_STATE_POOR_NETWORKSIGNA = 12; //Poor network signal returns status -19 -42 CONNECTION_STATE_WRONG_AUTHKEY = 13 //authKey error return status -46 -68</code></pre> <h3>1.2.2 MediaDelegate</h3> <h4>didReceiveFrameInfoWithChannel</h4> <pre><code>/** Callback for debugging information such as video width and height/fps/bps/online number/frame counts/dropped frames of the specified channel @param camera camera object @param channel av channel @param videoWidth video width @param videoHeight video height @param fps video fps @param videoBps video bps @param audioBps audio bps @param onlineNm online number @param frameCount frame counts @param incompleteFrameCount dropped frames of the specified channel @param isHwDecode is it a hard decode? */ - (void)camera:(Camera *)camera didReceiveFrameInfoWithChannel:(NSInteger)channel videoWidth:(NSInteger)videoWidth VideoHeight:(NSInteger)videoHeight VideoFPS:(NSInteger)fps VideoBPS:(NSInteger)videoBps AudioBPS:(NSInteger)audioBps OnlineNm:(NSInteger)onlineNm FrameCount:(unsigned int)frameCount IncompleteFrameCount:(unsigned int)incompleteFrameCount isHwDecode:(BOOL)isHwDecode;</code></pre> <h4>onDecodeResultWithFrameNum</h4> <pre><code>/** Information callback related to the current decoding result @param camera camera object @param frameNum number of the current frame @param isDecodeSuccess whether decoding is successful @param isDropFrame whether to drop the current frame @param isIFrame is it an I frame? @param isSoft is it a soft decoding? */ - (void)camera:(Camera *)camera onDecodeResultWithFrameNum:(NSInteger)frameNum IsDecodeSuccess:(BOOL)isDecodeSuccess IsDropFrame:(BOOL)isDropFrame IsIFrame:(BOOL)isIFrame IsSoft:(BOOL)isSoft;</code></pre> <h4>outputDecodeVideoYUVData</h4> <pre><code>/** The decoded yuv data format of the specified channel is i420 @param camera camera object @param data decoded yuv data @param outWidth decoded data width @param outHeight decoded data height @param timestamp timestamp @param channel av channel */ - (void)camera:(Camera *)camera outputDecodeVideoYUVData:(NSData *)data width:(int)outWidth height:(int)outHeight timestamp:(uint64_t)timestamp channel:(NSInteger)channel;</code></pre> <h4>didReceiveFrameData</h4> <pre><code>/** Callback for video frame data received by the specified channel @param camera camera object @param frameData video frame data @param size frame data length @param infoData video frame data information @param channel av channel */ - (void)camera:(Camera *)camera didReceiveFrameData:(const char *)frameData DataSize:(unsigned int)size FrmInfo:(NSData *)infoData Channel:(NSInteger)channel;</code></pre> <h4>didReceiveAudioData</h4> <pre><code>/** Callback for audio frame data received by the specified channel @param camera camera object @param data audio frame data @param size audio frame data length @param infoData audio frame data information @param channel av channel */ - (void)camera:(Camera *)camera didReceiveAudioData:(const char *)data DataSize:(unsigned int)size FrmInfo:(NSData *)infoData Channel:(NSInteger)channel;</code></pre> <h4>didreportCodecId</h4> <pre><code>/** Video frame encoding format callback @param camera camera object @param pointer encoding format pointer @param channel av channel */ - (void)camera:(Camera *)camera didreportCodecId:(NSValue *)pointer Channel:(NSInteger)channel;</code></pre> <h4>didRecvAudioOutput</h4> <pre><code>/** Output decoded audio data @param camera camera object @param pcmData pcm audio data @param channel av channel */ - (void)camera:(Camera *)camera didRecvAudioOutput:(NSData *)pcmData Channel:(int)channel;</code></pre> <h4>didSendAudioOutput</h4> <pre><code>/** Output audio data collected by Mic @param camera camera object @param audioData audio data @param length audio data length @param codec device-side audio encoding format @param channel av channel */ - (void)camera:(Camera *)camera didSendAudioOutput:(NSData *)audioData Length:(NSInteger)length Codec:(NSInteger)codec Channel:(NSInteger)channel;</code></pre> <h4>downloadUploadOutput</h4> <pre><code>/**  Output file download or upload data results  @param camera camera object  @param fileName file name  @param progress file transfer progress @param type download or upload  @param result device-side audio encoding format  @param channel channel number  */ - (void)camera:(Camera *)camera fileName:(NSString *)fileName progress:(NSInteger)progress loadType:(FILETransferType)type result:(NSInteger)result Channel:(NSInteger)channel;</code></pre> <h4>outputVideoData</h4> <pre><code>/**  Throwing up the collected yuv data  @param camera camera object  @param data   yuv data after collection  @param timestamp timestamp  @param channel av channel  */ - (void)camera:(Camera *)camera outputVideoData:(NSData *)data</code></pre> <p>     timestamp:(uint64_t)timestamp        channel:(NSInteger)channel;</p> <h2>1.3 Connection</h2> <h3>1.3.1 P2P</h3> <h4>TK_connect</h4> <pre><code>/** Start connecting devices @param uid device's UID */ - (void)TK_connect:(NSString *)uid; /** Start connecting devices @param uid device's UID @param authKey key for device connection */ - (void)TK_connect:(NSString *)uid authKey:(NSString *)authKey;</code></pre> <pre><code class="language-objective-c">Example: [self.camera TK_connect:@&amp;quot;device uid&amp;quot; authKey:@&amp;quot;device authKey&amp;quot;];</code></pre> <h4>TK_LanSearch</h4> <pre><code>/** Search for devices within the local LAN @param num number of devices searched @param timeoutVal search timeout @return the searched device information structure */ + (LanSearch_t *)TK_LanSearch:(int *)num timeout:(int)timeoutVal;</code></pre> <pre><code class="language-objective-c">Example: [Camera TK_LanSearch:&amp;amp;num timeout:3000];</code></pre> <h3>1.3.2 Nebula</h3> <h4>TK_nebulaBind</h4> <pre><code>/**  Nebula bind device  @param udid device udid 40 codes @param bindType binding type, pinCode \ credential \ local @param bindKey is related to the binding type, and the data filled in are pinCode\ credential \ null */ - (void)TK_nebulaBind: (NSString *)udid bindType: (BINDTYPE )bindType bindKey: (NSString *)bindKey;</code></pre> <pre><code class="language-objective-c">Example: [self.myControl TK_nebulaBind:uid bindType:AP_BIND bindKey:@&amp;quot;888888ii&amp;quot;];</code></pre> <h4>TK_nebulaConnect</h4> <pre><code>/** Nebula Connected Devices  @param udid device udid 40 codes  @param credential credential  @param identity authentication code  @param deviceToken device token  @param realm realm  @param isWakeup whether to wake up automatically  @param isNebulaOnly whether only Nebula is supported */ - (void)TK_nebulaConnect: (NSString *)udid credential: (NSString *) credentia identity: (NSString *)identity deviceToken: (NSString *)deviceToken realm: (NSString *)realm isWakeup: (BOOL)isWakeup isNebulaOnly: (BOOL)isNebulaOnly;</code></pre> <pre><code class="language-objective-c">Example: [self TK_nebulaConnect:uid credential:self.dev_credential deviceToken:TOKEN realm:REALM isWakeup:YES isNebulaOnly:YES];;</code></pre> <pre><code>/** Nebula Connected Devices  @param udid device udid 40 codes  @param credential credential  @param deviceToken device token  @param realm realm</code></pre> <p>  */</p> <ul> <li>(void)TK_NebulaConnect: (NSString <em>)udid credential: (NSString </em>)credential deviceToken: (NSString <em>)deviceToken realm: (NSString </em>)realm;</li> </ul> <pre><code class="language-objective-c">Example: [self TK_nebulaConnect:uid credential:self.dev_credential deviceToken:TOKEN realm:REALM];</code></pre> <h3>TK_NebulaLanSearchTimeout</h3> <pre><code>/** Nebula LAN scanning equipment  @param timeout timeout @param responseBlock response  */ - (void)TK_nebulaLanSearchTimeout:(NSInteger)timeout responseBlock:(nonnull UDIDInfoBlock)responseBlock;</code></pre> <pre><code class="language-objective-c">Example: [myCamera TK_nebulaLanSearchTimeout:5 responseBlock:^(st_UDIDInfo * _Nonnull uuidInfo, int num) {                 dispatch_async(dispatch_get_main_queue(), ^{                     if (num &amp;lt;= 0) {                         if (block) block(nil);                         return;                     }                     NSDictionary *dict = @{                         @&amp;quot;uid&amp;quot;: [NSString stringWithFormat:@&amp;quot;%s&amp;quot;,uuidInfo-&amp;gt;udid],                     };                     [dataSource addObject:dict];                     if (block) block(dataSource);                     return;                 });             }];</code></pre> <h4>TK_nebulaSsidListReq</h4> <pre><code>/**  Nebula get device ssid list  @param max_ap_count Max search count  @param responseBlock search result</code></pre> <p>  */</p> <ul> <li>(void)TK_nebulaSsidListReq:(int)max_ap_count responseBlock:(ArrayBlock)responseBlock;</li> </ul> <pre><code class="language-objective-c">Example: [self.myCamera TK_nebulaSsidListReq:(int)maxCount responseBlock:^(NSArray * _Nonnull arr) {         responseBlock(arr);     }];</code></pre> <h4>TK_nebulaSetWifiReq</h4> <pre><code>/**  Nebula 设置wifi  @param ssid     Wifi名称  @param password 密码  @param enctype  加密类型  */ - (void)TK_nebulaSetWifiReq:(NSString *)ssid password:(NSString *)password enctype:(int)enctype responseBlock:(DictionaryBlock)responseBlock;</code></pre> <pre><code class="language-objective-c">示例: [self.myCamera TK_nebulaSetWifiReq:ssid password:password enctype:(int)enctype responseBlock:^(NSDictionary * _Nonnull dic) {         responseBlock(dic);     }];</code></pre> <h4>TK_nebulaSetRegionReq</h4> <pre><code>/** Nebula 设置region  @param region 区域设置 @param responseBlock 结果回调</code></pre> <p>  */</p> <ul> <li>(void)TK_nebulaSetRegionReq:(int)region responseBlock:(DictionaryBlock)responseBlock;</li> </ul> <pre><code class="language-objective-c">Example: [self TK_nebulaSetRegionReq:REGION_CN responseBlock:^(NSDictionary * _Nonnull dic) {         responseBlock(dic);     }];</code></pre> <h3>1.3.3 Common interface</h3> <h4>TK_disconnect</h4> <pre><code>/** Disconnect device */ - (void)TK_disconnect;</code></pre> <pre><code class="language-objective-c">Example: [self.camera TK_disconnect];</code></pre> <h4>TK_start</h4> <pre><code>/** Open AV channel @param channel av channel index @param viewPassword device password */ - (void)TK_start:(NSInteger)channel viewPassword:(NSString *)viewPassword; /** Open AV channel @param channel av channel index @param viewAccount device account @param viewPassword device password/token @param authType Device password verification type @param mode  encryption mode SIMPLE(0), DTLS(1), AUTO(2); */ - (void)TK_start:(NSInteger)channel viewAccount:(NSString *)viewAccount viewPassword:(NSString *)viewPassword authType:(TKAuthType)authType securityMode:(AvSecurityMode)mode;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_start:0 viewAccount:@&amp;quot;admin&amp;quot; viewPassword:@&amp;quot;000000&amp;quot; authType:TKAuthType_Password is_playback:FALSE];</code></pre> <h4>TK_stop</h4> <pre><code>/** close AV channel @param channel av channel index */ - (void)TK_stop:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example:[self.myCamera TK_stop:0];</code></pre> <pre><code>#### TK_getConnectionStateOfChannel /** Get the connection status of the specified channel @param channel av channel index @return connect state */ - (NSInteger)TK_getConnectionStateOfChannel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example:[self.myCamera TK_getConnectionStateOfChannel:0];</code></pre> <h4>TK_getViewAccountOfChannel</h4> <pre><code>/** Get the username of the specified channel @param channel specified channel @return Obtained username */ - (NSString *)TK_getViewAccountOfChannel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_getViewAccountOfChannel:0];</code></pre> <h4>TK_getViewPasswordOfChannel</h4> <pre><code>/** Get the password of the specified channel @param channel specified channel @return Obtained password */ - (NSString *)TK_getViewPasswordOfChannel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_getViewPasswordOfChannel:0];</code></pre> <h4>TK_getServiceTypeOfChannel</h4> <pre><code>/** Get the ServiceTYpe of the specified channel @param channel av channel @return serviceType value */ - (unsigned int)TK_getServiceTypeOfChannel:(NSInteger)channel;</code></pre> <hr /> <pre><code>typedef NS_ENUM(NSInteger, TKAuthType) { TKAuthType_Password = 0, //password TKAuthType_Token = 1 //Token };</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_getServiceTypeOfChannel:0];</code></pre> <h2>1.4 Video processing interface</h2> <h3>TK_StartAVFilterWithChannel</h3> <pre><code>/** Whether to enable decoding filter contrast Contrast - a floating point number between -2.0 and 2.0, default is 0 brightness Brightness - a floating point number between -1.0 and 1.0, default is 0 saturation saturation - a floating point number between 0 and 3.0, default is 1 gamma a floating point number between 0 and 1.0, default is 1 gamma_r red value a floating point number between 0.1 and 10.0, default is 1 gamma_g green value a floating point number between 0.1 and 10.0, default is 1 gamma_b blue value a floating point number between 0.1 and 10.0, default is 1 @param channel av channel @param filterCMD filter command (Example: eq=contrast=0.9:brightness=0.1:saturation=1 ) @param isOn whether to open filter function */ - (void)TK_StartAVFilterWithChannel:(NSInteger)channel filterCMD:(NSString *)filterCMD isOn:(BOOL)isOn</code></pre> <pre><code class="language-objective-c"> Example: [myCamera TK_StartAVFilterWithChannel:selectedChannel filterCMD:@&amp;quot;eq=contrast=0.9:brightness=0.1:saturation=1&amp;quot; isOn:YES];</code></pre> <h3>TK_startShow</h3> <pre><code>/** Start receiving, decoding and displaying images @param channel av channel index @param obScreen screen display object */ - (void)TK_startShow:(NSInteger)channel ScreenObject:(NSObject*)obScreen;</code></pre> <pre><code class="language-objective-c"> Example: [myCamera TK_startShow:0 ScreenObject:self];</code></pre> <pre><code>/** Start receiving, decoding and display @param channel av channel index @param obScreen screen display object @param isDecodeAndRender whether decode and render or not @param isSWDecode whether software decode or not @param isDropFrame whether drop p frame or not @param type output data type @param isSendCommand whether send command 1FF/2FF or not */ - (void)TK_startShow:(NSInteger)channel ScreenObject:(NSObject*)obScreen isDecode:(BOOL)isDecodeAndRender isSWDecode:(BOOL)isSWDecode isDropFrame:(BOOL)isDropFrame renderType:(RENDERTYPE)type isSendCommand:(BOOL)isSendCommand;</code></pre> <hr /> <pre><code>typedef NS_ENUM(NSInteger, RENDERTYPE) {</code></pre> <p>    OUTPUT_EMPTY = 0,  //Only receive, decode and render, the output data is empty     OUTPUT_YUV = 1,   //Receive, decode, render, and output yuv data (time-consuming)     OUTPUT_RGB_8888 = 2,//Receive, decode, render, and output RGB_8888 data (time-consuming)     OUTPUT_RGB_565 = 3,//Receive, decode, render, and output RGB_565 data (time-consuming) OUTPUT_YUV_NV12 = 4 //Receive, decode, render, and output yuv data nv12 (time-consuming) };</p> <pre><code class="language-objective-c"> Example: [myCamera TK_startShow:0 ScreenObject:self isDecode:YES isSWDecode:YES isDropFrame:NO renderType:OUTPUT_YUV isSendCommand:YES];</code></pre> <hr /> <h3>TK_stopShow</h3> <pre><code>/** Stop receiving, decoding and displaying images @param channel av channel index */ - (void)TK_stopShow:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_stopShow:0];</code></pre> <pre><code>/**  stop receiving, decoding and displaying images  @param channel av channel index  @param isSendCommand whether send command 2FF or not  */ - (void)TK_stopShow:(NSInteger)channel isSendCommand:(BOOL)isSendCommand;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_stopShow:0 isSendCommand:YES];</code></pre> <h3>TK_getVideoCodecId</h3> <pre><code>/** Get the current video format, call it after calling TK_StartShow and outputting the picture  @param channel av channel index  */ - (NSInteger)TK_getVideoCodecId:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_getVideoCodecId:0];</code></pre> <h3>TK_setDecocdeDelayTime</h3> <pre><code>/** Set the maximum delay time and adjust the time interval of each decoding frame</code></pre> <p>@param channel av channel index @param delayTime the maximum delay time(ms) @param durationTime the time interval of each decoding frame(ms) 0 ~ 30 */</p> <ul> <li> <p>(void)TK_setDecocdeDelayTime:(NSInteger)delayTime durationTime:(NSInteger)durationTime channel:(NSInteger)channel;</p> <pre><code class="language-objective-c">Example: [self.camera TK_setDecocdeDelayTime:1500 durationTime:15 channel:0];</code></pre> <h2>1.5 Audio processing interface</h2> <h3>TK_startSoundToPhone</h3> <p>/** Start receiving, decoding and monitoring device sound</p> <p>@param channel av channel index */</p> </li> <li>(void)TK_startSoundToPhone:(NSInteger)channel;</li> </ul> <pre><code class="language-objective-c"> Example: [self.myCamera TK_startSoundToPhone:0];</code></pre> <pre><code>/** Start receiving, decoding and monitoring device sound @param channel av channel index @param isDecodeAndPlay whether decode and play or not */</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_startSoundToPhone:0 isDecodeAndPlay:YES];</code></pre> <h3>TK_stopSoundToPhone</h3> <pre><code>/** Stop receiving, decoding and monitoring device sound @param channel av channel index */ - (void)TK_stopSoundToPhone:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_stopSoundToPhone:0];</code></pre> <h3>TK_startSoundToDevice</h3> <pre><code>/** start intercom(send audio data from phone to device) @param channel av channel index @param isResend whether open resend mode or not */ - (void)TK_startSoundToDevice:(NSInteger)channel isResend:(BOOL)isResend;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_stopSoundToPhone:0];</code></pre> <pre><code>/** start intercom(send audio data from phone to device) @param channel av channel index @param isResend whether open resend mode or not @param captureSize audio size captured from phone */ - (void)TK_startSoundToDevice:(NSInteger)channel isResend:(BOOL)isResend captureSize:(NSInteger)captureSize;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_startSoundToDevice:0 isResend:YES];</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_startSoundToDevice:0 isResend:YES captureSize:320];</code></pre> <h3>TK_stopSoundToDevice</h3> <pre><code>/** stop intercom @param channel av channel index */ - (void)TK_stopSoundToDevice:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_stopSoundToDevice:0];</code></pre> <h3>TK_playAECAudio</h3> <pre><code>/** Play audio data after echo cancellation @param aecData audio data after echo cancellation @param channel av channel index */ - (void)TK_playAECAudio:(NSData *)aecData Channel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_playAECAudio:pcmData Channel:channel];</code></pre> <h3>TK_sendAecAudio</h3> <pre><code>/** send audio data after echo cancellation @param aecAudioData audio data after echo cancellation @param length length of audio data after echo cancellation @param codec audio formt of device @param channel av channel index */ - (void)TK_sendAecAudio:(NSData *)aecAudioData Length:(NSInteger)length Codec:(NSInteger)codec Channel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_sendAecAudio:audioData Length:[audioData length] Codec:codec Channel:channel];</code></pre> <h3>TK_startSendAudioChannel</h3> <pre><code>/** start send audio data of intercom @param channel av channel index */ - (void)TK_startSendAudioChannel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_startSendAudioChannel:1];</code></pre> <h3>TK_stopSendAudioChannel</h3> <pre><code>/** stop send audio data of intercom @param channel av channel index @param isResend whether open resend mode */ - (void)TK_startSendAudioChannel:(NSInteger)channel isResend:(BOOL)isResend;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_stopSendAudioChannel:1];</code></pre> <h3>TK_setAudioSessionPlayMode</h3> <pre><code>/** Set the audio playback mode, the default is Speaker @param mode play mode // TKAudioSessionPlayModeSpeaker | TKAudioSessionPlayModeReceiver */ - (void)TK_setAudioSessionPlayMode:(TKAudioSessionPlayMode)mode;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_setAudioSessionPlayMode:TKAudioSessionPlayModeSpeaker];</code></pre> <h3>TK_setSoundToDeviceFormatsChannel</h3> <pre><code>/** Set audio capture format @param mChannel av channel index @param mFormatID audio format // ENUM_CODECID | MEDIA_CODEC_AUDIO_PCM @param mSampleRate samplerate // ENUM_AUDIO_SAMPLERATE | AUDIO_SAMPLE_8K @param mChannelsPer Number of channels // ENUM_AUDIO_CHANNEL 0 | 1 @param mBitsPer Number of bits occupied by sampling points // ENUM_AUDIO_DATABITS AUDIO_DATABITS_8 | AUDIO_DATABITS_16 */ - (void)TK_setSoundToDeviceFormatsChannel:(NSInteger)mChannel formatID:(ENUM_CODECID)mFormatID sampleRate:(ENUM_AUDIO_SAMPLERATE)mSampleRate channelsPer:(ENUM_AUDIO_CHANNEL)mChannelsPer bitsPer:(ENUM_AUDIO_DATABITS)mBitsPer;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_setSoundToDeviceFormatsChannel:0 formatID:MEDIA_CODEC_AUDIO_PCM sampleRate:AUDIO_SAMPLE_8K channelsPer:1 bitsPer:AUDIO_DATABITS_16];</code></pre> <h3>TK_getSoundToPhoneCodeId</h3> <pre><code>/**  Get the current listening audio format and use it after calling TK_startSoundToPhone  @param channel av channel  */ - (NSInteger)TK_getSoundToPhoneCodeId:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_getSoundToPhoneCodeId:0];</code></pre> <h3>TK_getSoundToDeviceCodeId</h3> <pre><code>/**  get current audio format of intercom,use this function after sending command 32A @param channel av channel  */ - (NSInteger)TK_getSoundToDeviceCodeId:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_getSoundToDeviceCodeId:0];</code></pre> <h3>TK_isAudioOutputavChannel</h3> <pre><code>/** Handle sending audio data and throw it up @param avChannel av channel index @param isRecvAudio whether throw receiving audio data up or not @param isSendAudio whether throw sending audio data up or not  */ - (NSInteger)TK_isAudioOutputavChannel:(NSInteger)channel  isRecvAudio:(BOOL)isRecvAudio isSendAudio:(BOOL)isSendAudio;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_isAudioOutputavChannel:0 isRecvAudio: YES isSendAudio: NO];</code></pre> <h2>1.6 Recorder and Snapshot</h2> <h3>TK_initVideoGenerator</h3> <pre><code>/** Local recording function initialization @param url sandbox path */ -(void)TK_initVideoGenerator:(NSURL*)url;</code></pre> <pre><code class="language-objective-c"> Example: NSString *path= [CommonUtility pathForDocumentsResource:recordFileName];     NSURL* url = [NSURL fileURLWithPath:path]; [self.myCamera TK_initVideoGenerator:url channel:selectedChannel];</code></pre> <h3>TK_startRecordingForChannel</h3> <pre><code>/** Start recording for specify channel @param path sandbox path @param channel av channel index */ -(void)TK_startRecording:(NSString *)path Channel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_startRecordingForChannel:0 withDuration:180];</code></pre> <h3>TK_stopRecording</h3> <pre><code>/** stop recording */ -(void)TK_stopRecording;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_stopRecording:0];</code></pre> <h3>TK_getChannel</h3> <pre><code>/** Fills the video data of the specified channel @param channel av channel index @param imgData video data buffer @param size vide data buffer length @param codec_id video format @param width video image width @param height video image height @return lenth of filling video data */ -(unsigned int)TK_getChannel:(NSInteger)channel Snapshot:(char *)imgData DataSize:(unsigned int)size ImageType:(unsigned int*)codec_id WithImageWidth:(unsigned int *)width ImageHeight:(unsigned int *)height;</code></pre> <h3>TK_getSnapShotImageWithChannel</h3> <pre><code>/** get snapshot image @param channel av channel index @return snapshot image */ - (UIImage *)TK_getSnapShotImageWithChannel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c"> Example: [self.myCamera TK_getSnapShotImageWithChannel:0];</code></pre> <h2>1.7 Send Command</h2> <h3>1.7.1 P2P</h3> <h4>TK_sendIOCtrlToChannel</h4> <pre><code>/** send IO command for specified channel @param channel av channel index @param type command type @param buff command data @param buffer_size size of command */ - (void)TK_sendIOCtrlToChannel:(NSInteger)channel Type:(NSInteger)type Data:(char *)buff DataSize:(NSInteger)buffer_size;</code></pre> <pre><code class="language-objective-c"> Example: SMsgAVIoctrlGetSupportStreamReq *s = (SMsgAVIoctrlGetSupportStreamReq *)malloc(sizeof(SMsgAVIoctrlGetSupportStreamReq));     memset(s, 0, sizeof(SMsgAVIoctrlGetSupportStreamReq));     [self.myCamera TK_sendIOCtrlToChannel:channel                          Type:IOTYPE_USER_IPCAM_GETSUPPORTSTREAM_REQ                          Data:(char *)s                      DataSize:sizeof(SMsgAVIoctrlGetSupportStreamReq)];     free(s);</code></pre> <h4>TK_sendJsonIOCtrlToChannel</h4> <pre><code>/** send json command for specified channel @param channel av channel index @param data command data @param responseBlock command response @param timeout timeout */ - (void)TK_sendJsonIOCtrlToChannel:(NSInteger)channel data:(NSData *)data responseBlock:(nonnull DataBlock)responseBlock timeout:(NSInteger)timeout;</code></pre> <pre><code class="language-objective-c"> Example: NSString *url = [NSString stringWithFormat:@&amp;quot;%@%@?stoken=%@&amp;quot;,vsaasURL, self.uid, deviceToken]; //    NSString *accessToken = [NSString stringWithFormat:@&amp;quot;Bearer %@&amp;quot;,amToken];     NSDictionary *header = @{@&amp;quot;Authentication&amp;quot;: vsaasToken,                              @&amp;quot;User-Agent&amp;quot;: @&amp;quot;TUTK Device&amp;quot;};     NSDictionary *args   = @{@&amp;quot;url&amp;quot;: url};     NSDictionary *param  = @{@&amp;quot;func&amp;quot;: @&amp;quot;setCloudRecordingEndpoint&amp;quot;,                              @&amp;quot;args&amp;quot;: args,                              @&amp;quot;header&amp;quot;: header};     NSError *error = nil;     NSData *jsonData = [NSJSONSerialization dataWithJSONObject:param options:NSJSONWritingPrettyPrinted error:&amp;amp;error];     NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];     NSData *requsetData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];     [self.myCamera TK_sendJsonIOCtrlToChannel:channel data:requsetData responseBlock:^(NSData *data) {         completion(data);     } timeout:5];</code></pre> <h4>TK_removeAllCmd</h4> <pre><code>/** remove command queue  @param channel av channel index  */ - (void)TK_removeAllCmd:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c">Example: [camera TK_removeAllCmd:0];</code></pre> <h3>1.7.2 Nebula</h3> <h4>TK_nebulaSendData</h4> <pre><code>/** Nebula send nebula command and response  @param jsonData command data  @param udid device udid 40 bytes  @param responseBlock response  @param timeout timeout /second  */ - (void)TK_nebulaSendData: (NSString *)jsonData udid: (NSString *)udid responseBlock: (DataBlock)responseBlock timeout: (NSInteger)timeout;</code></pre> <pre><code class="language-objective-c"> Example:   NSDictionary *func = @{         @&amp;quot;func&amp;quot;:@&amp;quot;getChannelNames&amp;quot;,     };     NSError *error = nil;     NSData *jsonData = [NSJSONSerialization dataWithJSONObject:func options:NSJSONWritingPrettyPrinted error:&amp;amp;error];     NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];     [self.myCamera TK_nebulaSendData:jsonString udid:uid responseBlock:^(NSData *data) {         responseData(data);     } timeout:5];</code></pre> <h2>1.8 upload and download file</h2> <h4>TK_startDownload</h4> <pre><code>/** start downloading file @param type transfer type @param path path of store file @param channel channel */ - (void)TK_startDownload:(TKTransferType)type  channel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c">Example: [self.myCamera TK_startDownload:TKTransferType_AVAPI channel:1];</code></pre> <h4>TK_stopDownload</h4> <pre><code>/** stop downloading file @param type transfer type @param channel channel */ - (void)TK_stopDownload:(TKTransferType)type  channel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c">Example: [self.myCamera TK_stopDownload:TKTransferType_AVAPI channel:1];</code></pre> <h4>TK_startUpload</h4> <pre><code>/** start uploading file @param type transfer type @fileName filename @param channel channel @param endFlag endflag of file */ - (void)TK_startUpload:(TKTransferType)type fileName:(NSString *)fileName channel:(NSInteger)channel endFlag:(NSInteger)endFlag;</code></pre> <pre><code class="language-objective-c">Example: [self.myCamera TK_startUpload:TKTransferType_AVAPI fileName:@&amp;quot;2023041901.mp4&amp;quot; channel:1];</code></pre> <h4>TK_stopUpload</h4> <pre><code>/** stop uploading file @param type transfer type @param channel channel */ - (void)TK_stopUpload:(TKTransferType)type channel:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c">Example: [self.myCamera TK_stopUpload:TKTransferType_AVAPI channel:1];</code></pre> <h2>1.9 Double Video Call</h2> <h4>TK_startVideoToDevice</h4> <pre><code>/**  Start previewing and sending video data  @param previewView perview Viewer  @param previewFormat encode video format  @param channel channel index  @param obScreen obscreen display object  */ - (void)TK_startVideoToDevice:(UIView *)previewView</code></pre> <p>                previewFormat:(PreviewFormat)previewFormat                       channel:(NSInteger)channel                  ScreenObject:(NSObject*)obScreen;</p> <pre><code class="language-objective-c">Example:   PreviewFormat *format = (PreviewFormat *)malloc(sizeof(PreviewFormat));         format-&amp;gt;resolution = PreviewResolution_Low;         format-&amp;gt;fps = PreviewFPS_Low;         format-&amp;gt;gop = PreviewGOP_Low;         format-&amp;gt;orientation = AVCaptureVideoOrientationPortrait;         format-&amp;gt;bitrate = PreviewBitRate_Low; [self.camera TK_startVideoToDevice:self.preView previewFormat:*format channel:self.selectChannel ScreenObject:self];</code></pre> <h4>TK_stopVideoToDevice</h4> <pre><code>/**  Stop previewing and sending video data  @param channel channel  */ - (void)TK_stopVideoToDevice:(NSInteger)channel;</code></pre> <pre><code class="language-objective-c">Example: [self.camera TK_stopVideoToDevice:self.selectChannel];</code></pre> <h4>TK_preview_switchCamera</h4> <pre><code>/**  Switch front and rear cameras  @param positon set camera  */ - (void)TK_preview_switchCamera:(AVCaptureDevicePosition)positon;</code></pre> <pre><code class="language-objective-c">Example: [self.camera TK_preview_switchCamera:AVCaptureDevicePositionFront];</code></pre> <h4>TK_preview_changePreviewFormat</h4> <pre><code>/**</code></pre> <p>  Change captured video quality level  @param previewFormat encode format  @param presetBlock whether support preset or not  */</p> <pre><code>- (void)TK_preview_changePreviewFormat:(PreviewFormat)previewFormat presetBlock:(PresetBlock)presetBlock;</code></pre> <pre><code class="language-objective-c">Example:   PreviewFormat *format = (PreviewFormat *)malloc(sizeof(PreviewFormat));         format-&amp;gt;resolution = PreviewResolution_Low;         format-&amp;gt;fps = PreviewFPS_Low;         format-&amp;gt;gop = PreviewGOP_Low;         format-&amp;gt;orientation = AVCaptureVideoOrientationPortrait;         format-&amp;gt;bitrate = PreviewBitRate_Low; [self.camera TK_preview_changePreviewFormat:format presetBlock:^{ }];</code></pre> <h4>TK_isVideoOutputavChannel</h4> <pre><code>/** Collect video data and throw it up  @param avChannel av channel index  @param isSendVideo whether throw sending video data up or not  */ - (void)TK_isVideoOutputavChannel:(NSInteger)avChannel</code></pre> <p>                      isSendVideo:(BOOL)isSendVideo;</p> <pre><code class="language-objective-c">Example: [self.camera TK_isVideoOutputavChannel:0 isSendVideo:YES];</code></pre> <h4>TK_sendVideo</h4> <pre><code>/**  client start send video data</code></pre> <p>  @param videoData video data   @param length lenth of video data  @param codec video format  @param isKeyFrame whether is KeyFrame or not  @param channel av channel index  */</p> <ul> <li>(void) TK_sendVideo:(NSData *)videoData                Length:(NSInteger)length                 Codec:(NSInteger)codec            isKeyFrame:(BOOL)isKeyFrame               channel:(NSInteger)channel; <pre><code class="language-objective-c">Example: [self.camera TK_sendVideo:data Length:data.length Codec:MEDIA_CODEC_VIDEO_H264 isKeyFrame:isKeyFrame channel:channell];</code></pre></li> </ul> <h1>二、Command encapsulation</h1> <h2>2.1 TK_commandNebulaSsidListReq</h2> <pre><code>/** AP获取WiFi列表 @param maxCount 列表数量 @param responseBlock 获取WiFiList回调 */ -(void)TK_commandNebulaSsidListReq:(NSInteger)maxCount responseWifiListBlock:(void(^)(NSArray *wifiList))responseBlock;</code></pre> <h2>2.2 TK_commandNebulaSetWifiReq</h2> <pre><code>/** get WiFi list of Nebula @param ssid WiFi ssid @param password WiFi password @param enctype enctype @param responseBlock set response block */ -(void)TK_commandNebulaSetWifiReq:(NSString *)ssid password:(NSString *)password enctype:(NSInteger)enctype responseSetWifiBlock:(void(^)(NSDictionary *resultDict))responseBlock;</code></pre> <h2>2.3 TK_commandSupportStreamWithChannel</h2> <pre><code>/** get channel number of support stream @param channel av channel index @param completion response block of channels */ -(void)TK_commandSupportStreamWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandSupportStream *))completion;</code></pre> <h2>2.4 TK_commandListWifiWithChannel</h2> <pre><code>/** get WiFi list of IO @param channel av channel index @param completion response block of wifi list */ -(void)TK_commandListWifiWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandListWifi *))completion;</code></pre> <h2>2.5 TK_commandSetWifiWithChannel</h2> <pre><code>/** set devcie WiFi network @param channel av channel index @param ssid WiFi SSID of connected @param password WiFi SSID password @param enctype // refer to ENUM_AP_MODE @param mode // refer to ENUM_AP_ENCTYPE @param completion response block of device wifi */ -(void)TK_commandSetWifiWithChannel:(NSInteger)channel ssid:(NSString *)ssid password:(NSString *)password enctype:(NSInteger)enctype mode:(NSInteger)mode completion:(void(^)(KalayCommandSetWifi *))completion;</code></pre> <h2>2.6 TK_commandGetWifiWithChannel</h2> <pre><code>/** get the current wifi of devicee @param channel av channel @param completion response block of current device wifi */ -(void)TK_commandGetWifiWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetWifi *))completion;</code></pre> <h2>2.7 TK_commandGetAudioOutFormatWithChannel</h2> <pre><code>/** get device audio format @param channel av channel index */ -(void)TK_commandGetAudioOutFormatWithChannel:(NSInteger)channel;</code></pre> <h2>2.8 TK_commandCallWithChannel</h2> <pre><code>/** get door bell call @param channel av channel @param completion response block of door bell call */ -(void)TK_commandCallWithChannel:(NSInteger)channel answer:(NSInteger)answer completion:(void(^)(KalayCommandCall *))completion;</code></pre> <h2>2.9 TK_commandDeviceInfoWithChannel</h2> <pre><code>/** get device information @param channel av channel @param completion response block of device information */ -(void)TK_commandDeviceInfoWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandDeviceInfo *))completion;</code></pre> <h2>2.10 TK_commandGetRecordWithChannel</h2> <pre><code>/** get device sd Card recording mode @param channel av channel @param completion response block of sd Card recording mode */ -(void)TK_commandGetRecordWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetRecord *))completion;</code></pre> <h2>2.11 TK_commandSetRecordWithChannel</h2> <pre><code>/** set device sd Card recording mode @param channel av channel @param parameter request params @param completion response block of set device sd Card recording mode */ -(void)TK_commandSetRecordWithChannel:(NSInteger)channel parameter:(NSDictionary *)parameter completion:(void(^)(KalayCommandSetRecord *))completion;</code></pre> <h2>2.12 TK_commandGetStreamWithChannel</h2> <pre><code>/** get device stream resolutoin @param channel av channel @param completion response block of get device stream resolutoin */ -(void)TK_commandGetStreamWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetStream *))completion;</code></pre> <h2>2.13 TK_commandSetStreamWithChannel</h2> <pre><code>/** set device stream resolutoin @param channel av channel @param quality // refer to ENUM_QUALITY_LEVEL @param completion response block of set device stream resolutoin */ -(void)TK_commandSetStreamWithChannel:(NSInteger)channel quality:(NSInteger)quality completion:(void(^)(KalayCommandSetStream *))completion;</code></pre> <h2>2.14 TK_commandGetMotionDetectWithChannel</h2> <pre><code>/** Get the sensitivity of device displacement detection @param channel av channel @param completion response block of get the sensitivity of device displacement detection */ -(void)TK_commandGetMotionDetectWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetMotionDetect *))completion;</code></pre> <h2>2.15 TK_commandSetMotionDetectWithChannel</h2> <pre><code>/** set the sensitivity of device displacement detection @param channel av chanel @param sensitivity 0(denied) ~ 100(max) @param completion response block of set the sensitivity of device displacement detection */ -(void)TK_commandSetMotionDetectWithChannel:(NSInteger)channel sensitivity:(NSInteger)sensitivity completion:(void(^)(KalayCommandSetMotionDetect *))completion;</code></pre> <h2>2.16 TK_commandSetPasswdWithChannel</h2> <pre><code>/** set device password @param channel av channel index @param oldpasswd old password @param newpasswd new password @param completion response block of set password */ -(void)TK_commandSetPasswdWithChannel:(NSInteger)channel oldpasswd:(NSString *)oldpasswd newpasswd:(NSString *)newpasswd completion:(void(^)(KalayCommandSetPasswd *))completion;</code></pre> <h2>2.17 TK_commandSetVideoModeWithChannel</h2> <pre><code>/** Set screen mirroring/flip status @param channel av channel @param mode // refer to ENUM_VIDEO_MODE @param completion response block of set screen mirroring/flip status */ -(void)TK_commandSetVideoModeWithChannel:(NSInteger)channel mode:(NSInteger)mode completion:(void(^)(KalayCommandSetVideoMode *))completion;</code></pre> <h2>2.18 TK_commandGetVideoModeWithChannel</h2> <pre><code>/** get screen mirroring/flip status @param channel av channel @param completion response block of get screen mirroring/flip status */ -(void)TK_commandGetVideoModeWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetVideoMode *))completion;</code></pre> <h2>2.19 TK_commandGetChannelNameWithChannel</h2> <pre><code>/** format SD Card @param channel av channel @param storage //(For example sdcard slot = 0, internal flash = 1 ...) @param completion response block of format SD Card */ -(void)TK_commandFormatExtStorageWithChannel:(NSInteger)channel storage:(NSInteger)storage completion:(void(^)(KalayCommandFormatExtStorage *))completion; /** get channel name @param channel av channel @param completion response block of get channel name */ -(void)TK_commandGetChannelNameWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetChannelName *))completion;</code></pre> <h2>2.20 TK_commandSetChannelNameWithChannel</h2> <pre><code>/** set channel name @param channel av channel @param channelName channel name @param completion response block of set channel name */ -(void)TK_commandSetChannelNameWithChannel:(NSInteger)channel channelName:(NSString *)channelName completion:(void(^)(KalayCommandSetChannelName *))completion;</code></pre> <h2>2.21 TK_commandGetDeviceNameWithChannel</h2> <pre><code>/** get current name of channel @param channel av channel @param deviceName device name @param completion response block of get current name of channel */ -(void)TK_commandGetDeviceNameWithChannel:(NSInteger)channel deviceName:(NSString *)deviceName completion:(void(^)(KalayCommandPushDeviceName *))completion;</code></pre> <h2>2.22 TK_commandTimeSyncWithChannel</h2> <pre><code>/** time sync @param channel av channel @param completion response block of time sync */ -(void)TK_commandTimeSyncWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandTimeSync *))completion;</code></pre> <h2>2.23 TK_commandPtzWithChannel</h2> <pre><code>/** device PTZ control @param channel av channel @param ptz // refer to ENUM_PTZCMD @param completion response block of device PTZ control */ -(void)TK_commandPtzWithChannel:(NSInteger)channel ptz:(NSInteger)ptz completion:(void(^)(KalayCommandPtz *))completion;</code></pre> <h2>2.24 TK_commandOTAWithChannel</h2> <pre><code>/** device OTA @param channel av channel @param fileChecksum file @param url URL @param fileSize fileSize @param completion response block of device OTA */ -(void)TK_commandOTAWithChannel:(NSInteger)channel fileChecksum:(NSString *)fileChecksum url:(NSString *)url fileSize:(NSInteger)fileSize completion:(void(^)(KalayCommandOTA *))completion;</code></pre> <h2>2.25 TK_commandDeviceSupportOTAWithChannel</h2> <pre><code>/** get response of whether support OTA or not @param channel av chanel @param completion response block of get response of whether support OTA or not */ -(void)TK_commandDeviceSupportOTAWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandDeviceSupportOTA *))completion;</code></pre> <h2>2.26 TK_commandDeviceSupportCloudWithChannel</h2> <pre><code>/** get response of whether support Cloud or not @param channel av channel @param completion response block of get response of whether support Cloud or not */ -(void)TK_commandDeviceSupportCloudWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandDeviceSupportCloud *))completion;</code></pre> <h2>2.27 TK_commandSetCloudWithChannel</h2> <pre><code>/** set state of device cloud @param channel av channel @param isOn // 1 open, 0 closed @param completion response block of set state of device cloud */ -(void)TK_commandSetCloudWithChannel:(NSInteger)channel isOn:(NSInteger)isOn completion:(void(^)(KalayCommandSetCloud *))completion;</code></pre> <h2>2.28 TK_commandGetCloudWithChannel</h2> <pre><code>/** get state of device cloud @param channel av chanel @param completion response block of get state of device cloud */ -(void)TK_commandGetCloudWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetCloud *))completion;</code></pre> <h2>2.29 TK_commandSetHumanDetectionWithChannel</h2> <pre><code>/** set state of device HumanDetection @param channel av channel index @param isOn // 1 open, 0 close @param completion response block of set state of device HumanDetection */ -(void)TK_commandSetHumanDetectionWithChannel:(NSInteger)channel isOn:(NSInteger)isOn completion:(void(^)(KalayCommandSetHumanDetection *))completion;</code></pre> <h2>2.30 TK_commandGetHumanDetectionWithChannel</h2> <pre><code>/** get state of device HumanDetection @param channel av channel @param completion response block of get state of device HumanDetection */ -(void)TK_commandGetHumanDetectionWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetHumanDetection *))completion;</code></pre> <h2>2.31 TK_commandSetNightVisionWithChannel</h2> <pre><code>/** set state of device night vision @param channel av channel @param isOn // 1 open, 0 close @param completion response block of set state of device night vision */ -(void)TK_commandSetNightVisionWithChannel:(NSInteger)channel isOn:(NSInteger)isOn completion:(void(^)(KalayCommandSetNightVision *))completion;</code></pre> <h2>2.32 TK_commandGetNightVisionWithChannel</h2> <pre><code>/** get state of device night vision @param channel av channel @param completion response block of get state of device night vision */ -(void)TK_commandGetNightVisionWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetNightVision *))completion;</code></pre> <h2>2.33 TK_commandSetSummerTimeWithChannel</h2> <pre><code>/** set state of device summer time switch @param channel av channel @param isOn // 1 open, 0 close @param completion response block of set state of device summer time switch */ -(void)TK_commandSetSummerTimeWithChannel:(NSInteger)channel isOn:(NSInteger)isOn completion:(void(^)(KalayCommandSetSummerTime *))completion;</code></pre> <h2>2.34 TK_commandGetSummerTimeWithChannel</h2> <pre><code>/** get state of device summer time switch @param channel av channel @param completion response block of get state of device summer time switch */ -(void)TK_commandGetSummerTimeWithChannel:(NSInteger)channel completion:(void(^)(KalayCommandGetSummerTime *))completion;</code></pre> <h2>2.35 TK_commandListEventWithChannel</h2> <pre><code>/** get eventlist @param channel av channel @param event // refer to ENUM_EVENTTYPE @param stStartTime start time @param stEndTime end time @param completion response block of get eventlist */ -(void)TK_commandListEventWithChannel:(NSInteger)channel event:(NSInteger)event stStartTime:(STimeDay)stStartTime stEndTime:(STimeDay)stEndTime completion:(void(^)(KalayCommandListEvent *))completion;</code></pre> <h2>2.36 TK_commandPlayRecordWithChannel</h2> <pre><code>/** Event playback control @param channel av channel @param parameter playback parameters /** { event time &amp;amp; ENUM_PLAYCONTROL } @param completion response block of event playback control */ -(void)TK_commandPlayRecordWithChannel:(NSInteger)channel parameter:(NSDictionary *)parameter completion:(void(^)(KalayCommandPlayRecord *))completion;</code></pre> <h2>2.37 TK_commandGetPlaybackWithChannel</h2> <pre><code>/** get progress of event playback @param channel av channel @param stTimeDay event time @param completion response block of progress of event playback */ -(void)TK_commandGetPlaybackWithChannel:(NSInteger)channel stTimeDay:(STimeDay)stTimeDay completion:(void(^)(KalayCommandGetPlayback *))completion;</code></pre> <h2>2.38 TK_commandSetRecordProgessWithChannel</h2> <pre><code>/** set progress of event playback @param channel av channel @param progressTime progress time(second) @param completion response block of set progress of event playback */ -(void)TK_commandSetRecordProgessWithChannel:(NSInteger)channel stTimeDay:(STimeDay)stTimeDay progressTime:(NSInteger)progressTime completion:(void(^)(KalayCommandSetRecordProgess *))completion;</code></pre> <h2>2.39 TK_commandGetEventDateWithChannel</h2> <pre><code>/** get event date when owned SD Card @param channel av channel @param event // refer to ENUM_EVENTTYPE @param stStartTime start time @param stEndTime end time @param completion response block of get event date when owned SD Card */ -(void)TK_commandGetEventDateWithChannel:(NSInteger)channel event:(NSInteger)event stStartTime:(STimeDay)stStartTime stEndTime:(STimeDay)stEndTime completion:(void(^)(KalayCommandGetEventDate *))completion;</code></pre> <h2>2.40 TK_commandGetStorageInfoWithChannel</h2> <pre><code>/** get storage size for sdk 4.x @param channel av channel @param value // [&amp;quot;sdcard&amp;quot;, &amp;quot;usb&amp;quot;] @param completion response block of get storage size */ -(void)TK_commandGetStorageInfoWithChannel:(NSInteger)channel value:(NSString *)value completion:(void(^)(KalayCommandSDInfo *))completion;</code></pre>

页面列表

ITEM_HTML