提交 ebf0f2ee 编写于 作者: @ @shi-xiaoxiao-iris

错误码说明

Signed-off-by: N@shi-xiaoxiao-iris <shixiaoxiao2@huawei.com>
上级 517e41b4
......@@ -47,9 +47,10 @@ createDeviceManager(bundleName: string, callback: AsyncCallback&lt;DeviceManager
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
**示例**
......@@ -220,7 +221,6 @@ createDeviceManager(bundleName: string, callback: AsyncCallback&lt;DeviceManager
设备管理实例,用于获取可信设备和本地设备的相关信息。在调用DeviceManager的方法前,需要先通过createDeviceManager构建一个DeviceManager实例dmInstance。
### release
release(): void
......@@ -247,7 +247,6 @@ release(): void
}
```
### getTrustedDeviceListSync
getTrustedDeviceListSync(): Array&lt;DeviceInfo&gt;
......@@ -256,12 +255,22 @@ getTrustedDeviceListSync(): Array&lt;DeviceInfo&gt;
**系统能力**:SystemCapability.DistributedHardware.DeviceManager
- 返回值:
**返回值**
| 名称 | 说明 |
| -------------------------------------- | --------- |
| Array&lt;[DeviceInfo](#deviceinfo)&gt; | 返回可信设备列表。 |
- 示例:
**错误码**
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 11600101| Failed to execute the function. |
**示例**
```js
try {
var deviceInfoList = dmInstance.getTrustedDeviceListSync();
......@@ -270,7 +279,6 @@ getTrustedDeviceListSync(): Array&lt;DeviceInfo&gt;
}
```
### getTrustedDeviceList<sup>8+</sup>
getTrustedDeviceList(callback:AsyncCallback&lt;Array&lt;DeviceInfo&gt;&gt;): void
......@@ -318,12 +326,22 @@ getTrustedDeviceList(): Promise&lt;Array&lt;DeviceInfo&gt;&gt;
**系统能力**:SystemCapability.DistributedHardware.DeviceManager
- 返回值:
**返回值**
| 类型 | 说明 |
| ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;[DeviceInfo](#deviceinfo)&gt;&gt; | Promise实例,用于获取异步返回结果。 |
- 示例:
**错误码**
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 11600101| Failed to execute the function. |
**示例**
```js
dmInstance.getTrustedDeviceList().then((data) => {
console.log('get trusted device info: ' + JSON.stringify(data));
......@@ -340,12 +358,22 @@ getLocalDeviceInfoSync(): [DeviceInfo](#deviceinfo)
**系统能力**:SystemCapability.DistributedHardware.DeviceManager
- 返回值:
**返回值**
| 名称 | 说明 |
| -------------------------------------- | --------- |
| Array&lt;[DeviceInfo](#deviceinfo)&gt; | 返回本地设备列表。 |
- 示例:
**错误码**
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 11600101| Failed to execute the function. |
**示例**
```js
try {
var deviceInfo = dmInstance.getLocalDeviceInfoSync();
......@@ -354,7 +382,6 @@ getLocalDeviceInfoSync(): [DeviceInfo](#deviceinfo)
}
```
### getLocalDeviceInfo<sup>8+</sup>
getLocalDeviceInfo(callback:AsyncCallback&lt;DeviceInfo&gt;): void
......@@ -402,11 +429,21 @@ getLocalDeviceInfo(): Promise&lt;DeviceInfo&gt;
**系统能力**:SystemCapability.DistributedHardware.DeviceManager
- 返回值:
**返回值**
| 类型 | 说明 |
| ---------------------------------------- | --------------------- |
| Promise&lt;[DeviceInfo](#deviceinfo)&gt; | Promise实例,用于获取异步返回结果。 |
**错误码**
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 11600101| Failed to execute the function. |
**示例**
- 示例:
```js
dmInstance.getLocalDeviceInfo().then((data) => {
......@@ -439,6 +476,7 @@ startDeviceDiscovery(subscribeInfo: SubscribeInfo): void
| 401 | Input parameter error. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
| 11600104 | Discovery invalid. |
**示例**
......@@ -486,6 +524,7 @@ startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void
| 401 | Input parameter error. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
| 11600104 | Discovery invalid. |
**示例**
......@@ -537,9 +576,11 @@ stopDeviceDiscovery(subscribeId: number): void
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
**示例**
......@@ -571,9 +612,12 @@ publishDeviceDiscovery(publishInfo: PublishInfo): void
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
| 11600105 | Publish invalid. |
**示例**
......@@ -612,9 +656,11 @@ unPublishDeviceDiscovery(publishId: number): void
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
**示例**
......@@ -648,9 +694,12 @@ authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: Async
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
| 11600103 | Authentication invalid. |
**示例**
......@@ -698,9 +747,11 @@ unAuthenticateDevice(deviceInfo: DeviceInfo): void
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
**示例**
......@@ -712,7 +763,6 @@ unAuthenticateDevice(deviceInfo: DeviceInfo): void
}
```
### verifyAuthInfo
verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void
......@@ -733,9 +783,11 @@ verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, le
以下的错误码的详细介绍请参见[分布式硬件子系统错误码](../errorcodes/errorcode-device-manager.md)
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| -------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
| 201 | Permission verify failed. |
| 11600101 | Failed to execute the function. |
| 11600102 | Failed to obtain the service. |
**示例**
......@@ -758,7 +810,6 @@ verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, le
}
```
### on('deviceStateChange')
on(type: 'deviceStateChange', callback: Callback&lt;{ action: DeviceStateChangeAction, device: DeviceInfo }&gt;): void
......@@ -781,7 +832,6 @@ on(type: 'deviceStateChange', callback: Callback&lt;{ action: DeviceStateChange
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -818,7 +868,6 @@ off(type: 'deviceStateChange', callback?: Callback&lt;{ action: DeviceStateChang
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -855,7 +904,6 @@ on(type: 'deviceFound', callback: Callback&lt;{ subscribeId: number, device: Dev
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -891,7 +939,6 @@ off(type: 'deviceFound', callback?: Callback&lt;{ subscribeId: number, device: D
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -927,7 +974,6 @@ on(type: 'discoverFail', callback: Callback&lt;{ subscribeId: number, reason: nu
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -963,7 +1009,6 @@ off(type: 'discoverFail', callback?: Callback&lt;{ subscribeId: number, reason:
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -999,7 +1044,6 @@ on(type: 'publishSuccess', callback: Callback&lt;{ publishId: number }&gt;): voi
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -1035,7 +1079,6 @@ off(type: 'publishSuccess', callback?: Callback&lt;{ publishId: number }&gt;): v
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -1071,7 +1114,6 @@ on(type: 'publishFail', callback: Callback&lt;{ publishId: number, reason: numbe
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -1107,7 +1149,6 @@ off(type: 'publishFail', callback?: Callback&lt;{ publishId: number, reason: num
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -1143,7 +1184,6 @@ on(type: 'serviceDie', callback: () =&gt; void): void
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......@@ -1180,7 +1220,6 @@ off(type: 'serviceDie', callback?: () =&gt; void): void
| 类型 | 说明 |
| ------- | --------------------------------------------------------------- |
| 401 | Input parameter error. |
| 11600101| Failed to execute the function. |
**示例**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册