mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 14:13:45 +00:00
commit
89c42c9ec1
45
api/@ohos.distributedHardware.deviceManager.d.ts
vendored
45
api/@ohos.distributedHardware.deviceManager.d.ts
vendored
@ -336,6 +336,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @param bundleName Indicates the bundle name of the application.
|
||||
* @param callback Indicates the callback to be invoked upon {@code DeviceManager} instance creation.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
function createDeviceManager(bundleName: string, callback: AsyncCallback<DeviceManager>): void;
|
||||
@ -347,6 +348,7 @@ declare namespace deviceManager {
|
||||
/**
|
||||
* Releases the {@code DeviceManager} instance after the methods for device management are no longer used.
|
||||
*
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
release(): void;
|
||||
@ -354,6 +356,8 @@ declare namespace deviceManager {
|
||||
/**
|
||||
* Obtains a list of trusted devices.
|
||||
*
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @return Returns a list of trusted devices.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
@ -364,6 +368,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 8
|
||||
* @param callback Indicates the callback to be invoked upon getTrustedDeviceList
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @return Returns a list of trusted devices.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
@ -373,6 +378,7 @@ declare namespace deviceManager {
|
||||
* Obtains a list of trusted devices.
|
||||
*
|
||||
* @since 8
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @return Returns a list of trusted devices.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
@ -382,6 +388,8 @@ declare namespace deviceManager {
|
||||
* Obtains local device info
|
||||
*
|
||||
* @since 8
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @return Returns local device info.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
@ -392,6 +400,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 8
|
||||
* @param callback Indicates the callback to be invoked upon getLocalDeviceInfo
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @return Returns local device info.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
@ -401,6 +410,7 @@ declare namespace deviceManager {
|
||||
* Obtains local device info
|
||||
*
|
||||
* @since 8
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @return Returns local device info.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
@ -411,6 +421,10 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 8
|
||||
* @param subscribeInfo subscribe info to discovery device
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 201 - Permission verify failed.
|
||||
* @throws {BusinessError} 11600104 - Discovery invalid.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
startDeviceDiscovery(subscribeInfo: SubscribeInfo): void;
|
||||
@ -421,6 +435,10 @@ declare namespace deviceManager {
|
||||
* @since 9
|
||||
* @param subscribeInfo subscribe info to discovery device
|
||||
* @param filterOptions filterOptions to filter discovery device
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 201 - Permission verify failed.
|
||||
* @throws {BusinessError} 11600104 - Discovery invalid.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void;
|
||||
@ -429,6 +447,9 @@ declare namespace deviceManager {
|
||||
* Stop to discover device.
|
||||
*
|
||||
* @param subscribeId Service subscribe ID
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 201 - Permission verify failed.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
stopDeviceDiscovery(subscribeId: number): void;
|
||||
@ -437,6 +458,10 @@ declare namespace deviceManager {
|
||||
* Publish discover device.
|
||||
* @since 9
|
||||
* @param publishInfo publish info to Publish discovery device
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 201 - Permission verify failed.
|
||||
* @throws {BusinessError} 11600105 - Publish invalid.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
publishDeviceDiscovery(publishInfo: PublishInfo): void;
|
||||
@ -445,6 +470,9 @@ declare namespace deviceManager {
|
||||
* UnPublish discover device.
|
||||
* @since 9
|
||||
* @param publishId Service publish ID, identify a publish operation, should be a unique id in package range
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 201 - Permission verify failed.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
unPublishDeviceDiscovery(publishId: number): void;
|
||||
@ -455,6 +483,7 @@ declare namespace deviceManager {
|
||||
* @param deviceInfo deviceInfo of device to authenticate
|
||||
* @param authParam authParam of device to authenticate
|
||||
* @param callback Indicates the callback to be invoked upon authenticateDevice
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void;
|
||||
@ -464,6 +493,9 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 8
|
||||
* @param deviceInfo deviceInfo of device to unAuthenticate
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @throws {BusinessError} 201 - Permission verify failed.
|
||||
* @throws {BusinessError} 11600101 - Failed to execute the function.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
unAuthenticateDevice(deviceInfo: DeviceInfo): void
|
||||
@ -473,6 +505,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @param authInfo device auth info o verify
|
||||
* @param callback Indicates the callback to be invoked upon verifyAuthInfo
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void;
|
||||
@ -483,6 +516,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @param bundleName Indicates the bundle name of the application.
|
||||
* @param callback Indicates the device state callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void;
|
||||
@ -492,6 +526,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @param bundleName Indicates the bundle name of the application.
|
||||
* @param callback Indicates the device state callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void;
|
||||
@ -500,6 +535,7 @@ declare namespace deviceManager {
|
||||
* Register a device found callback so that the application can be notified when the device was found
|
||||
*
|
||||
* @param callback Indicates the device found callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void;
|
||||
@ -508,6 +544,7 @@ declare namespace deviceManager {
|
||||
* UnRegister a device found callback so that the application can be notified when the device was found
|
||||
*
|
||||
* @param callback Indicates the device found callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void;
|
||||
@ -516,6 +553,7 @@ declare namespace deviceManager {
|
||||
* Register a device found result callback so that the application can be notified when the device discover was failed
|
||||
*
|
||||
* @param callback Indicates the device found result callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void;
|
||||
@ -524,6 +562,7 @@ declare namespace deviceManager {
|
||||
* UnRegister a device found result callback so that the application can be notified when the device discover was failed
|
||||
*
|
||||
* @param callback Indicates the device found result callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void;
|
||||
@ -533,6 +572,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 9
|
||||
* @param callback Indicates the device publish result callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): void;
|
||||
@ -542,6 +582,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 9
|
||||
* @param callback Indicates the device publish result callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): void;
|
||||
@ -551,6 +592,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 9
|
||||
* @param callback Indicates the device publish result callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
on(type: 'publishFail', callback: Callback<{ publishId: number, reason: number }>): void;
|
||||
@ -560,6 +602,7 @@ declare namespace deviceManager {
|
||||
*
|
||||
* @since 9
|
||||
* @param callback Indicates the device publish result callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: number }>): void;
|
||||
@ -568,6 +611,7 @@ declare namespace deviceManager {
|
||||
* Register a serviceError callback so that the application can be notified when devicemanager service died
|
||||
*
|
||||
* @param callback Indicates the service error callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
on(type: 'serviceDie', callback: () => void): void;
|
||||
@ -576,6 +620,7 @@ declare namespace deviceManager {
|
||||
* UnRegister a serviceError callback so that the application can be notified when devicemanager service died
|
||||
*
|
||||
* @param callback Indicates the service error callback to register.
|
||||
* @throws {BusinessError} 401 - Input parameter error.
|
||||
* @systemapi this method can be used only by system applications.
|
||||
*/
|
||||
off(type: 'serviceDie', callback?: () => void): void;
|
||||
|
Loading…
Reference in New Issue
Block a user