A class for USB Host.
To access USB device, please follow the criteria below.<br>
- Gets UsbOwliftHost by getUsbHost().
- Calls openDev().
- Returns target UsbOwliftDev by calling selectDev() in UsbOwliftHost.Callback.
- Gets target UsbOwliftFunc from UsbOwliftDev that got by openDev(). UsbOwliftFunc is a parent class of UvcOwliftFunc. Uses UsbOwliftDev.getFuncs() to get USB function.
- Communicates with USB Device by operating UsbOwliftFunc that casted to UvcOwliftFunc. For examples, start video streaming by UvcOwliftFunc.startStream().
- Calls close() before exit from application.
[Restrictions]
-
Could not stop streaming once start streaming on USB device, except closing all devices by calling close().
-
Must re-do all criteria from getUsbHost() to restart streaming.
-
Reconnects USB device and reset USB device permission if call close(). It will take more than several seconds to finish close() processing.
◆ close()
◆ getDevs()
UsbOwliftDev.Collection getDevs |
( |
| ) |
|
Returns connecting device list on UsbHost.
- Returns
- connecting device list.
◆ getUsbHost()
Returns UsbOwliftHost object.
- Parameters
-
c | Context object. Passes Activity in nominal case. |
- Returns
- UsbOwliftHost object.
- Exceptions
-
◆ onCreate()
Must call this method in Activity.onCreate().
This method is doing mandatory processing for UsbHost terminal.
◆ onDestroy()
Must call this method in Activity.onDestroy().
This method is doing mandatory processing for UsbHost terminal.
This method fully release native resource. So, process is halting in some terminal. Don't call this method if you would not like to halt the process.
◆ openDev()
Opens USB device.
Display permission dialog if no permission for USB device.
- Parameters
-
contextWrapper |
ContextWrapper to register BroadcastReceiver. passes Activity usually. This uses to display dialog for USB permission. |
timeoutMSecWaitUntilDeviceFound | waiting time for device detection in milliseconds. |
cb | Callback. |
- Returns
- UsbDev if success to open UsbDev that returned from callback. if failed to open, exception will occur(not return NULL).
- Exceptions
-