SoDaRadio-5.0.3-master:8901fb5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SoDa::SerialDev Class Reference

#include <SerialDev.hxx>

Public Member Functions

 SerialDev (const std::string &devname, unsigned int speed=9600, bool par_ena=false, bool par_even=true)
 
bool putString (const std::string &str)
 
bool getString (std::string &str, unsigned int maxlen)
 
bool palindromeCommand (std::string &str)
 
bool flushInput ()
 
bool flushOutput ()
 

Private Member Functions

int getSpeed (int spd)
 

Private Attributes

bool serial_port_open
 
int port
 

Detailed Description

Definition at line 39 of file SerialDev.hxx.

Constructor & Destructor Documentation

◆ SerialDev()

SoDa::SerialDev::SerialDev ( const std::string &  devname,
unsigned int  speed = 9600,
bool  par_ena = false,
bool  par_even = true 
)

Definition at line 49 of file SerialDev.cxx.

References getSpeed(), and port.

Member Function Documentation

◆ flushInput()

bool SoDa::SerialDev::flushInput ( )

Definition at line 167 of file SerialDev.cxx.

References port.

Referenced by palindromeCommand().

◆ flushOutput()

bool SoDa::SerialDev::flushOutput ( )

Definition at line 172 of file SerialDev.cxx.

References port.

◆ getSpeed()

int SoDa::SerialDev::getSpeed ( int  spd)
private

Definition at line 152 of file SerialDev.cxx.

Referenced by SerialDev().

◆ getString()

bool SoDa::SerialDev::getString ( std::string &  str,
unsigned int  maxlen 
)

Definition at line 117 of file SerialDev.cxx.

References port, and serial_port_open.

Referenced by main(), and palindromeCommand().

◆ palindromeCommand()

bool SoDa::SerialDev::palindromeCommand ( std::string &  str)

Definition at line 178 of file SerialDev.cxx.

References flushInput(), getString(), and putString().

Referenced by main().

◆ putString()

bool SoDa::SerialDev::putString ( const std::string &  str)

Definition at line 108 of file SerialDev.cxx.

References port, and serial_port_open.

Referenced by main(), and palindromeCommand().

Member Data Documentation

◆ port

int SoDa::SerialDev::port
private

Definition at line 57 of file SerialDev.hxx.

Referenced by flushInput(), flushOutput(), getString(), putString(), and SerialDev().

◆ serial_port_open

bool SoDa::SerialDev::serial_port_open
private

Definition at line 55 of file SerialDev.hxx.

Referenced by getString(), and putString().


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