SysIo  1.9.0
Embedded Library and tools
Serial Class Reference

#include <serial.hpp>

Public Types

enum  DataBits {
  Data5 = SERIAL_DATABIT_5, Data6 = SERIAL_DATABIT_6, Data7 = SERIAL_DATABIT_7, Data8 = SERIAL_DATABIT_8,
  UnknownDataBits = SERIAL_DATABIT_UNKNOWN
}
 
enum  FlowControl { NoFlowControl = SERIAL_FLOW_NONE, HardwareControl = SERIAL_FLOW_RTSCTS, SoftwareControl = SERIAL_FLOW_XONXOFF, UnknownFlowControl = SERIAL_FLOW_UNKNOWN }
 
enum  Parity {
  NoParity = SERIAL_PARITY_NONE, EvenParity = SERIAL_PARITY_EVEN, OddParity = SERIAL_PARITY_ODD, SpaceParity = SERIAL_PARITY_SPACE,
  MarkParity = SERIAL_PARITY_MARK, UnknownParity = SERIAL_PARITY_UNKNOWN
}
 
enum  StopBits { OneStop = SERIAL_STOPBIT_ONE, TwoStop = SERIAL_STOPBIT_TWO, OneAndHalfStop = SERIAL_STOPBIT_ONEHALF, UnknownStopBits = SERIAL_STOPBIT_UNKNOWN }
 

Public Member Functions

int baudrate () const
 
void close ()
 
int fileno () const
 
FlowControl flowControl () const
 
const char * flowControlName () const
 
void flush ()
 
bool open ()
 
const char * port () const
 
 Serial (const char *portname, int baudrate)
 
void setBaudrate (int baudrate)
 
bool setFlowControl (FlowControl newFlowControl)
 
bool setFlowControlName (const char *newFlowControl)
 
void setPort (const char *portname)
 
 ~Serial ()
 

Detailed Description

Port série

Definition at line 26 of file serial.hpp.

Member Enumeration Documentation

Nombre de bits de données

Definition at line 32 of file serial.hpp.

32  {
33 
34  Data5 = SERIAL_DATABIT_5,
35  Data6 = SERIAL_DATABIT_6,
36  Data7 = SERIAL_DATABIT_7,
37  Data8 = SERIAL_DATABIT_8,
38  UnknownDataBits = SERIAL_DATABIT_UNKNOWN
39  } DataBits;
DataBits
Definition: serial.hpp:32

Contrôle de flux

Enumerator
NoFlowControl 

Sans

HardwareControl 

Matériel (RTS/CTS)

SoftwareControl 

Logiciel (XON/XOFF)

UnknownFlowControl 

Inconnu

Definition at line 68 of file serial.hpp.

Parité

Definition at line 55 of file serial.hpp.

55  {
56 
57  NoParity = SERIAL_PARITY_NONE,
58  EvenParity = SERIAL_PARITY_EVEN,
59  OddParity = SERIAL_PARITY_ODD,
60  SpaceParity = SERIAL_PARITY_SPACE,
61  MarkParity = SERIAL_PARITY_MARK,
62  UnknownParity = SERIAL_PARITY_UNKNOWN
63  } Parity;
Parity
Definition: serial.hpp:55

Nombre de bits de stop

Definition at line 44 of file serial.hpp.

44  {
45 
46  OneStop = SERIAL_STOPBIT_ONE,
47  TwoStop = SERIAL_STOPBIT_TWO,
48  OneAndHalfStop = SERIAL_STOPBIT_ONEHALF,
49  UnknownStopBits = SERIAL_STOPBIT_UNKNOWN
50  } StopBits;
StopBits
Definition: serial.hpp:44

Constructor & Destructor Documentation

Serial::Serial ( const char *  portname,
int  baudrate 
)

Consctructeur

Serial::~Serial ( )

Destructeur

Member Function Documentation

int Serial::baudrate ( ) const

Vitesse

void Serial::close ( )

Ferme le port

int Serial::fileno ( ) const

Descripteur de fichier d'un port ouvert

FlowControl Serial::flowControl ( ) const

Contrôle de flux

const char* Serial::flowControlName ( ) const

Contrôle de flux sous forme de texte

void Serial::flush ( )

Vide les tampons

bool Serial::open ( )

Ouverture

const char* Serial::port ( ) const

Nom du port

void Serial::setBaudrate ( int  baudrate)

Modification vitesse

bool Serial::setFlowControl ( FlowControl  newFlowControl)

Modifie le contrôle de flux

bool Serial::setFlowControlName ( const char *  newFlowControl)

Modifie le contrôle de flux à partir du nom

void Serial::setPort ( const char *  portname)

Modifie le nom du port