Rename FGSerialPort to SGSerialPort.
This commit is contained in:
parent
789b56872c
commit
b3f88735a8
7
Doxyfile
7
Doxyfile
@ -312,7 +312,6 @@ INPUT = \
|
|||||||
simgear/serial \
|
simgear/serial \
|
||||||
simgear/sg_inlines.h \
|
simgear/sg_inlines.h \
|
||||||
simgear/sg_traits.hxx \
|
simgear/sg_traits.hxx \
|
||||||
simgear/sg_zlib.h \
|
|
||||||
simgear/sky \
|
simgear/sky \
|
||||||
simgear/threads \
|
simgear/threads \
|
||||||
simgear/timing \
|
simgear/timing \
|
||||||
@ -385,7 +384,7 @@ FILTER_SOURCE_FILES = NO
|
|||||||
# of all compounds will be generated. Enable this if the project
|
# of all compounds will be generated. Enable this if the project
|
||||||
# contains a lot of classes, structs, unions or interfaces.
|
# contains a lot of classes, structs, unions or interfaces.
|
||||||
|
|
||||||
ALPHABETICAL_INDEX = NO
|
ALPHABETICAL_INDEX = YES
|
||||||
|
|
||||||
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
|
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
|
||||||
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
||||||
@ -481,7 +480,7 @@ ENUM_VALUES_PER_LINE = 4
|
|||||||
# JavaScript and frames is required (for instance Netscape 4.0+
|
# JavaScript and frames is required (for instance Netscape 4.0+
|
||||||
# or Internet explorer 4.0+).
|
# or Internet explorer 4.0+).
|
||||||
|
|
||||||
GENERATE_TREEVIEW = NO
|
GENERATE_TREEVIEW = YES
|
||||||
|
|
||||||
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
|
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
|
||||||
# used to set the initial width (in pixels) of the frame in which the tree
|
# used to set the initial width (in pixels) of the frame in which the tree
|
||||||
@ -514,7 +513,7 @@ COMPACT_LATEX = NO
|
|||||||
# by the printer. Possible values are: a4, a4wide, letter, legal and
|
# by the printer. Possible values are: a4, a4wide, letter, legal and
|
||||||
# executive. If left blank a4wide will be used.
|
# executive. If left blank a4wide will be used.
|
||||||
|
|
||||||
PAPER_TYPE = a4wide
|
PAPER_TYPE = letter
|
||||||
|
|
||||||
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
|
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
|
||||||
# packages that should be included in the LaTeX output.
|
# packages that should be included in the LaTeX output.
|
||||||
|
@ -55,7 +55,7 @@ class SGSerial : public SGIOChannel {
|
|||||||
|
|
||||||
string device;
|
string device;
|
||||||
string baud;
|
string baud;
|
||||||
FGSerialPort port;
|
SGSerialPort port;
|
||||||
|
|
||||||
char save_buf[ 2 * SG_IO_MAX_MSG_SIZE ];
|
char save_buf[ 2 * SG_IO_MAX_MSG_SIZE ];
|
||||||
int save_len;
|
int save_len;
|
||||||
|
@ -46,13 +46,13 @@
|
|||||||
|
|
||||||
#include "serial.hxx"
|
#include "serial.hxx"
|
||||||
|
|
||||||
FGSerialPort::FGSerialPort()
|
SGSerialPort::SGSerialPort()
|
||||||
: dev_open(false)
|
: dev_open(false)
|
||||||
{
|
{
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
FGSerialPort::FGSerialPort(const string& device, int baud) {
|
SGSerialPort::SGSerialPort(const string& device, int baud) {
|
||||||
open_port(device);
|
open_port(device);
|
||||||
|
|
||||||
if ( dev_open ) {
|
if ( dev_open ) {
|
||||||
@ -60,13 +60,13 @@ FGSerialPort::FGSerialPort(const string& device, int baud) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FGSerialPort::~FGSerialPort() {
|
SGSerialPort::~SGSerialPort() {
|
||||||
// closing the port here screws us up because if we would even so
|
// closing the port here screws us up because if we would even so
|
||||||
// much as make a copy of an FGSerialPort object and then delete it,
|
// much as make a copy of an SGSerialPort object and then delete it,
|
||||||
// the file descriptor gets closed. Doh!!!
|
// the file descriptor gets closed. Doh!!!
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FGSerialPort::open_port(const string& device) {
|
bool SGSerialPort::open_port(const string& device) {
|
||||||
|
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ bool FGSerialPort::open_port(const string& device) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FGSerialPort::close_port() {
|
bool SGSerialPort::close_port() {
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
CloseHandle( fd );
|
CloseHandle( fd );
|
||||||
#else
|
#else
|
||||||
@ -161,7 +161,7 @@ bool FGSerialPort::close_port() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FGSerialPort::set_baud(int baud) {
|
bool SGSerialPort::set_baud(int baud) {
|
||||||
|
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ bool FGSerialPort::set_baud(int baud) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string FGSerialPort::read_port() {
|
string SGSerialPort::read_port() {
|
||||||
|
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ string FGSerialPort::read_port() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int FGSerialPort::read_port(char *buf, int len) {
|
int SGSerialPort::read_port(char *buf, int len) {
|
||||||
|
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ int FGSerialPort::read_port(char *buf, int len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FGSerialPort::write_port(const string& value) {
|
int SGSerialPort::write_port(const string& value) {
|
||||||
|
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ int FGSerialPort::write_port(const string& value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int FGSerialPort::write_port(const char* buf, int len) {
|
int SGSerialPort::write_port(const char* buf, int len) {
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
|
|
||||||
LPCVOID lpBuffer = buf;
|
LPCVOID lpBuffer = buf;
|
||||||
|
@ -48,7 +48,7 @@ SG_USING_STD(string);
|
|||||||
/**
|
/**
|
||||||
* A class to encapsulate low level serial port IO.
|
* A class to encapsulate low level serial port IO.
|
||||||
*/
|
*/
|
||||||
class FGSerialPort
|
class SGSerialPort
|
||||||
{
|
{
|
||||||
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
|
||||||
typedef HANDLE fd_type;
|
typedef HANDLE fd_type;
|
||||||
@ -64,17 +64,17 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/** Default constructor */
|
/** Default constructor */
|
||||||
FGSerialPort();
|
SGSerialPort();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param device device name
|
* @param device device name
|
||||||
* @param baud baud rate
|
* @param baud baud rate
|
||||||
*/
|
*/
|
||||||
FGSerialPort(const string& device, int baud);
|
SGSerialPort(const string& device, int baud);
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
~FGSerialPort();
|
~SGSerialPort();
|
||||||
|
|
||||||
/** Open a the serial port
|
/** Open a the serial port
|
||||||
* @param device name of device
|
* @param device name of device
|
||||||
|
@ -11,7 +11,7 @@ SG_USING_STD(cout);
|
|||||||
SG_USING_STD(endl);
|
SG_USING_STD(endl);
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
FGSerialPort port;
|
SGSerialPort port;
|
||||||
string value;
|
string value;
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user