From 24a64da4a8ba12a182a172b25a26b2bc4eb7f7f7 Mon Sep 17 00:00:00 2001 From: wuxiaodong02 Date: Wed, 31 May 2023 14:54:03 +0800 Subject: [PATCH] update js-apis-device-manager. Signed-off-by: wuxiaodong02 --- .../reference/apis/js-apis-device-manager.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/zh-cn/application-dev/reference/apis/js-apis-device-manager.md b/zh-cn/application-dev/reference/apis/js-apis-device-manager.md index 1398c71c26..f8b84afa49 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-device-manager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-device-manager.md @@ -287,6 +287,44 @@ getTrustedDeviceListSync(): Array<DeviceInfo> console.error("getTrustedDeviceListSync errCode:" + err.code + ",errMessage:" + err.message); } ``` +### getTrustedDeviceListSync + +getTrustedDeviceListSync(isRefresh: boolean): Array<DeviceInfo> + +刷新可信设备列表,让周围可信设备快速上线。 + +**系统能力**:SystemCapability.DistributedHardware.DeviceManager + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------------- | --------------------------------- | ---- | ------------------------- | +| isRefresh | boolean | 是 | 是否刷新 | + +**返回值:** + +| 名称 | 说明 | +| -------------------------------------- | ---------------- | +| Array<[DeviceInfo](#deviceinfo)> | 返回可信设备列表。 | + +**错误码:** + +以下的错误码的详细介绍请参见[设备管理错误码](../errorcodes/errorcode-device-manager.md) + +| 错误码ID | 错误信息 | +| -------- | --------------------------------------------------------------- | +| 401 | Input parameter error. | +| 11600101 | Failed to execute the function. | + +**示例:** + + ```js + try { + var deviceInfoList = dmInstance.getTrustedDeviceListSync(true); + } catch (err) { + console.error("getTrustedDeviceListSync errCode:" + err.code + ",errMessage:" + err.message); + } + ``` ### getTrustedDeviceList8+ -- GitLab