On Friday 03 February 2006 22:31, Justin Smithies wrote:
> Hi can anyone help me out here.
> I want to write a shell script that will telnet to the FG root and read
> certain values into variables.
> It also has to be able to write new values back using telnet.
>
> Im trying to make a script that will run in the background and control
> certain functions on my home cockpit.
>
> I am just unsure how to implement the telnet bit in a script and have it
> read or write data from variables to the FG tree.
>
> Regards,
> Justin Smithies
Look under src/scripts and you'll find example code showing you how to do it
in Python, Perl and C.
The Python one includes a FlightGear.py module that makes the telnet part
pretty transparent.
Example :
============================
from FlightGear import FlightGear
fg = FlightGear('localhost', 2222)
# write operation
# parking brake on
fg['/controls/parking-brake'] = 1
# read operation
heading = fg['/orientation/heading-deg']
============================
Paul
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel