public interface ISerialComUSBHotPlugListener
The interface ISerialComUSBHotPlugListener need to be implemented by class who wish to get notified whenever a specified USB device is added to the system or removed from the system.
Application should call registerUSBHotPlugEventListener method in SerialComManager class to register listener. Whenever an event occurs callback method onUSBHotPlugEvent() gets called containing event that occurred.
It is possible for serialpundit to pass VID/PID/SERIAL of USB devices added even if application does not mentioned USB-IF VID/PID etc at the time of registering hot plug listener. However this is not done due to the fact of increasing overall performance of hot plug system. Application should devise its own method of handling such a scenario.
| Modifier and Type | Method and Description |
|---|---|
void |
onUSBHotPlugEvent(int event,
int USBVID,
int USBPID,
String serialNumber)
Whenever a USB device is plugged into system or unplugged from system, onUSBHotPlugEvent()
method will be called by native layer.
|
void onUSBHotPlugEvent(int event,
int USBVID,
int USBPID,
String serialNumber)
Whenever a USB device is plugged into system or unplugged from system, onUSBHotPlugEvent() method will be called by native layer.
The event value SerialComUSB.DEV_ADDED indicates USB device has been added to the system. The event value SerialComUSB.DEV_REMOVED indicates USB device has been removed from system.
USBVID will be 0, if SerialComUSB.DEV_ANY was passed to registerUSBHotPlugEventListener for filterVID argument. USBPID will be 0, if SerialComUSB.DEV_ANY was passed to registerUSBHotPlugEventListener for filterPID and serialNumber will be empty string if null was passed to registerUSBHotPlugEventListener for serialNumber argument.
event - integer value indicating whether a USB device was plugged or un-plugged from system.USBVID - USB-IF vendor id of USB device for which this method is invoked.USBPID - Product id of USB device for which this method is invoked.serialNumber - serial number of USB device for which this method is invoked.Copyright © 2017. All rights reserved.