1 // net_ctrls.hxx -- defines a common net I/O interface to the flight
4 // Written by Curtis Olson - http://www.flightgear.org/~curt
7 // This file is in the Public Domain, and comes with no warranty.
12 #ifndef _NET_CTRLS_HXX
13 #define _NET_CTRLS_HXX
15 #include <simgear/misc/stdint.hxx>
17 // NOTE: this file defines an external interface structure. Due to
18 // variability between platforms and architectures, we only used fixed
19 // length types here. Specifically, integer types can vary in length.
20 // I am not aware of any platforms that don't use 4 bytes for float
21 // and 8 bytes for double.
24 /* There is some space reserved in the protocol for future use.
25 * When adding a new type, add it just before the "reserved" definition
26 * and subtract the size of this new type from the RESERVED_SPACE definition
27 * (1 for (u)int32_t or float and 2 for double).
29 * This way the protocol will be forward and backward compatible until
30 * RESERVED_SPACE becomes zero.
33 #define RESERVED_SPACE 25
34 const uint32_t FG_NET_CTRLS_VERSION = 27;
37 // Define a structure containing the control parameters
49 uint32_t version; // increment when data values change
52 double aileron; // -1 ... 1
53 double elevator; // -1 ... 1
54 double rudder; // -1 ... 1
55 double aileron_trim; // -1 ... 1
56 double elevator_trim; // -1 ... 1
57 double rudder_trim; // -1 ... 1
58 double flaps; // 0 ... 1
62 // Aero control faults
63 uint32_t flaps_power; // true = power available
64 uint32_t flap_motor_ok;
67 uint32_t num_engines; // number of valid engines
68 uint32_t master_bat[FG_MAX_ENGINES];
69 uint32_t master_alt[FG_MAX_ENGINES];
70 uint32_t magnetos[FG_MAX_ENGINES];
71 uint32_t starter_power[FG_MAX_ENGINES];// true = starter power
72 double throttle[FG_MAX_ENGINES]; // 0 ... 1
73 double mixture[FG_MAX_ENGINES]; // 0 ... 1
74 double condition[FG_MAX_ENGINES]; // 0 ... 1
75 uint32_t fuel_pump_power[FG_MAX_ENGINES];// true = on
76 double prop_advance[FG_MAX_ENGINES]; // 0 ... 1
77 uint32_t feed_tank_to[4];
82 uint32_t engine_ok[FG_MAX_ENGINES];
83 uint32_t mag_left_ok[FG_MAX_ENGINES];
84 uint32_t mag_right_ok[FG_MAX_ENGINES];
85 uint32_t spark_plugs_ok[FG_MAX_ENGINES]; // false = fouled plugs
86 uint32_t oil_press_status[FG_MAX_ENGINES];// 0 = normal, 1 = low, 2 = full fail
87 uint32_t fuel_pump_ok[FG_MAX_ENGINES];
90 uint32_t num_tanks; // number of valid tanks
91 uint32_t fuel_selector[FG_MAX_TANKS]; // false = off, true = on
92 uint32_t xfer_pump[5]; // specifies transfer from array
93 // value tank to tank specified by
95 uint32_t cross_feed; // false = off, true = on
100 double copilot_brake_left;
101 double copilot_brake_right;
102 double brake_parking;
105 uint32_t gear_handle; // true=gear handle down; false= gear handle up
108 uint32_t master_avionics;
116 // wind and turbulance
117 double wind_speed_kt;
119 double turbulence_norm;
125 // other information about environment
126 double hground; // ground elevation (meters)
127 double magvar; // local magnetic variation in degs.
130 uint32_t icing; // icing status could me much
131 // more complex but I'm
132 // starting simple here.
134 // simulation control
135 uint32_t speedup; // integer speedup multiplier
136 uint32_t freeze; // 0=normal
141 // --- New since FlightGear 0.9.10 (FG_NET_CTRLS_VERSION = 27)
143 // --- Add new variables just before this line.
145 uint32_t reserved[RESERVED_SPACE]; // 100 bytes reserved for future use.
149 #endif // _NET_CTRLS_HXX