On Tue, Apr 21, 2015 at 10:28 AM, Walker Archer <[email protected]> wrote:
> I need a push in the right direction. > > My project requires keyboard input from a web page. Each keypress > requires the BBB to send a serial code to an Arduino. I was hoping to > accomplish this using Bonescript and the http interface already served by > Node.js. > > I can see how to submit BoneScript code to Node.js from a web page... the > example pages that come with the Debian image are quite helpful. But I'm > stuck on two things: > > 1. The BoneScript serial functions require an open, and subsequent > serialWrite commands. Is it possible to open the serial connection with > one call to demoRun and then do the serialWrite commands in separate > calls? Or is the session not preserved? Would I need to do the open and > write in one call? > You have to maintain a handle. You can use the active window to share the handle globally. Your other code will need to have some ability to poll the global object. > > 2. I know how to get keyboard input from the browser side javascript > interpreter. But I'm not clear on how to get that over to the Node.js > side. I suppose my browser side keydown event would just execute a demoRun > call? > If you use the BoneScript in-browser remote-procedure calls, that'd be handled for you. Otherwise, I suggest you look at socket.io which is what BoneScript uses for remote-procedure calls. > > I'm new to Node.js and BoneScript. I have a feeling these questions > should be obvious to me. Pointers to documentation that might help is > appreciated. > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
