openharmony 鸿蒙 changelogs-distributedDeviceManager

2023-10-30 浏览 (295)

Device Management Changelog

The cl.distributedDeviceManager.1 API Change

Added device management APIs in OpenHarmony 4.0.9.2.

Change Impact

The original Device Management APIs can still be used but will no longer be maintained. You are advised to use the new APIs for development.

Key API/Component Changes

The following APIs are added.

ModuleClassAPI
@ohos.distributedDeviceManagerfunctionfunction createDeviceManager(bundleName: string): DeviceManager;
@ohos.distributedDeviceManagerfunctionfunction releaseDeviceManager(deviceManager: DeviceManager): void;
@ohos.distributedDeviceManagerDeviceManagerfunction getAvailableDeviceListSync(): Array<DeviceBasicInfo>;
@ohos.distributedDeviceManagerDeviceManagerfunction getAvailableDeviceList(callback:AsyncCallback<Array<DeviceBasicInfo>>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction getAvailableDeviceList(): Promise<Array<DeviceBasicInfo>>;
@ohos.distributedDeviceManagerDeviceManagerfunction getLocalDeviceNetworkId(): string;
@ohos.distributedDeviceManagerDeviceManagerfunction getLocalDeviceName(): string;
@ohos.distributedDeviceManagerDeviceManagerfunction getLocalDeviceType(): number;
@ohos.distributedDeviceManagerDeviceManagerfunction getLocalDeviceId(): string;
@ohos.distributedDeviceManagerDeviceManagerfunction getDeviceName(networkId: string): string;
@ohos.distributedDeviceManagerDeviceManagerfunction getDeviceType(networkId: string): number;
@ohos.distributedDeviceManagerDeviceManagerfunction startDiscovering(discoverParam: {[key: string]: Object} , filterOptions?: {[key: string]: Object} ): void;
@ohos.distributedDeviceManagerDeviceManagerfunction stopDiscovering(): void;
@ohos.distributedDeviceManagerDeviceManagerfunction bindTarget(deviceId: string, bindParam: {[key: string]: Object} , callback: AsyncCallback<{deviceId: string}>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction unbindTarget(deviceId: string): void;
@ohos.distributedDeviceManagerDeviceManagerfunction replyUiAction(action: number, actionResult: string): void;
@ohos.distributedDeviceManagerDeviceManagerfunction on(type: 'replyResult', callback: Callback<{ param: string}>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction off(type: 'replyResult', callback?: Callback<{ param: string}>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChange, device: DeviceBasicInfo }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChange, device: DeviceBasicInfo }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction on(type: 'discoverSuccess', callback: Callback<{ device: DeviceBasicInfo }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction off(type: 'discoverSuccess', callback?: Callback<{ device: DeviceBasicInfo }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction on(type: 'deviceNameChange', callback: Callback<{ deviceName: string }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction off(type: 'deviceNameChange', callback?: Callback<{ deviceName: string }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction on(type: 'discoverFailure', callback: Callback<{ reason: number }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction off(type: 'discoverFailure', callback?: Callback<{ reason: number }>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction on(type: 'serviceDie', callback?: Callback<{}>): void;
@ohos.distributedDeviceManagerDeviceManagerfunction off(type: 'serviceDie', callback?: Callback<{}>): void;

Adaptation Guide

See Device Management.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI Subsystem Changelog

harmony 鸿蒙Location Subsystem Changelog

harmony 鸿蒙Input Method Framework Subsystem – Input Method Framework Service Changelog

harmony 鸿蒙Multimedia Subsystem Changelog

harmony 鸿蒙Theme Framework Subsystem – Screen Lock Management Service Changelog

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/ea3e0d49c54c46dba06d08c821f8e942