Class: EvamUsbManagerVS¶
api/hardware/framework/vs/EvamUsbManagerVS.EvamUsbManagerVS
Usb manager class for the Evam platform, contains general USB device management APIs.
Implements¶
Constructors¶
constructor¶
new EvamUsbManagerVS(android)
Parameters¶
Name |
Type |
|---|---|
|
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
Implementation of¶
hasPermission¶
hasPermission(device): Promise<boolean>
Checks if a specific device can be accessed from this application
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
The target USB device |
Returns¶
Promise<boolean>
boolean true if application is authorized, false otherwise
Implementation of¶
openDevice¶
openDevice(device): Promise<void>
Opens a specific device
Parameters¶
Name |
Type |
Description |
|---|---|---|
|
Device to be opened for communication |
Returns¶
Promise<void>
Implementation of¶
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 |
|---|---|---|
|
List of filters for the USB device to be requested |
|
|
( |
Function to be run when the end user has granted permission to a device. Provides the device and a result message. |
Returns¶
Promise<void>