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}`
)
})
})
}