]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/fg_serial.hxx
Added an FGIOChannel::writestring().
[flightgear.git] / src / Network / fg_serial.hxx
index 34075f76206dcb6354bba6971686faf9d84b0f72..80afd0131b27db596fbbb94ae57bb501413e3a52 100644 (file)
@@ -53,6 +53,9 @@ class FGSerial : public FGIOChannel {
     string baud;
     FGSerialPort port;
 
+    char save_buf[ 2 * FG_MAX_MSG_SIZE ];
+    int save_len;
+
 public:
 
     FGSerial();
@@ -61,11 +64,17 @@ public:
     // open the serial port based on specified direction
     bool open( FGProtocol::fgProtocolDir dir );
 
-    // read data from port
-    bool read( char *buf, int *length );
+    // read a block of data of specified size
+    int read( char *buf, int length );
+
+    // read a line of data, length is max size of input buffer
+    int readline( char *buf, int length );
 
     // write data to port
-    bool write( char *buf, int length );
+    int write( char *buf, int length );
+
+    // write null terminated string to port
+    int writestring( char *str );
 
     // close port
     bool close();