diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-07 21:33:10 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-07 21:33:23 +0200 |
commit | db7248a6de07e7dacac24e1f59afe7e6fe45ba9c (patch) | |
tree | bdbc95c18d343f7d887d2d0fe1527329ff3d5d06 /proto-fg/ftnoir_protocol_fg.h | |
parent | f3db1699d62fdf1dafa511373990f4d44b4d4510 (diff) |
proto/flightgear: few issues
- move fgtypes.h contents into module header
- fix several inverted DOF
- construct a 32-bit ipv4 address from nibblets directly
- switch to no alignment for the datagram, was 2 bytes
- default to 127.0.0.1 as the target address
Issue: #590
Diffstat (limited to 'proto-fg/ftnoir_protocol_fg.h')
-rw-r--r-- | proto-fg/ftnoir_protocol_fg.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/proto-fg/ftnoir_protocol_fg.h b/proto-fg/ftnoir_protocol_fg.h index 019b8c57..48e5f1c1 100644 --- a/proto-fg/ftnoir_protocol_fg.h +++ b/proto-fg/ftnoir_protocol_fg.h @@ -10,7 +10,6 @@ */ #pragma once #include "ui_ftnoir_fgcontrols.h" -#include "fgtypes.h" #include <QThread> #include <QUdpSocket> #include <QMessageBox> @@ -18,15 +17,23 @@ #include "options/options.hpp" using namespace options; +// x,y,z position in meters, heading, pitch and roll in degrees +#pragma pack(push, 1) +struct flightgear_datagram { + double x, y, z, h, p, r; + int status; +}; +#pragma pack(pop) + struct settings : opts { value<int> ip1, ip2, ip3, ip4; value<int> port; settings() : opts("flightgear-proto"), - ip1(b, "ip1", 192), - ip2(b, "ip2", 168), + ip1(b, "ip1", 127), + ip2(b, "ip2", 0), ip3(b, "ip3", 0), - ip4(b, "ip4", 2), + ip4(b, "ip4", 1), port(b, "port", 5542) {} }; @@ -41,7 +48,7 @@ public: } private: settings s; - TFlightGearData FlightData; + flightgear_datagram FlightData; QUdpSocket outSocket; }; |