Because I get bored and have the most exciting of Saturday nights... I put together a quick little feature using websockets.
This is a short example that takes stdio and remaps it to a websocket. The main webpage will autocreate a websocket to the module when the page is loaded. When said websocket is created, it will remap stdio to point to the websocket instead of serial. If the websocket is closed, it will revert stdio to whatever fd was standard IO at the time of the websocket's creation.
The really cool thing is that the module side code is incredibly, stupidly simple. One caveat, is that there's a minor issue in the current nndk with opening websockets, where they won't reset the fd conditions (writeAvail, ReadAvail, and HasError), so when you close and then reopen the websocket, after the first session per boot, it will error out, thinking that the socket is closing.
-Dan
stdio in a browser
stdio in a browser
- Attachments
-
- Console_APP.s19
- (315.54 KiB) Downloaded 651 times
-
- Console.tar.gz
- (2.25 KiB) Downloaded 672 times
Dan Ciliske
Project Engineer
Netburner, Inc
Project Engineer
Netburner, Inc