Cygnus tools compatibility tweaks.
This commit is contained in:
parent
d7748704d7
commit
3730ce404f
@ -22,6 +22,7 @@
|
|||||||
// (Log is kept at end of this file)
|
// (Log is kept at end of this file)
|
||||||
|
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -89,7 +90,7 @@ bool fgSERIAL::open_port(const string& device) {
|
|||||||
|
|
||||||
bool fgSERIAL::set_baud(int baud) {
|
bool fgSERIAL::set_baud(int baud) {
|
||||||
struct termios config;
|
struct termios config;
|
||||||
speed_t speed;
|
speed_t speed = B9600;
|
||||||
|
|
||||||
if ( tcgetattr( fd, &config ) != 0 ) {
|
if ( tcgetattr( fd, &config ) != 0 ) {
|
||||||
FG_LOG( FG_SERIAL, FG_ALERT, "Unable to poll port settings" );
|
FG_LOG( FG_SERIAL, FG_ALERT, "Unable to poll port settings" );
|
||||||
@ -114,8 +115,10 @@ bool fgSERIAL::set_baud(int baud) {
|
|||||||
speed = B57600;
|
speed = B57600;
|
||||||
} else if ( baud == 115200 ) {
|
} else if ( baud == 115200 ) {
|
||||||
speed = B115200;
|
speed = B115200;
|
||||||
|
#if defined( linux ) || defined( __FreeBSD__ )
|
||||||
} else if ( baud == 230400 ) {
|
} else if ( baud == 230400 ) {
|
||||||
speed = B230400;
|
speed = B230400;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
FG_LOG( FG_SERIAL, FG_ALERT, "Unsupported baud rate " << baud );
|
FG_LOG( FG_SERIAL, FG_ALERT, "Unsupported baud rate " << baud );
|
||||||
return false;
|
return false;
|
||||||
@ -180,6 +183,9 @@ int fgSERIAL::write_port(const string& value) {
|
|||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.4 1998/11/23 21:47:00 curt
|
||||||
|
// Cygnus tools compatibility tweaks.
|
||||||
|
//
|
||||||
// Revision 1.3 1998/11/19 13:52:54 curt
|
// Revision 1.3 1998/11/19 13:52:54 curt
|
||||||
// port configuration tweaks & experiments.
|
// port configuration tweaks & experiments.
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user