View Single Post
  #7   Spotlight this post!  
Unread 08-02-2011, 02:29
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Reading input from NetConsole

NetConsole is bidirectional and is implemented fully in both directions. The documentation does leave a bit to be desired at this point, but when I implemented it, there was very little to it and no options to speak of.

That being said, I'm not sure that this applies well to Java since there are (probably) two pieces missing in that part of the world. The NetConsole client code that's built into NetBeans plugin is (probably) not bidirectional (I haven't tried it, but I'm not aware of that being a use-case that was considered). I'm also not sure that the JVM implements the methods needed to read from the terminal. Perhaps Derek can chime in.

In C++, scanf or getc can be used to read from the terminal (serial or NetConsole, it doesn't know the difference) and the standalone NetConsole client sends and receives (I use this regularly to reboot the robot with ctrl-x and to run VxWorks commands on the console). You may be able to simply call the C functions for reading from the console through the JNA interfaces and then use the standalone NetConsole client. One complication that you may run into is how to start your application such that the console is bound to your task and is not bound to the shell. I haven't tried that aspect of it in the context of a robot program.

-Joe
Reply With Quote