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__)
25 typedef signed char int8_t;
26 typedef signed short int16_t;
27 typedef signed int int32_t;
28 typedef signed __int64 int64_t;
29 typedef unsigned char uint8_t;
30 typedef unsigned short uint16_t;
31 typedef unsigned int uint32_t;
32 typedef unsigned __int64 uint64_t;
34 # error "Port me! Platforms that don't have <stdint.h> need to define int8_t, et. al."
37 const uint32_t FG_NET_CTRLS_VERSION = 26;
40 // Define a structure containing the control parameters
52 uint32_t version; // increment when data values change
55 double aileron; // -1 ... 1
56 double elevator; // -1 ... 1
57 double rudder; // -1 ... 1
58 double aileron_trim; // -1 ... 1
59 double elevator_trim; // -1 ... 1
60 double rudder_trim; // -1 ... 1
61 double flaps; // 0 ... 1
63 // Aero control faults
64 uint32_t flaps_power; // true = power available
65 uint32_t flap_motor_ok;
68 uint32_t num_engines; // number of valid engines
69 uint32_t master_bat[FG_MAX_ENGINES];
70 uint32_t master_alt[FG_MAX_ENGINES];
71 uint32_t magnetos[FG_MAX_ENGINES];
72 uint32_t starter_power[FG_MAX_ENGINES];// true = starter power
73 double throttle[FG_MAX_ENGINES]; // 0 ... 1
74 double mixture[FG_MAX_ENGINES]; // 0 ... 1
75 double condition[FG_MAX_ENGINES]; // 0 ... 1
76 uint32_t fuel_pump_power[FG_MAX_ENGINES];// true = on
77 double prop_advance[FG_MAX_ENGINES]; // 0 ... 1
80 uint32_t engine_ok[FG_MAX_ENGINES];
81 uint32_t mag_left_ok[FG_MAX_ENGINES];
82 uint32_t mag_right_ok[FG_MAX_ENGINES];
83 uint32_t spark_plugs_ok[FG_MAX_ENGINES]; // false = fouled plugs
84 uint32_t oil_press_status[FG_MAX_ENGINES];// 0 = normal, 1 = low, 2 = full fail
85 uint32_t fuel_pump_ok[FG_MAX_ENGINES];
88 uint32_t num_tanks; // number of valid tanks
89 uint32_t fuel_selector[FG_MAX_TANKS]; // false = off, true = on
90 uint32_t cross_feed; // false = off, true = on
95 double copilot_brake_left;
96 double copilot_brake_right;
100 uint32_t gear_handle; // true=gear handle down; false= gear handle up
103 uint32_t master_avionics;
105 // wind and turbulance
106 double wind_speed_kt;
108 double turbulence_norm;
114 // other information about environment
115 double hground; // ground elevation (meters)
116 double magvar; // local magnetic variation in degs.
119 uint32_t icing; // icing status could me much
120 // more complex but I'm
121 // starting simple here.
123 // simulation control
124 uint32_t speedup; // integer speedup multiplier
125 uint32_t freeze; // 0=normal
132 #endif // _NET_CTRLS_HXX