I recently tried to use web API to get my USB device. However, there are a few problems.
First, the examples I found online are all about Arduino which I never try, so don't know whether it works on my computer or not. I tried to communicate with my smartphone SAMSUNG J7. I set VID and PID as the same as I found in device manager. Then, there was no device can be selected, it only shows "No compatible device was found."
Then, I delete the filter part to blank in order to get all device. However, all I got is internal intel USB chip or something. I still cannot find my device.
The below is my javascript code
const filters = [{}];
navigator.usb.requestDevice({
filters: filters
})
.then(usbDevice => {
console.log("Product name: " + usbDevice.productName);
console.log(usbDevice.manufacturerName);
})
.catch(e => {
console.log("There is no device. " + e);
});
Can anyone tell me where am I wrong or is there any misunderstanding about Webusb