提交 101c481f 编写于 作者: W wangxuanxuan

modify DM API description

Signed-off-by: Nwangxuanxuan <wangxuanxuan9@huawei.com>
上级 19eb0d19
...@@ -487,6 +487,8 @@ getDeviceInfo(networkId: string, callback:AsyncCallback&lt;DeviceInfo&gt;): void ...@@ -487,6 +487,8 @@ getDeviceInfo(networkId: string, callback:AsyncCallback&lt;DeviceInfo&gt;): void
```js ```js
try { try {
// 设备网络标识,可以从可信设备列表中获取
let networkId = "xxxxxxx"
dmInstance.getDeviceInfo(networkId, (err, data) => { dmInstance.getDeviceInfo(networkId, (err, data) => {
if (err) { if (err) {
console.error("getDeviceInfo errCode:" + err.code + ",errMessage:" + err.message); console.error("getDeviceInfo errCode:" + err.code + ",errMessage:" + err.message);
...@@ -530,6 +532,8 @@ getDeviceInfo(networkId: string): Promise&lt;DeviceInfo&gt; ...@@ -530,6 +532,8 @@ getDeviceInfo(networkId: string): Promise&lt;DeviceInfo&gt;
**示例:** **示例:**
```js ```js
// 设备网络标识,可以从可信设备列表中获取
let networkId = "xxxxxxx"
dmInstance.getDeviceInfo(networkId).then((data) => { dmInstance.getDeviceInfo(networkId).then((data) => {
console.log('get device info: ' + JSON.stringify(data)); console.log('get device info: ' + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
...@@ -944,11 +948,11 @@ requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{regi ...@@ -944,11 +948,11 @@ requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{regi
"userId" : "123" "userId" : "123"
} }
try { try {
dmClass.requestCredentialRegisterInfo(credentialInfo, (data) => { dmInstance.requestCredentialRegisterInfo(credentialInfo, (data) => {
if (data) { if (data) {
console.info("requestCredentialRegisterInfo result:" + JSON.stringify(data)); console.info("requestCredentialRegisterInfo result:" + JSON.stringify(data));
} else { } else {
console.info.push("requestCredentialRegisterInfo result: data is null"); console.info("requestCredentialRegisterInfo result: data is null");
} }
}); });
} catch (err) { } catch (err) {
...@@ -995,11 +999,11 @@ importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: st ...@@ -995,11 +999,11 @@ importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: st
] ]
} }
try { try {
dmClass.importCredential(credentialInfo, (data) => { dmInstance.importCredential(credentialInfo, (data) => {
if (data) { if (data) {
console.info("importCredential result:" + JSON.stringify(data)); console.info("importCredential result:" + JSON.stringify(data));
} else { } else {
console.info.push("importCredential result: data is null"); console.info("importCredential result: data is null");
} }
}); });
} catch (err) { } catch (err) {
...@@ -1031,11 +1035,11 @@ deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string} ...@@ -1031,11 +1035,11 @@ deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string}
"userId" : "123" "userId" : "123"
} }
try { try {
dmClass.deleteCredential(queryInfo, (data) => { dmInstance.deleteCredential(queryInfo, (data) => {
if (data) { if (data) {
console.info("deleteCredential result:" + JSON.stringify(data)); console.info("deleteCredential result:" + JSON.stringify(data));
} else { } else {
console.info.push("deleteCredential result: data is null"); console.info("deleteCredential result: data is null");
} }
}); });
} catch (err) { } catch (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册