From ae33e0d215b3b59fcc2055cd3f8bd105aeab3a04 Mon Sep 17 00:00:00 2001 From: linzlinz <2495670683@qq.com> Date: Mon, 18 Aug 2025 22:27:35 +0800 Subject: [PATCH] add sdk Signed-off-by: linzlinz <2495670683@qq.com> --- api/@ohos.bluetooth.socket.d.ts | 37 ++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/api/@ohos.bluetooth.socket.d.ts b/api/@ohos.bluetooth.socket.d.ts index c44b7866c5..d7a27bc0a0 100644 --- a/api/@ohos.bluetooth.socket.d.ts +++ b/api/@ohos.bluetooth.socket.d.ts @@ -48,6 +48,16 @@ declare namespace socket { */ function sppListen(name: string, options: SppOptions, callback: AsyncCallback): void; + /** + * Get l2cap socket psm. + * + * @param { number } serverSocket - Indicates the server socket ID, returned by {@link sppListen}. + * @returns { number } Returns the l2cap socket psm + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 20 + * @arkts 1.1&1.2 + */ + function getL2capPsm(serverSocket: number): number; /** * Waits for a remote device to connect. * @@ -231,6 +241,15 @@ declare namespace socket { * @since 10 */ type: SppType; + /** + * l2cap protocol service multiplexer + * + * @type { ?number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 20 + * @arkts 1.1&1.2 + */ + psm?: number; } /** @@ -247,7 +266,23 @@ declare namespace socket { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ - SPP_RFCOMM + SPP_RFCOMM = 0, + /** + * L2CAP of the BR type + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 20 + * @arkts 1.1&1.2 + */ + SPP_L2CAP = 1, + /** + * L2CAP of the BLE type + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 20 + * @arkts 1.1&1.2 + */ + SPP_L2CAP_BLE = 2 } } -- Gitee