From 101c481f2808fe1ce2044ee3d2c54069c24c0521 Mon Sep 17 00:00:00 2001 From: wangxuanxuan Date: Tue, 16 May 2023 16:27:52 +0800 Subject: [PATCH] modify DM API description Signed-off-by: wangxuanxuan --- .../reference/apis/js-apis-device-manager.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 2e7c46eae3..f07c791262 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 @@ -487,6 +487,8 @@ getDeviceInfo(networkId: string, callback:AsyncCallback<DeviceInfo>): void ```js try { + // 设备网络标识,可以从可信设备列表中获取 + let networkId = "xxxxxxx" dmInstance.getDeviceInfo(networkId, (err, data) => { if (err) { console.error("getDeviceInfo errCode:" + err.code + ",errMessage:" + err.message); @@ -530,6 +532,8 @@ getDeviceInfo(networkId: string): Promise<DeviceInfo> **示例:** ```js + // 设备网络标识,可以从可信设备列表中获取 + let networkId = "xxxxxxx" dmInstance.getDeviceInfo(networkId).then((data) => { console.log('get device info: ' + JSON.stringify(data)); }).catch((err) => { @@ -944,11 +948,11 @@ requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{regi "userId" : "123" } try { - dmClass.requestCredentialRegisterInfo(credentialInfo, (data) => { + dmInstance.requestCredentialRegisterInfo(credentialInfo, (data) => { if (data) { console.info("requestCredentialRegisterInfo result:" + JSON.stringify(data)); } else { - console.info.push("requestCredentialRegisterInfo result: data is null"); + console.info("requestCredentialRegisterInfo result: data is null"); } }); } catch (err) { @@ -995,11 +999,11 @@ importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: st ] } try { - dmClass.importCredential(credentialInfo, (data) => { + dmInstance.importCredential(credentialInfo, (data) => { if (data) { console.info("importCredential result:" + JSON.stringify(data)); } else { - console.info.push("importCredential result: data is null"); + console.info("importCredential result: data is null"); } }); } catch (err) { @@ -1031,11 +1035,11 @@ deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string} "userId" : "123" } try { - dmClass.deleteCredential(queryInfo, (data) => { + dmInstance.deleteCredential(queryInfo, (data) => { if (data) { console.info("deleteCredential result:" + JSON.stringify(data)); } else { - console.info.push("deleteCredential result: data is null"); + console.info("deleteCredential result: data is null"); } }); } catch (err) { -- GitLab