1

I am trying to write a program in javascript to read and write some data on a USB device, a USB Serial Device (COM6). So far this code does not work and does not recognize the device, let alone its information. any ideas?

This method does not work => Total devices: 0

export const USB = () => {
    navigator.usb.getDevices().then((devices) => {
        console.log(`Total devices: ${devices.length}`)
        devices.forEach((device) => {
          console.log(
            `Product name: ${device.productName}, serial number ${device.serialNumber}`
          )
        })
      })
}
epascarello
  • 204,599
  • 20
  • 195
  • 236
  • 2
    https://stackoverflow.com/questions/41876880/webusb-getdevices-empty-list – epascarello May 03 '23 at 12:08
  • Does this answer your question? [WebUSB getDevices empty list](https://stackoverflow.com/questions/41876880/webusb-getdevices-empty-list) – Luke Vo May 03 '23 at 12:12

0 Answers0