Kalay1.0鸿蒙版PSC

KalaySDK升级版PSC


HarmonyOS Next API

<p>[TOC]</p> <p>&lt;a id=&quot;1.1&quot;&gt;&lt;/a&gt;</p> <h2>1.1 Init/Uninit</h2> <p>&lt;a id=&quot;1.1.1&quot;&gt;&lt;/a&gt;</p> <h3>1.1.1 TK_InitIOTC</h3> <pre><code>/** IOTC initialization @param licenseKey Key value initialized by IOTC SDK @param privateKey Key value initialized by PSC (valid only when used within the validity period) @param app_id APP id @return error code &amp;gt;= 0 success, other failer */ export const TK_InitIOTC: (licenseKey: string, privateKey: string, app_id: string) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> 示例: let ret = Camera.TK_InitIOTC(licenseKey, privateKey, app_id); </code></pre> <p>&lt;a id=&quot;1.1.2&quot;&gt;&lt;/a&gt;</p> <h3>1.1.2 TK_uninitIOTC</h3> <pre><code>/** IOTC uninitialization */ export const TK_uninitIOTC: () =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> 示例: Camera.TK_uninitIOTC();</code></pre> <p>&lt;a id=&quot;1.1.3&quot;&gt;&lt;/a&gt;</p> <h3>1.1.3 TK_LanSearch</h3> <pre><code>/** Search for devices within the local LAN @param timeout search timeout @param callback 1. The number of searched devices, 2. The searched device information structure array Data&amp;lt;[LanSearchInfo]&amp;gt; */ export const TK_LanSearch: (timeout: number, cb: (arg: LanSearchInfo[]) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_LanSearch(5000, (infos: LanSearchInfo[]) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.1.4&quot;&gt;&lt;/a&gt;</p> <h3>1.1.4 TK_Set_Log_Attr</h3> <pre><code>/** Set up Log records @param filepath log file path */ export const TK_Set_Log_Attr: (filepath: string) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_Set_Log_Attr(filepath)</code></pre> <hr /> <p>&lt;a id=&quot;1.1.5&quot;&gt;&lt;/a&gt;</p> <h3>1.1.5 TK_getIOTCVersion</h3> <pre><code>/** Get IOTC SDK version @return version string */ export const TK_getIOTCVersion: () =&amp;gt; string;</code></pre> <pre><code class="language-javascript"> Example: let versionStr = Camera.TK_getIOTCVersion();</code></pre> <hr /> <p>&lt;a id=&quot;1.1.6&quot;&gt;&lt;/a&gt;</p> <h3>1.1.6 TK_getIOTCameraVersion</h3> <pre><code>/** Get IOTCamera version @return version string */ export const TK_getIOTCameraVersion: () =&amp;gt; string;</code></pre> <pre><code class="language-javascript"> Example: let versionStr = Camera.TK_getIOTCameraVersion();</code></pre> <hr /> <p>&lt;a id=&quot;1.2&quot;&gt;&lt;/a&gt;</p> <h2>1.2 Video/Audio</h2> <p>&lt;a id=&quot;1.2.1&quot;&gt;&lt;/a&gt;</p> <h3>1.2.1 TK_connect</h3> <pre><code> /** Connecting device @param uid device UID @param authKey key for online verification */ export const TK_connect: (uid: string, authkey: string) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_connect: (uid, authkey)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.2&quot;&gt;&lt;/a&gt;</p> <h3>1.2.2 TK_disconnect</h3> <pre><code> /** Disconnect device @param uid device UID */ export const TK_disconnect: (uid: string) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_disconnect: (uid)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.3&quot;&gt;&lt;/a&gt;</p> <h3>1.2.3 TK_start</h3> <pre><code> /** Start connecting av channel @param uid device uid @param channel av channel @param password device password @param account device account */ export const TK_start: (uid: string, channel: number, password: string, account: string) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_start: (uid, channel, password, account)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.4&quot;&gt;&lt;/a&gt;</p> <h3>1.2.4 TK_stop</h3> <pre><code> /** Close av channel @param uid device uid @param channel av channel */ export const TK_stop: (uid: string, channel: number) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_stop: (uid, channel)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.5&quot;&gt;&lt;/a&gt;</p> <h3>1.2.5 TK_startShow</h3> <pre><code> /** Start reiceve and decoding and display video @param uid device uid @param channel av channel */ export const TK_startShow: (uid: string, channel: number) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_startShow: (uid, channel)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.6&quot;&gt;&lt;/a&gt;</p> <h3>1.2.6 TK_stopShow</h3> <pre><code> /** Stop reiceve and decoding and display video @param uid device uid @param channel av channel */ export const TK_stopShow: (uid: string, channel: number) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_stopShow: (uid, channel)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.7&quot;&gt;&lt;/a&gt;</p> <h3>1.2.7 TK_startSoundToPhone</h3> <pre><code> /** Start reiceve and decoding and display audio @param uid device uid @param channel av channel */ export const TK_startSoundToPhone: (uid: string, channel: number) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_startSoundToPhone: (uid, channel)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.8&quot;&gt;&lt;/a&gt;</p> <h3>1.2.8 TK_stopSoundToPhone</h3> <pre><code> /** Stop reiceve and decoding and display audio @param uid device uid @param channel av channel */ export const TK_stopSoundToPhone: (uid: string, channel: number) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_stopSoundToPhone: (uid, channel)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.9&quot;&gt;&lt;/a&gt;</p> <h3>1.2.9 TK_startSoundToDevice</h3> <pre><code> /** Start Talking (send audio to device) @param uid device uid @param channel av channel @param isResend whether to resend */ export const TK_startSoundToDevice: (uid: string, channel: number, isResend: boolean) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_startSoundToDevice: (uid, channel, true)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.10&quot;&gt;&lt;/a&gt;</p> <h3>1.2.10 TK_stopSoundToDevice</h3> <pre><code> /** Stop Talking @param uid device uid @param channel av channel */ export const TK_stopSoundToDevice: (uid: string, channel: number) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_stopSoundToDevice: (uid, channel)</code></pre> <hr /> <p>&lt;a id=&quot;1.2.11&quot;&gt;&lt;/a&gt;</p> <h3>1.2.11 TK_setHWDecodingAbility</h3> <pre><code> /** Set the decoding method of the specified channel @param uid device uid @param channel av channel @param isHWDecode Whether to hard decode (YES means hard decoding, NO means soft decoding) */ export const TK_setHWDecodingAbility: (uid: string, channel: number, isHWDecode: boolean) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_setHWDecodingAbility: (uid, channel, true)</code></pre> <hr /> <p>&lt;a id=&quot;1.3&quot;&gt;&lt;/a&gt;</p> <h2>1.3 Recording/Snapshot</h2> <p>&lt;a id=&quot;1.3.1&quot;&gt;&lt;/a&gt;</p> <h3>1.3.1 TK_startRecording</h3> <pre><code> /** Capture the picture displayed by liveView @param uid device uid @param channel av channel @param filepath The path of the file saved to the sandbox */ export const TK_snapshot: (uid: string, channel: number, filepath: string) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_snapshot: (uid, channel, filepath)</code></pre> <hr /> <p>&lt;a id=&quot;1.3.2&quot;&gt;&lt;/a&gt;</p> <h3>1.3.2 TK_startRecording</h3> <pre><code> /** Start local recording function @param uid device uid @param channel av channel @param filepath The path of the file saved to the sandbox @param isListening whether to playing audio */ export const TK_startRecording: (uid: string, channel: number, filepath: string, isListening: boolean) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_startRecording: (uid, channel, filepath, false)</code></pre> <hr /> <p>&lt;a id=&quot;1.3.3&quot;&gt;&lt;/a&gt;</p> <h3>1.3.3 TK_stopRecording</h3> <pre><code> /** Stop local recording function @param uid device uid @param channel av channel */ export const TK_stopRecording: (uid: string, channel: number) =&amp;gt; number;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_stopRecording: (uid, channel)</code></pre> <hr /> <p>&lt;a id=&quot;1.4&quot;&gt;&lt;/a&gt;</p> <h2>1.4 Send Command</h2> <p>&lt;a id=&quot;1.4.1&quot;&gt;&lt;/a&gt;</p> <h3>1.4.1 TK_sendIOCtrlToChannel</h3> <pre><code>/** Send data specified by the Command to the device @param uid device uid @param channel channel to which the device is connected (default is 0) @param type command instruction type, AVIOCTRLDEFs.h @param buff commandThe structure data corresponding to the instruction @param buffer_size commandThe structure data length @param isJSON whether to JSON Data */ export const TK_sendIOCtrlToChannel: (uid: string, channel: number, type: number, buff: Uint8Array, buffer_size: number, isJson: boolean) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_sendIOCtrlToChannel: (uid, channel, iotype, iodata, iodata_size, false)</code></pre> <hr /> <p>&lt;a id=&quot;1.5&quot;&gt;&lt;/a&gt;</p> <h2>1.5 CallBack</h2> <p>&lt;a id=&quot;1.5.1&quot;&gt;&lt;/a&gt;</p> <h3>1.5.1 TK_sessionStateCallBack</h3> <pre><code>/** iotc session status callback @param uid device uid @param cb iotc session status callback */ export const TK_sessionStateCallBack: (uid: string, cb: (arg: cameraSessionState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_sessionStateCallBack(this.uid, (state: cameraSessionState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.5.2&quot;&gt;&lt;/a&gt;</p> <h3>1.5.2 TK_channelStateCallBack</h3> <pre><code>/** Specify the connection status callback of the av channel @param uid device uid @param cb av channel status callback */ export const TK_channelStateCallBack: (uid: string, cb: (arg: cameraChannelState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_channelStateCallBack(this.uid, (state: cameraChannelState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.5.3&quot;&gt;&lt;/a&gt;</p> <h3>1.5.3 TK_recvIOCtrlCallBack</h3> <pre><code>/** the IOCtrl send status callback @param uid device uid @param cb the IOCtrl send status callback */ export const TK_recvIOCtrlCallBack: (uid: string, cb: (arg: recvIOCtrlState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_recvIOCtrlCallBack(this.uid, (state: recvIOCtrlState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.5.4&quot;&gt;&lt;/a&gt;</p> <h3>1.5.4 TK_recvFrameInfoCallBack</h3> <pre><code>/** Specify the debug status callback of the av channel @param uid device uid @param cb debug status callback */ export const TK_recvFrameInfoCallBack: (uid: string, cb: (arg: recvFrameInfoState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_recvFrameInfoCallBack(this.uid, (state: recvFrameInfoState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.5.5&quot;&gt;&lt;/a&gt;</p> <h3>1.5.5 TK_recordingStateCallBack</h3> <pre><code>/** Specify the local recording status callback of the av channel @param uid device uid @param cb local recording status callback */ export const TK_recordingStateCallBack: (uid: string, cb: (arg: recordingState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_recordingStateCallBack(this.uid, (state: recordingState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.5.6&quot;&gt;&lt;/a&gt;</p> <h3>1.5.6 TK_startShowCallBack</h3> <pre><code> /** Specify the video decoding status callback of the av channel @param uid device uid @param cb video decoding status callback */ export const TK_startShowCallBack: (uid: string, cb: (arg: startShowState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_startShowCallBack(this.uid, (state: startShowState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.5.7&quot;&gt;&lt;/a&gt;</p> <h3>1.5.7 TK_startListenCallBack</h3> <pre><code>/** Specify the audio decoding status callback of the av channel @param uid device uid @param cb audio decoding status callback */ export const TK_startListenCallBack: (uid: string, cb: (arg: startListenState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_startListenCallBack(this.uid, (state: startListenState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.5.8&quot;&gt;&lt;/a&gt;</p> <h3>1.5.8 TK_startTalkCallBack</h3> <pre><code> /** The audio talking status callback @param uid device uid @param cb audio talking status callback */ export const TK_startTalkCallBack: (uid: string, cb: (arg: startTalkState) =&amp;gt; void) =&amp;gt; void;</code></pre> <pre><code class="language-javascript"> Example: camera.TK_startTalkCallBack(this.uid, (state: startTalkState) =&amp;gt; { })</code></pre> <hr /> <p>&lt;a id=&quot;1.6&quot;&gt;&lt;/a&gt;</p> <h2>1.6 STATE</h2> <p>&lt;a id=&quot;1.6.1&quot;&gt;&lt;/a&gt;</p> <h3>1.6.1 CONNECTION_STATE</h3> <pre><code>export enum CONNECTION_STATE { case NONE = 0 //Initialize connection status case CONNECTING = 1 //The device is connecting and the status has not been returned. case CONNECTED = 2 //The device is connected, return status &amp;gt;= 0 case DISCONNECTED = 3 //The device is not connected, return status -22 AV other case UNKNOWN_DEVICE = 4 //Unknown device returns status -15 case WRONG_PASSWORD = 5 //The device connection password is incorrect. Return status -20009 case TIMEOUT = 6 //Device connection timeout returns status -13 -23 -20016 -20011 case UNSUPPORTED = 7 //The device is not supported and returns status -40 case CONNECT_FAILED = 8 //Device connection failed Others case UNKNOWN_LICENSE = 9 //The device uid is not in the license and the return status is -10 case SLEEP = 10 //Device sleep state return status -64 case DEVICE_MAX_SESSION = 11 //Exceeds the maximum number of device connections and returns status -48 case POOR_NETWORKSIGNAL = 12 //Poor network signal return status -19 -42 case WRONG_AUTHKEY = 13 //authkey is incorrect, return status -46 -68 }</code></pre>

页面列表

ITEM_HTML