Tweaks to go along with changes in SGSocket.
This commit is contained in:
parent
4c0a3b3db4
commit
4f19d10485
2 changed files with 19 additions and 9 deletions
src/Main
|
@ -158,23 +158,32 @@ static FGProtocol *parse_port_config( const string& config )
|
||||||
ch->set_file_name( config.substr(begin) );
|
ch->set_file_name( config.substr(begin) );
|
||||||
FG_LOG( FG_IO, FG_INFO, " file name = " << ch->get_file_name() );
|
FG_LOG( FG_IO, FG_INFO, " file name = " << ch->get_file_name() );
|
||||||
} else if ( medium == "socket" ) {
|
} else if ( medium == "socket" ) {
|
||||||
SGSocket *ch = new SGSocket;
|
|
||||||
io->set_io_channel( ch );
|
|
||||||
|
|
||||||
// hostname
|
// hostname
|
||||||
end = config.find(",", begin);
|
end = config.find(",", begin);
|
||||||
if ( end == string::npos ) {
|
if ( end == string::npos ) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ch->set_hostname( config.substr(begin, end - begin) );
|
string hostname = config.substr(begin, end - begin);
|
||||||
begin = end + 1;
|
begin = end + 1;
|
||||||
FG_LOG( FG_IO, FG_INFO, " hostname = " << ch->get_hostname() );
|
FG_LOG( FG_IO, FG_INFO, " hostname = " << hostname );
|
||||||
|
|
||||||
// port
|
// port string
|
||||||
ch->set_port_str( config.substr(begin) );
|
end = config.find(",", begin);
|
||||||
FG_LOG( FG_IO, FG_INFO, " port string = " << ch->get_port_str() );
|
if ( end == string::npos ) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
string port = config.substr(begin, end - begin);
|
||||||
|
begin = end + 1;
|
||||||
|
FG_LOG( FG_IO, FG_INFO, " port string = " << port );
|
||||||
|
|
||||||
|
// socket style
|
||||||
|
string style_str = config.substr(begin);
|
||||||
|
FG_LOG( FG_IO, FG_INFO, " style string = " << style_str );
|
||||||
|
|
||||||
|
SGSocket *ch = new SGSocket( hostname, port, style_str );
|
||||||
|
io->set_io_channel( ch );
|
||||||
}
|
}
|
||||||
|
|
||||||
return io;
|
return io;
|
||||||
|
|
|
@ -554,10 +554,11 @@ fgOPTIONS::parse_fov( const string& arg ) {
|
||||||
// device = OS device name of serial line to be open()'ed
|
// device = OS device name of serial line to be open()'ed
|
||||||
// baud = {300, 1200, 2400, ..., 230400}
|
// baud = {300, 1200, 2400, ..., 230400}
|
||||||
//
|
//
|
||||||
// Socket exacmple "--native=socket,dir,hz,machine,port" where
|
// Socket exacmple "--native=socket,dir,hz,machine,port,style" where
|
||||||
//
|
//
|
||||||
// machine = machine name or ip address if client (leave empty if server)
|
// machine = machine name or ip address if client (leave empty if server)
|
||||||
// port = port, leave empty to let system choose
|
// port = port, leave empty to let system choose
|
||||||
|
// style = tcp or udp
|
||||||
//
|
//
|
||||||
// File example "--garmin=file,dir,hz,filename" where
|
// File example "--garmin=file,dir,hz,filename" where
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Reference in a new issue