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 7c44aa95b4b8c5cd93d78b654fe30d8ee41a1f0c..d42758c6f3547469d3d6d526d9b2ffc7ec0693cb 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 @@ -1186,20 +1186,19 @@ importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: st deviceId: string, version: string, devicePk : string, - credentialData : CredentialData[] + credentialData : CredentialData + } + + let credentialData: CredentialData = { + credentialType: 2, + credentialId: "102", + serverPk: "3059301306072A8648CE3D020106082A8648CE3D03", + pkInfoSignature : "30440220490BCB4F822004C9A76AB8D97F80041FC0E", + pkInfo: "", + authCode: "", + peerDeviceId: "" } - let credentialData: CredentialData = [ - { - credentialType: 2, - credentialId: "102", - serverPk: "3059301306072A8648CE3D020106082A8648CE3D03", - pkInfoSignature : "30440220490BCB4F822004C9A76AB8D97F80041FC0E", - pkInfo: "", - authCode: "", - peerDeviceId: "" - } - ] let credentialInfo: CredentialInfo = { processType: 1, @@ -1375,7 +1374,14 @@ on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChange class Data { action: deviceManager.DeviceStateChangeAction = 0 - device: deviceManager.DeviceInfo = {} + device: deviceManager.DeviceInfo = { + deviceId: "", + deviceName: "", + deviceType: 0, + networkId: "", + range: 0, + authForm:0, + } } try { @@ -1413,7 +1419,14 @@ off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChang class Data { action: deviceManager.DeviceStateChangeAction = 0 - device: deviceManager.DeviceInfo = {} + device: deviceManager.DeviceInfo = { + deviceId: "", + deviceName: "", + deviceType: 0, + networkId: "", + range: 0, + authForm:0, + } } try { @@ -1454,7 +1467,6 @@ on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: Dev device: deviceManager.DeviceInfo = {} } - subscribeId: number, device: DeviceInfo try { dmInstance.on('deviceFound', (data: Data) => { console.info("deviceFound:" + JSON.stringify(data)); @@ -1490,7 +1502,14 @@ off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: D class Data { subscribeId: number = 0 - device: deviceManager.DeviceInfo = {} + device: deviceManager.DeviceInfo = { + deviceId: "", + deviceName: "", + deviceType: 0, + networkId: "", + range: 0, + authForm:0, + } } try { diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributedDeviceManager.md b/zh-cn/application-dev/reference/apis/js-apis-distributedDeviceManager.md index 68d775d01d9232daf0bb662c664fa52a475d4013..6308cb89f31cb26c16918396269da58eb423f588 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-distributedDeviceManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-distributedDeviceManager.md @@ -828,7 +828,12 @@ on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChange, class Data { action: deviceManager.DeviceStateChange = 0 - device: deviceManager.DeviceBasicInfo = {} + device: deviceManager.DeviceBasicInfo = { + deviceId: "", + deviceName: "", + deviceType: "", + networkId: "", + } } try { @@ -866,7 +871,12 @@ off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChang class Data { action: deviceManager.DeviceStateChange = 0 - device: deviceManager.DeviceBasicInfo = {} + device: deviceManager.DeviceBasicInfo = { + deviceId: "", + deviceName: "", + deviceType: "", + networkId: "", + } } try { @@ -903,7 +913,12 @@ on(type: 'discoverSuccess', callback: Callback<{ device: DeviceBasicInfo }> import { BusinessError } from '@ohos.base' class Data { - device: deviceManager.DeviceBasicInfo = {} + device: deviceManager.DeviceBasicInfo = { + deviceId: "", + deviceName: "", + deviceType: "", + networkId: "", + } } try { @@ -940,7 +955,12 @@ off(type: 'discoverSuccess', callback?: Callback<{ device: DeviceBasicInfo }& import { BusinessError } from '@ohos.base' class Data { - device: deviceManager.DeviceBasicInfo = {} + device: deviceManager.DeviceBasicInfo = { + deviceId: "", + deviceName: "", + deviceType: "", + networkId: "", + } } try {