@@ -10,6 +10,7 @@ System applications can call the APIs to do the following:
- Query the trusted device list.
- Query local device information, including the device name, type, and ID.
- Publish device information for discovery purposes.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...
...
@@ -18,7 +19,7 @@ System applications can call the APIs to do the following:
@@ -202,7 +217,6 @@ Defines published device information.
Provides APIs to obtain information about trusted devices and local devices. Before calling any API in **DeviceManager**, you must use **createDeviceManager** to create a **DeviceManager** instance, for example, **dmInstance**.
### release
release(): void
...
...
@@ -211,12 +225,23 @@ Releases this **DeviceManager** instance when it is no longer used.
@@ -412,7 +538,11 @@ Starts to discover peripheral devices and filters discovered devices.
}
]
};
try{
dmInstance.startDeviceDiscovery(subscribeInfo,JSON.stringify(filterOptions));// The deviceFound callback is invoked to notify the application when a device is discovered.
| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event.|
| callback | Callback<{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }> | Yes | Callback used to return the device information and state. |
| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event. |
| callback | Callback<{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }> | Yes | Callback used to return the device information and state.|
| type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered. |
| callback | Callback<{ subscribeId: number, device: [DeviceInfo](#deviceinfo) }> | Yes | Callback used to return the device information and state.|
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () => void | Yes | Callback invoked when a dead event of the **DeviceManager** service occurs. |
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () => void | Yes | Callback invoked when a dead event of the **DeviceManager** service occurs. |
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () => void | No | Callback used to return the dead event of the **DeviceManager** service. |
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () => void | No | Callback used to return the dead event of the **DeviceManager** service. |