Constructor
new UsbDetector(usbDetect)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
usbDetect |
The "usb-detection" module. |
Methods
on(eventName, callback)
- Description:
Register a callback to an USB event. See usbDetect#on.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
eventName |
string | Event name. |
callback |
function | Event callback. |
startMonitoring()
- Description:
Starts listening to USB events. Can be called multiple times. Will prevent the process from exiting until
stopMonitoringis called a matching number of times.
- Source:
stopMonitoring()
- Description:
Stops listening to USB events, and allows the process to exit, but ONLY at the last call of a matching chain of
startMonitoringcalls.
- Source:
supportsMonitoring() → {boolean}
- Description:
Whether this detector supports monitoring: if the detector detects.
- Source:
Returns:
If the detector supports monitoring - always true.
- Type
- boolean