# error This library requires C++
#endif
-#include "Include/compiler.h"
+#include <simgear/compiler.h>
#include <string>
// # include <time.h>
// #endif
-#include <Serial/serial.hxx>
+#include <simgear/serial/serial.hxx>
#include "iochannel.hxx"
#include "protocol.hxx"
string baud;
FGSerialPort port;
+ char save_buf[ 2 * FG_MAX_MSG_SIZE ];
+ int save_len;
+
public:
FGSerial();
// 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();