]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/fg_serial.cxx
UIUC flight model contribution. This is based on LaRCsim, but can read
[flightgear.git] / src / Network / fg_serial.cxx
index 5f70bea4b6c875d82e02e8d60cf751fa02b486ee..e1897b59c8920a7417e357325ca478cca798f0b6 100644 (file)
 // $Id$
 
 
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
 
 #include STL_STRING
 
-#include <Debug/logstream.hxx>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/serial/serial.hxx>
+
 #include <Aircraft/aircraft.hxx>
-#include <Serial/serial.hxx>
 
 #include "fg_serial.hxx"
 
@@ -112,7 +113,7 @@ int FGSerial::readline( char *buf, int length ) {
     // copy to external buffer
     strncpy( buf, save_buf, result );
     buf[result] = '\0';
-    cout << "fg_serial line = " << buf << endl;
+    FG_LOG( FG_IO, FG_INFO, "fg_serial line = " << buf );
 
     // shift save buffer
     for ( i = result; i < save_len; ++i ) {
@@ -136,6 +137,13 @@ int FGSerial::write( char *buf, int length ) {
 }
 
 
+// write null terminated string to port
+int FGSerial::writestring( char *str ) {
+    int length = strlen( str );
+    return write( str, length );
+}
+
+
 // close the port
 bool FGSerial::close() {
     if ( ! port.close_port() ) {