Interface: UsbManager

api/hardware/EvamHardwareUsbApi.UsbManager

Usb manager class for the Evam platform, contains general USB device management APIs.

Implemented by

Methods

getDeviceList

getDeviceList(): Promise<UsbDevice[]>

Gets the list of devices the application is allowed (authorized) to communicate with.

Returns

Promise<UsbDevice[]>

UsbDevice[] List of accessible devices


hasPermission

hasPermission(device): Promise<boolean>

Checks if a specific device can be accessed from this application

Parameters

Name

Type

Description

device

UsbDevice

The target USB device

Returns

Promise<boolean>

boolean true if application is authorized, false otherwise


openDevice

openDevice(device): Promise<void>

Opens a specific device

Parameters

Name

Type

Description

device

UsbDevice

Device to be opened for communication

Returns

Promise<void>


requestPermission

requestPermission(filters, callback): Promise<void>

Requests the permission to access a specific device selected from a list of filters. Will cause a system pop-up to be shown to the end user for the device selection.

Parameters

Name

Type

Description

filters

UsbDeviceFilter[]

List of filters for the USB device to be requested

callback

(device: UsbDevice, message: string) => void

Function to be run when the end user has granted permission to a device. Provides the device and a result message.

Returns

Promise<void>