valid = false;
}
- // we want to block for incoming data in order to syncronize frame
- // rates.
- data_server.setBlocking( false /* don't block while testing */ );
- // data_server.setBlocking( true /* don't block while testing */ );
+ // disable blocking
+ data_server.setBlocking( false );
+
+ // allowed to read from a broadcast addr
+ // data_server.setBroadcast( true );
// if we bind to fdm_host = "" then we accept messages from
// anyone.
- if ( data_server.bind( fdm_host.c_str(), data_in_port ) == -1 ) {
+ if ( data_server.bind( "", data_in_port ) == -1 ) {
printf("error binding to port %d\n", data_in_port);
valid = false;
}
new HTTPClient( fdm_host.c_str(), cmd_port, cmd );
netChannel::loop(0);
+ SG_LOG( SG_IO, SG_INFO, "before sending reset command." );
+
sprintf( cmd, "/reset?value=ground" );
new HTTPClient( fdm_host.c_str(), cmd_port, cmd );
netChannel::loop(0);
+
+ SG_LOG( SG_IO, SG_INFO, "Remote FDM init() finished." );
}
length = sizeof(ctrls);
global2raw( &ctrls );
if ( data_client.send( (char *)(& ctrls), length, 0 ) != length ) {
- SG_LOG( SG_IO, SG_ALERT, "Error writing data." );
+ SG_LOG( SG_IO, SG_DEBUG, "Error writing data." );
} else {
- SG_LOG( SG_IO, SG_ALERT, "wrote control data." );
+ SG_LOG( SG_IO, SG_DEBUG, "wrote control data." );
}
// Read next set of FDM data (blocking enabled to maintain 'sync')