]> git.mxchange.org Git - simgear.git/blob - simgear/serial/testserial.cxx
Fixed a warning message.
[simgear.git] / simgear / serial / testserial.cxx
1 #include <string>
2
3 #include <simgear/debug/logstream.hxx>
4
5 #include "serial.hxx"
6
7 int main () {
8     FGSerialPort port;
9     string value;
10     bool result;
11
12     fglog().setLogLevels( FG_ALL, FG_INFO );
13
14     cout << "start of main" << endl;
15
16     result = port.open_port("/dev/ttyS1");
17     cout << "opened port, result = " << result << endl;
18
19     result = port.set_baud(4800);
20     cout << "set baud, result = " << result << endl;
21
22     port.write_port("ATDT 626-9800\n");
23
24     while ( true ) {
25         value = port.read_port();
26         if ( value.length() ) {
27             cout << "-> " << value << endl;
28         }
29     }
30
31     return 0;
32 }