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
16 // NOTE: this file defines an external interface structure. Due to
17 // variability between platforms and architectures, we only used fixed
18 // length types here. Specifically, integer types can vary in length.
19 // I am not aware of any platforms that don't use 4 bytes for float
20 // and 8 bytes for double.
24 #elif defined( _MSC_VER ) || defined(__MINGW32__) || defined(sun)
25 typedef signed short int16_t;
26 typedef signed int int32_t;
27 typedef unsigned short uint16_t;
28 typedef unsigned int uint32_t;
30 # error "Port me! Platforms that don't have <stdint.h> need to define int8_t, et. al."
33 const uint32_t FG_NET_CTRLS_VERSION = 26;
36 // Define a structure containing the control parameters
48 uint32_t version; // increment when data values change
51 double aileron; // -1 ... 1
52 double elevator; // -1 ... 1
53 double rudder; // -1 ... 1
54 double aileron_trim; // -1 ... 1
55 double elevator_trim; // -1 ... 1
56 double rudder_trim; // -1 ... 1
57 double flaps; // 0 ... 1
59 // Aero control faults
60 uint32_t flaps_power; // true = power available
61 uint32_t flap_motor_ok;
64 uint32_t num_engines; // number of valid engines
65 uint32_t master_bat[FG_MAX_ENGINES];
66 uint32_t master_alt[FG_MAX_ENGINES];
67 uint32_t magnetos[FG_MAX_ENGINES];
68 uint32_t starter_power[FG_MAX_ENGINES];// true = starter power
69 double throttle[FG_MAX_ENGINES]; // 0 ... 1
70 double mixture[FG_MAX_ENGINES]; // 0 ... 1
71 double condition[FG_MAX_ENGINES]; // 0 ... 1
72 uint32_t fuel_pump_power[FG_MAX_ENGINES];// true = on
73 double prop_advance[FG_MAX_ENGINES]; // 0 ... 1
76 uint32_t engine_ok[FG_MAX_ENGINES];
77 uint32_t mag_left_ok[FG_MAX_ENGINES];
78 uint32_t mag_right_ok[FG_MAX_ENGINES];
79 uint32_t spark_plugs_ok[FG_MAX_ENGINES]; // false = fouled plugs
80 uint32_t oil_press_status[FG_MAX_ENGINES];// 0 = normal, 1 = low, 2 = full fail
81 uint32_t fuel_pump_ok[FG_MAX_ENGINES];
84 uint32_t num_tanks; // number of valid tanks
85 uint32_t fuel_selector[FG_MAX_TANKS]; // false = off, true = on
86 uint32_t cross_feed; // false = off, true = on
91 double copilot_brake_left;
92 double copilot_brake_right;
96 uint32_t gear_handle; // true=gear handle down; false= gear handle up
99 uint32_t master_avionics;
101 // wind and turbulance
102 double wind_speed_kt;
104 double turbulence_norm;
110 // other information about environment
111 double hground; // ground elevation (meters)
112 double magvar; // local magnetic variation in degs.
115 uint32_t icing; // icing status could me much
116 // more complex but I'm
117 // starting simple here.
119 // simulation control
120 uint32_t speedup; // integer speedup multiplier
121 uint32_t freeze; // 0=normal
128 #endif // _NET_CTRLS_HXX