I am working on a project in a team that uses the WebUSB API and I have some questions I was hoping you can answer.
We have have successfully communicated with our USB device and it is returning the devices Landing Page URL, and now I am trying to detect when the device connects and disconnects from the USB port, I have tried to followed the instructions on
https://wicg.github.io/webusb/#enumeration in Example 1.
Initially when the device is first plugged in, and the page is loaded I call navigator.usb.getDevices() and loop threw the devices when I get the results from that method, but the devices list is empty until I request and open the device (and close), than I can reload the page and I find 1 device in the list (which is now correct), so in the results from getDevices I loop threw the devices list and on each device I navigator.usb.addEventListener for connect and disconnect, but when I unplug and plug in the device no callbacks are triggered.
I am really unsure what I am doing wrong, may you point me in the right direction pleas? Any help would be appreciated.