- ch->set_device( config.substr(begin, end - begin) );
- begin = end + 1;
- FG_LOG( FG_IO, FG_INFO, " device = " << ch->get_device() );
-
- // baud
- ch->set_baud( config.substr(begin) );
- FG_LOG( FG_IO, FG_INFO, " baud = " << ch->get_baud() );
-
- io->set_io_channel( ch );
- } else if ( medium == "file" ) {
- FGFile *ch = new FGFile;
- io->set_io_channel( ch );
-
- // file name
- ch->set_file_name( config.substr(begin) );
- FG_LOG( FG_IO, FG_INFO, " file name = " << ch->get_file_name() );
- } else if ( medium == "socket" ) {
- FGSocket *ch = new FGSocket;
- io->set_io_channel( ch );
-
- // hostname
- end = config.find(",", begin);
- if ( end == string::npos ) {
- return NULL;
- }
+ string device = config.substr(begin, end - begin);
+ begin = end + 1;
+ SG_LOG( SG_IO, SG_INFO, " device = " << device );
+
+ // baud
+ string baud = config.substr(begin);
+ SG_LOG( SG_IO, SG_INFO, " baud = " << baud );
+
+ SGSerial *ch = new SGSerial( device, baud );
+ io->set_io_channel( ch );
+ } else if ( medium == "file" ) {
+ // file name
+ string file = config.substr(begin);
+ SG_LOG( SG_IO, SG_INFO, " file name = " << file );
+
+ SGFile *ch = new SGFile( file );
+ io->set_io_channel( ch );
+ } else if ( medium == "socket" ) {
+ // hostname
+ end = config.find(",", begin);
+ if ( end == string::npos ) {
+ return NULL;
+ }