# 设备管理ChangeLog ## cl.distributedDeviceManager.1 接口变更 从Opeharmonny 4.0.9.2版本开始,新增了设备管理接口。 **变更影响** 原有的接口[API参考](../../../application-dev/reference/apis/js-apis-device-manager.md)暂时可继续使用,但是停止维护,建议使用新接口进行开发。 **关键的接口/组件变更** ##新增接口如下: | 模块名 | 类名 | 新增接口声明 | 是否支持三方应用调用 | | ------------------------- | ------------------- | ------------------------------------------------------------ | ------------------------------- | | @ohos.distributedDeviceManager | deviceManager | **function** createDeviceManager(bundleName: string, callback: AsyncCallback<DeviceManager>): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** releaseDeviceManager(): 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** getLocalDeviceNetworkIdSync(): string; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** getLocalDeviceNameSync(): string; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** getLocalDeviceTypeSync(): number; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** getLocalDeviceIdSync(): string; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** getDeviceNameSync(networkId: string): string; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** getDeviceTypeSync(networkId: string): number; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** startDiscovering(subscribeId: number, filterOptions?: string): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** stopDiscovering(subscribeId: number): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** bindTarget(deviceId: string, bindParam: BindParam, callback: AsyncCallback<{deviceId: string}>): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** unbindTarget(deviceId: string): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** replyUiAction(action: number, params: 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: 'deviceStatusChange', callback: Callback<{ action: DeviceStatusChange, device: DeviceBasicInfo }>): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** off(type: 'deviceStatusChange', callback?: Callback<{ action: DeviceStatusChange, device: DeviceBasicInfo }>): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** on(type: 'discoverSuccess', callback: Callback<{ subscribeId: number, device: DeviceBasicInfo }>): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** off(type: 'discoverSuccess', callback?: Callback<{ subscribeId: number, 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: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** on(type: 'serviceDie', callback: () => void): void; | 是 | | @ohos.distributedDeviceManager | deviceManager | **function** off(type: 'serviceDie', callback?: () => void): void; | 是 | **适配指导** 请参考各接口的[API参考](../../../application-dev/reference/apis/js-apis-distributedDeviceManager.md)