I'd like to connect my webpage to a label printer and scanner. I've seen tutorials on how to write USB drivers in C/C++. Since C/C++ can compile to wasm, is it possible for my wasm file in my webpage to read/write data from/to the different devices connected to my computer via USB?
No, wasm modules cannot communicate to usb devices.
The WebAssembly virtual machine does not have any built in I/O capabilities. To access the browser DOM, read to file system, or communicate via the network, for example - it must do so via its hosting environment. WebAssembly modules can import and export functions, allowing you to create the required bridging code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With