head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.35; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.50; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.58; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.54; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# FGSerialPort Class Reference

A class to encapsulate low level serial port IO. More...

`#include <serial.hxx>`

List of all members.

## Public Methods
| FGSerialPort ()
| Default constructor.
| FGSerialPort (const string &device, int baud)
| Constructor.
| ~FGSerialPort ()
| Destructor.
bool | open_port (const string &device)
| Open a the serial port.
bool | close_port ()
| Close the serial port.
bool | set_baud (int baud)
| Set baud rate.
string | read_port ()
| Read from the serial port.
int | read_port (char *buf, int len)
| Read from the serial port.
int | write_port (const string &value)
| Write to the serial port.
int | write_port (const char *buf, int len)
| Write to the serial port.
bool | is_enabled ()

## Detailed Description

A class to encapsulate low level serial port IO.

Definition at line 51 of file serial.hxx.

## Constructor & Destructor Documentation

FGSerialPort::FGSerialPort | ( | const string & | device,
|  | int | baud
| ) |

  | Constructor. Parameters:
  device | device name
  baud | baud rate
Definition at line 61 of file serial.cxx. References open_port(), and set_baud().

## Member Function Documentation

bool FGSerialPort::close_port | ( |  | ) |

| Close the serial port. Returns: success/failure Definition at line 157 of file serial.cxx. Referenced by SGSerial::close().

bool FGSerialPort::is_enabled | ( |  | ) | `[inline]`

| Returns: true if device open Definition at line 122 of file serial.hxx.

bool FGSerialPort::open_port | ( | const string & | device | ) |

  | Open a the serial port. Parameters:
  device | name of device
Returns: success/failure Definition at line 75 of file serial.cxx. References SG_LOG. Referenced by FGSerialPort(), and SGSerial::open().

int FGSerialPort::read_port | ( | char * | buf,
|  | int | len
| ) |

  | Read from the serial port. Parameters:
  buf | input buffer
  len | length of buffer (i.e. max number of bytes to read
Returns: number of bytes read Definition at line 270 of file serial.cxx. References SG_LOG.

string FGSerialPort::read_port | ( |  | ) |

| Read from the serial port. Returns: line of data Definition at line 234 of file serial.cxx. References SG_LOG. Referenced by SGSerial::read(), and SGSerial::readline().

bool FGSerialPort::set_baud | ( | int | baud | ) |

  | Set baud rate. Parameters:
  baud | baud rate
Returns: success/failure Definition at line 170 of file serial.cxx. References SG_LOG. Referenced by FGSerialPort(), and SGSerial::open().

int FGSerialPort::write_port | ( | const char * | buf,
|  | int | len
| ) |

  | Write to the serial port. Parameters:
  buf | pointer to character buffer containing output data
  len | number of bytes to write from the buffer
Returns: number of bytes written Definition at line 380 of file serial.cxx. References SG_LOG.

int FGSerialPort::write_port | ( | const string & | value | ) |

  | Write to the serial port. Parameters:
  value | output string
Returns: number of bytes written Definition at line 304 of file serial.cxx. References SG_LOG. Referenced by SGSerial::write().

The documentation for this class was generated from the following files:

- serial.hxx
- serial.cxx

@ 1.3 log @Oops, try again. @ text @d450 1 a450 1