Telnet usage

From FlightGear wiki
Jump to navigation Jump to search

Flightgear comes with a internal telnet server that can be used to read end set values within the [Property_Tree|property tree] structure. The telnet feature can be activated through the --telnet=port option, where port is the number of the listening port that will be opened.
A connection to the server can be done using a telnet client or opening a simple socket from any program, multiple connection are possible at the same time.

Starting Flightgear with telnet

For example, if you wish to start FG and open the port 10000 as available telnet server use this command:

fgfs --telnet=10000

Usage with a telnet client

Once connected to the server using a telnet client, you will be given a prompt such as if you where connected to a unix telnet server, example:

francesco@francesco-desktop:~$ telnet 127.0.0.1 10000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

Where 127.0.0.1 is the ip address of the runnung fg server and 10000 is the port used when fg has been started.
Now that you are inside the telnet session, you can start giving commands (see below) to fg. Generally commands are used to get, change and navigate values of the property tree in way similar when you are working with directories and files.

Commands

A list of command is available to you to be entered in any telnet connection, if you don't remember the commands, just write ? and press enter to get the following list:

cd

cd <dir> cd to a directory, '..' to move back

example:

/> cd controls
/controls[0]> 


  • data switch to raw data mode
  • dump dump current state (in xml)
  • get show the value of a parameter
  • help show this help message
  • ls [<dir>] list directory
  • prompt switch to interactive mode (default)
  • pwd display your current path
  • quit terminate connection
  • run <command> run built in command
  • set <val> set to a new <val>