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.
23 const uint32_t FG_NET_CTRLS_VERSION = 26;
26 // Define a structure containing the control parameters
38 uint32_t version; // increment when data values change
41 double aileron; // -1 ... 1
42 double elevator; // -1 ... 1
43 double rudder; // -1 ... 1
44 double aileron_trim; // -1 ... 1
45 double elevator_trim; // -1 ... 1
46 double rudder_trim; // -1 ... 1
47 double flaps; // 0 ... 1
49 // Aero control faults
50 uint32_t flaps_power; // true = power available
51 uint32_t flap_motor_ok;
54 uint32_t num_engines; // number of valid engines
55 uint32_t master_bat[FG_MAX_ENGINES];
56 uint32_t master_alt[FG_MAX_ENGINES];
57 uint32_t magnetos[FG_MAX_ENGINES];
58 uint32_t starter_power[FG_MAX_ENGINES];// true = starter power
59 double throttle[FG_MAX_ENGINES]; // 0 ... 1
60 double mixture[FG_MAX_ENGINES]; // 0 ... 1
61 double condition[FG_MAX_ENGINES]; // 0 ... 1
62 uint32_t fuel_pump_power[FG_MAX_ENGINES];// true = on
63 double prop_advance[FG_MAX_ENGINES]; // 0 ... 1
66 uint32_t engine_ok[FG_MAX_ENGINES];
67 uint32_t mag_left_ok[FG_MAX_ENGINES];
68 uint32_t mag_right_ok[FG_MAX_ENGINES];
69 uint32_t spark_plugs_ok[FG_MAX_ENGINES]; // false = fouled plugs
70 uint32_t oil_press_status[FG_MAX_ENGINES];// 0 = normal, 1 = low, 2 = full fail
71 uint32_t fuel_pump_ok[FG_MAX_ENGINES];
74 uint32_t num_tanks; // number of valid tanks
75 uint32_t fuel_selector[FG_MAX_TANKS]; // false = off, true = on
76 uint32_t cross_feed; // false = off, true = on
81 double copilot_brake_left;
82 double copilot_brake_right;
86 uint32_t gear_handle; // true=gear handle down; false= gear handle up
89 uint32_t master_avionics;
91 // wind and turbulance
94 double turbulence_norm;
100 // other information about environment
101 double hground; // ground elevation (meters)
102 double magvar; // local magnetic variation in degs.
105 uint32_t icing; // icing status could me much
106 // more complex but I'm
107 // starting simple here.
109 // simulation control
110 uint32_t speedup; // integer speedup multiplier
111 uint32_t freeze; // 0=normal
118 #endif // _NET_CTRLS_HXX