From 45b9df8a64936ffd860fffe0d864f1455d585e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E9=80=9F=E5=BA=A6?= <1344114680@qq.com> Date: Tue, 29 Oct 2024 10:26:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?sendStream=20js=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kits/js/@ohos.dsoftbus.transmission.d.ts | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts b/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts index dd965fbbf..1ef1fc20e 100644 --- a/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts +++ b/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts @@ -101,6 +101,20 @@ declare namespace transmission { */ function sendMessage(socket: number, data: Uint8Array); + /** + * Sends stream data. + * + * @param { number } socket - Indicates the unique socket fd. + * @param { string } data - Indicatesthe stream data to send. + * @param { StreamFrameInfo } param - Indicatesthe param data to send. + * @throws { BusinessError } 202 - If the system permission is denied. + * @throws { BusinessError } 401 - If the reason is not valid. + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + function sendStream(socket: number, data: string, param?: StreamFrameInfo); + /** * Sends files data. * @@ -450,6 +464,30 @@ declare namespace transmission { * @since 12 */ DATA_TYPE_FILE, + /** + * Raw stream data. + * + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + DATA_TYPE_RAW_STREAM, + /** + * Video stream data. + * + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + DATA_TYPE_VIDEO_STREAM, + /** + * Audio stream data. + * + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + DATA_TYPE_AUDIO_STREAM, } /** @@ -522,6 +560,19 @@ declare namespace transmission { */ onMessage(socket: number, data: Uint8Array); + /** + * Called when stream data is received. + * This callback is invoked to notify that stream data is received. + * + * @param { number } socket - Indicates the unique socket fd. + * @param { string } data - Indicatesthe stream data to send. + * @param { StreamFrameInfo } param - Indicatesthe param data to send. + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + onStream(socket: number, data: string, param?: StreamFrameInfo); + /** * Called when file data is received. * This callback is invoked to notify that file data is received. @@ -624,6 +675,53 @@ declare namespace transmission { dataType?: TransDataType; } + /** + * Defines the frame information for stream transmission. + * + * @typedef StreamFrameInfo + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + interface StreamFrameInfo { + + /** + * TimeStamp. + * + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + timeStamp: number; + + /** + * SeqNum. + * + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + seqNum: number; + + /** + * seqSubNum. + * + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + seqSubNum: number; + + /** + * Level. + * + * @syscap SystemCapability.Dsoftbus.Transmission + * @systemapi + * @since 12 + */ + level: number; + } + /** * Defines the file event. * -- Gitee From 74345cfdd29120a637e82d175e0373483d2317c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E9=80=9F=E5=BA=A6?= <1344114680@qq.com> Date: Tue, 24 Dec 2024 11:50:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?js=20sendStream=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kits/js/@ohos.dsoftbus.transmission.d.ts | 98 ------------------- 1 file changed, 98 deletions(-) diff --git a/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts b/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts index 1ef1fc20e..dd965fbbf 100644 --- a/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts +++ b/interfaces/kits/js/@ohos.dsoftbus.transmission.d.ts @@ -101,20 +101,6 @@ declare namespace transmission { */ function sendMessage(socket: number, data: Uint8Array); - /** - * Sends stream data. - * - * @param { number } socket - Indicates the unique socket fd. - * @param { string } data - Indicatesthe stream data to send. - * @param { StreamFrameInfo } param - Indicatesthe param data to send. - * @throws { BusinessError } 202 - If the system permission is denied. - * @throws { BusinessError } 401 - If the reason is not valid. - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - function sendStream(socket: number, data: string, param?: StreamFrameInfo); - /** * Sends files data. * @@ -464,30 +450,6 @@ declare namespace transmission { * @since 12 */ DATA_TYPE_FILE, - /** - * Raw stream data. - * - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - DATA_TYPE_RAW_STREAM, - /** - * Video stream data. - * - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - DATA_TYPE_VIDEO_STREAM, - /** - * Audio stream data. - * - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - DATA_TYPE_AUDIO_STREAM, } /** @@ -560,19 +522,6 @@ declare namespace transmission { */ onMessage(socket: number, data: Uint8Array); - /** - * Called when stream data is received. - * This callback is invoked to notify that stream data is received. - * - * @param { number } socket - Indicates the unique socket fd. - * @param { string } data - Indicatesthe stream data to send. - * @param { StreamFrameInfo } param - Indicatesthe param data to send. - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - onStream(socket: number, data: string, param?: StreamFrameInfo); - /** * Called when file data is received. * This callback is invoked to notify that file data is received. @@ -675,53 +624,6 @@ declare namespace transmission { dataType?: TransDataType; } - /** - * Defines the frame information for stream transmission. - * - * @typedef StreamFrameInfo - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - interface StreamFrameInfo { - - /** - * TimeStamp. - * - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - timeStamp: number; - - /** - * SeqNum. - * - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - seqNum: number; - - /** - * seqSubNum. - * - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - seqSubNum: number; - - /** - * Level. - * - * @syscap SystemCapability.Dsoftbus.Transmission - * @systemapi - * @since 12 - */ - level: number; - } - /** * Defines the file event. * -- Gitee