Register a listener for USB device connection and disconnection events. The listener is called with two arguments: the event type string ("added" or "removed") and a device-info object with the same fields as attachedDevices().
"added"
"removed"
attachedDevices()
The function to call when a USB device is added or removed
Register a listener for USB device connection and disconnection events. The listener is called with two arguments: the event type string (
"added"or"removed") and a device-info object with the same fields asattachedDevices().