Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does wasm support reading/writing to USB? [closed]

Tags:

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?

like image 938
Tyler Zika Avatar asked Jul 14 '18 19:07

Tyler Zika


1 Answers

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.

like image 68
ColinE Avatar answered Sep 28 '22 06:09

ColinE