changelogs-distributedDeviceManager.md 4.8 KB
Newer Older
1 2 3
# 设备管理ChangeLog
## cl.distributedDeviceManager.1 接口变更

修改  
史晓晓 已提交
4
从Openharmony 4.0.9.2版本开始,新增设备管理接口。
5 6 7

**变更影响**

史晓晓 已提交
8
原有的接口[API参考](../../../application-dev/reference/apis/js-apis-device-manager.md)暂时可继续使用,但是停止维护,建议使用新接口进行开发。
9 10 11 12 13

**关键的接口/组件变更**

##新增接口如下:

史晓晓 已提交
14 15
| 模块名                                | 类名                | 新增接口声明                                                   |
| ------------------------------------ | ------------------- | ------------------------------------------------------------ |
史晓晓 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| @ohos.distributedDeviceManager       | function             | **function** createDeviceManager(bundleName: string): DeviceManager;           |
| @ohos.distributedDeviceManager       | function             | **function** releaseDeviceManager(deviceManager: DeviceManager): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getAvailableDeviceListSync(): Array<DeviceBasicInfo>; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getAvailableDeviceList(callback:AsyncCallback<Array<DeviceBasicInfo>>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getAvailableDeviceList(): Promise<Array<DeviceBasicInfo>>; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getLocalDeviceNetworkId(): string; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getLocalDeviceName(): string; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getLocalDeviceType(): number; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getLocalDeviceId(): string; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getDeviceName(networkId: string): string; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** getDeviceType(networkId: string): number; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** startDiscovering(discoverParam: {[key: string]: Object} , filterOptions?: {[key: string]: Object} ): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** stopDiscovering(): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** bindTarget(deviceId: string, bindParam: {[key: string]: Object} , callback: AsyncCallback<{deviceId: string}>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** unbindTarget(deviceId: string): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** replyUiAction(action: number, actionResult: string): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** on(type: 'replyResult', callback: Callback<{ param: string}>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** off(type: 'replyResult', callback?: Callback<{ param: string}>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChange, device: DeviceBasicInfo }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChange, device: DeviceBasicInfo }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** on(type: 'discoverSuccess', callback: Callback<{ device: DeviceBasicInfo }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** off(type: 'discoverSuccess', callback?: Callback<{ device: DeviceBasicInfo }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** on(type: 'deviceNameChange', callback: Callback<{ deviceName: string }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** off(type: 'deviceNameChange', callback?: Callback<{ deviceName: string }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** on(type: 'discoverFailure', callback: Callback<{ reason: number }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** off(type: 'discoverFailure', callback?: Callback<{ reason: number }>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** on(type: 'serviceDie', callback?: Callback<{}>): void; |
| @ohos.distributedDeviceManager       | DeviceManager        | **function** off(type: 'serviceDie', callback?: Callback<{}>): void; |
44 45 46 47

**适配指导**

请参考各接口的[API参考](../../../application-dev/reference/apis/js-apis-distributedDeviceManager.md)