Public Member Functions | Protected Member Functions | Private Attributes | List of all members
serial::Serial::SerialImpl Class Reference

#include <unix.h>

Public Member Functions

size_t available ()
 
void close ()
 
void flush ()
 
void flushInput ()
 
void flushOutput ()
 
unsigned long getBaudrate () const
 
bytesize_t getBytesize () const
 
bool getCD ()
 
bool getCTS ()
 
bool getDSR ()
 
flowcontrol_t getFlowcontrol () const
 
parity_t getParity () const
 
string getPort () const
 
bool getRI ()
 
stopbits_t getStopbits () const
 
Timeout getTimeout () const
 
bool isOpen () const
 
void open ()
 
size_t read (uint8_t *buf, size_t size=1)
 
void readLock ()
 
void readUnlock ()
 
void sendBreak (int duration)
 
 SerialImpl (const string &port, unsigned long baudrate, bytesize_t bytesize, parity_t parity, stopbits_t stopbits, flowcontrol_t flowcontrol)
 
void setBaudrate (unsigned long baudrate)
 
void setBreak (bool level)
 
void setBytesize (bytesize_t bytesize)
 
void setDTR (bool level)
 
void setFlowcontrol (flowcontrol_t flowcontrol)
 
void setParity (parity_t parity)
 
void setPort (const string &port)
 
void setRTS (bool level)
 
void setStopbits (stopbits_t stopbits)
 
void setTimeout (Timeout &timeout)
 
void waitByteTimes (size_t count)
 
bool waitForChange ()
 
bool waitReadable (uint32_t timeout)
 
size_t write (const uint8_t *data, size_t length)
 
void writeLock ()
 
void writeUnlock ()
 
virtual ~SerialImpl ()
 

Protected Member Functions

void reconfigurePort ()
 

Private Attributes

unsigned long baudrate_
 
uint32_t byte_time_ns_
 
bytesize_t bytesize_
 
int fd_
 
flowcontrol_t flowcontrol_
 
bool is_open_
 
parity_t parity_
 
string port_
 
pthread_mutex_t read_mutex
 
bool rtscts_
 
stopbits_t stopbits_
 
Timeout timeout_
 
pthread_mutex_t write_mutex
 
bool xonxoff_
 

Detailed Description

Definition at line 66 of file unix.h.

Constructor & Destructor Documentation

◆ SerialImpl()

Serial::SerialImpl::SerialImpl ( const string &  port,
unsigned long  baudrate,
bytesize_t  bytesize,
parity_t  parity,
stopbits_t  stopbits,
flowcontrol_t  flowcontrol 
)

Definition at line 108 of file unix.cc.

◆ ~SerialImpl()

Serial::SerialImpl::~SerialImpl ( )
virtual

Definition at line 122 of file unix.cc.

Member Function Documentation

◆ available()

size_t Serial::SerialImpl::available ( )

Definition at line 486 of file unix.cc.

◆ close()

void Serial::SerialImpl::close ( )

Definition at line 463 of file unix.cc.

◆ flush()

void Serial::SerialImpl::flush ( )

Definition at line 810 of file unix.cc.

◆ flushInput()

void Serial::SerialImpl::flushInput ( )

Definition at line 819 of file unix.cc.

◆ flushOutput()

void Serial::SerialImpl::flushOutput ( )

Definition at line 828 of file unix.cc.

◆ getBaudrate()

unsigned long Serial::SerialImpl::getBaudrate ( ) const

Definition at line 748 of file unix.cc.

◆ getBytesize()

serial::bytesize_t Serial::SerialImpl::getBytesize ( ) const

Definition at line 762 of file unix.cc.

◆ getCD()

bool Serial::SerialImpl::getCD ( )

Definition at line 1028 of file unix.cc.

◆ getCTS()

bool Serial::SerialImpl::getCTS ( )

Definition at line 965 of file unix.cc.

◆ getDSR()

bool Serial::SerialImpl::getDSR ( )

Definition at line 986 of file unix.cc.

◆ getFlowcontrol()

serial::flowcontrol_t Serial::SerialImpl::getFlowcontrol ( ) const

Definition at line 804 of file unix.cc.

◆ getParity()

serial::parity_t Serial::SerialImpl::getParity ( ) const

Definition at line 776 of file unix.cc.

◆ getPort()

string Serial::SerialImpl::getPort ( ) const

Definition at line 722 of file unix.cc.

◆ getRI()

bool Serial::SerialImpl::getRI ( )

Definition at line 1007 of file unix.cc.

◆ getStopbits()

serial::stopbits_t Serial::SerialImpl::getStopbits ( ) const

Definition at line 790 of file unix.cc.

◆ getTimeout()

serial::Timeout Serial::SerialImpl::getTimeout ( ) const

Definition at line 734 of file unix.cc.

◆ isOpen()

bool Serial::SerialImpl::isOpen ( ) const

Definition at line 480 of file unix.cc.

◆ open()

void Serial::SerialImpl::open ( )

Definition at line 130 of file unix.cc.

◆ read()

size_t Serial::SerialImpl::read ( uint8_t *  buf,
size_t  size = 1 
)

Definition at line 538 of file unix.cc.

◆ readLock()

void Serial::SerialImpl::readLock ( )

Definition at line 1049 of file unix.cc.

◆ readUnlock()

void Serial::SerialImpl::readUnlock ( )

Definition at line 1058 of file unix.cc.

◆ reconfigurePort()

void Serial::SerialImpl::reconfigurePort ( )
protected

Definition at line 160 of file unix.cc.

◆ sendBreak()

void Serial::SerialImpl::sendBreak ( int  duration)

Definition at line 837 of file unix.cc.

◆ setBaudrate()

void Serial::SerialImpl::setBaudrate ( unsigned long  baudrate)

Definition at line 740 of file unix.cc.

◆ setBreak()

void Serial::SerialImpl::setBreak ( bool  level)

Definition at line 846 of file unix.cc.

◆ setBytesize()

void Serial::SerialImpl::setBytesize ( serial::bytesize_t  bytesize)

Definition at line 754 of file unix.cc.

◆ setDTR()

void Serial::SerialImpl::setDTR ( bool  level)

Definition at line 896 of file unix.cc.

◆ setFlowcontrol()

void Serial::SerialImpl::setFlowcontrol ( serial::flowcontrol_t  flowcontrol)

Definition at line 796 of file unix.cc.

◆ setParity()

void Serial::SerialImpl::setParity ( serial::parity_t  parity)

Definition at line 768 of file unix.cc.

◆ setPort()

void Serial::SerialImpl::setPort ( const string &  port)

Definition at line 716 of file unix.cc.

◆ setRTS()

void Serial::SerialImpl::setRTS ( bool  level)

Definition at line 870 of file unix.cc.

◆ setStopbits()

void Serial::SerialImpl::setStopbits ( serial::stopbits_t  stopbits)

Definition at line 782 of file unix.cc.

◆ setTimeout()

void Serial::SerialImpl::setTimeout ( serial::Timeout timeout)

Definition at line 728 of file unix.cc.

◆ waitByteTimes()

void Serial::SerialImpl::waitByteTimes ( size_t  count)

Definition at line 531 of file unix.cc.

◆ waitForChange()

bool Serial::SerialImpl::waitForChange ( )

Definition at line 922 of file unix.cc.

◆ waitReadable()

bool Serial::SerialImpl::waitReadable ( uint32_t  timeout)

Definition at line 500 of file unix.cc.

◆ write()

size_t Serial::SerialImpl::write ( const uint8_t *  data,
size_t  length 
)

Error

Timeout

Port ready to write

Definition at line 615 of file unix.cc.

◆ writeLock()

void Serial::SerialImpl::writeLock ( )

Definition at line 1067 of file unix.cc.

◆ writeUnlock()

void Serial::SerialImpl::writeUnlock ( )

Definition at line 1076 of file unix.cc.

Member Data Documentation

◆ baudrate_

unsigned long serial::Serial::SerialImpl::baudrate_
private

Definition at line 203 of file unix.h.

◆ byte_time_ns_

uint32_t serial::Serial::SerialImpl::byte_time_ns_
private

Definition at line 204 of file unix.h.

◆ bytesize_

bytesize_t serial::Serial::SerialImpl::bytesize_
private

Definition at line 207 of file unix.h.

◆ fd_

int serial::Serial::SerialImpl::fd_
private

Definition at line 196 of file unix.h.

◆ flowcontrol_

flowcontrol_t serial::Serial::SerialImpl::flowcontrol_
private

Definition at line 209 of file unix.h.

◆ is_open_

bool serial::Serial::SerialImpl::is_open_
private

Definition at line 198 of file unix.h.

◆ parity_

parity_t serial::Serial::SerialImpl::parity_
private

Definition at line 206 of file unix.h.

◆ port_

string serial::Serial::SerialImpl::port_
private

Definition at line 195 of file unix.h.

◆ read_mutex

pthread_mutex_t serial::Serial::SerialImpl::read_mutex
private

Definition at line 212 of file unix.h.

◆ rtscts_

bool serial::Serial::SerialImpl::rtscts_
private

Definition at line 200 of file unix.h.

◆ stopbits_

stopbits_t serial::Serial::SerialImpl::stopbits_
private

Definition at line 208 of file unix.h.

◆ timeout_

Timeout serial::Serial::SerialImpl::timeout_
private

Definition at line 202 of file unix.h.

◆ write_mutex

pthread_mutex_t serial::Serial::SerialImpl::write_mutex
private

Definition at line 214 of file unix.h.

◆ xonxoff_

bool serial::Serial::SerialImpl::xonxoff_
private

Definition at line 199 of file unix.h.


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


serial
Author(s): William Woodall , John Harrison
autogenerated on Wed Mar 9 2022 03:10:03