1998-11-16 21:53:01 +08:00
|
|
|
#include <string>
|
|
|
|
|
1998-11-19 11:35:43 +08:00
|
|
|
#include <Debug/logstream.hxx>
|
|
|
|
|
1998-11-16 21:53:01 +08:00
|
|
|
#include "serial.hxx"
|
|
|
|
|
|
|
|
main () {
|
1998-11-19 11:35:43 +08:00
|
|
|
fgSERIAL port;
|
1998-11-16 21:53:01 +08:00
|
|
|
string value;
|
1998-11-19 11:35:43 +08: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 21:53:01 +08:00
|
|
|
|
|
|
|
port.write_port("ATDT 626-9800\n");
|
|
|
|
|
|
|
|
while ( true ) {
|
|
|
|
value = port.read_port();
|
|
|
|
if ( value.length() ) {
|
|
|
|
cout << "-> " << value << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|