1
0
Fork 0
flightgear/Serial/testserial.cxx

31 lines
573 B
C++
Raw Normal View History

1998-11-16 13:53:01 +00:00
#include <string>
1998-11-19 03:35:43 +00:00
#include <Debug/logstream.hxx>
1998-11-16 13:53:01 +00:00
#include "serial.hxx"
main () {
1998-11-19 03:35:43 +00:00
fgSERIAL port;
1998-11-16 13:53:01 +00:00
string value;
1998-11-19 03:35:43 +00:00
bool result;
fglog().setLogLevels( FG_ALL, FG_INFO );
cout << "start of main" << endl;
result = port.open_port("/dev/ttyS1");
cout << "opened port, result = " << result << endl;
result = port.set_baud(4800);
cout << "set baud, result = " << result << endl;
1998-11-16 13:53:01 +00:00
port.write_port("ATDT 626-9800\n");
while ( true ) {
value = port.read_port();
if ( value.length() ) {
cout << "-> " << value << endl;
}
}
}