#include "native_ctrls.hxx"
// FreeBSD works better with this included last ... (?)
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined( _MSC_VER )
# include <windows.h>
+#elif defined( __MINGW32__ )
+# include <winsock2.h>
#else
# include <netinet/in.h> // htonl() ntohl()
#endif
int i;
SGPropertyNode * node;
-/***************
+
if ( net_byte_order ) {
// convert from network byte order
net->version = htonl(net->version);
net->speedup = htonl(net->speedup);
net->freeze = htonl(net->freeze);
}
-*************/
+
if ( net->version != FG_NET_CTRLS_VERSION ) {
SG_LOG( SG_IO, SG_ALERT,
"Version mismatch with raw controls packet format." );
node->setDoubleValue( "wind-speed-kt", net->wind_speed_kt );
node->setDoubleValue( "wind-from-heading-deg", net->wind_dir_deg );
node->setDoubleValue( "turbulence/magnitude-norm", net->turbulence_norm );
- node->setBoolValue( "magnetic-variation-deg", net->magvar );
+ node->setDoubleValue( "magnetic-variation-deg", net->magvar );
node->setDoubleValue( "/environment/temperature-degc",
net->temp_c );