Public Member Functions | Protected Member Functions | Private Attributes | List of all members
serial::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

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.

Serial::SerialImpl::~SerialImpl ( )
virtual

Definition at line 122 of file unix.cc.

Member Function Documentation

size_t Serial::SerialImpl::available ( )

Definition at line 481 of file unix.cc.

void Serial::SerialImpl::close ( )

Definition at line 458 of file unix.cc.

void Serial::SerialImpl::flush ( )

Definition at line 792 of file unix.cc.

void Serial::SerialImpl::flushInput ( )

Definition at line 801 of file unix.cc.

void Serial::SerialImpl::flushOutput ( )

Definition at line 810 of file unix.cc.

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

Definition at line 730 of file unix.cc.

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

Definition at line 744 of file unix.cc.

bool Serial::SerialImpl::getCD ( )

Definition at line 1010 of file unix.cc.

bool Serial::SerialImpl::getCTS ( )

Definition at line 947 of file unix.cc.

bool Serial::SerialImpl::getDSR ( )

Definition at line 968 of file unix.cc.

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

Definition at line 786 of file unix.cc.

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

Definition at line 758 of file unix.cc.

string Serial::SerialImpl::getPort ( ) const

Definition at line 704 of file unix.cc.

bool Serial::SerialImpl::getRI ( )

Definition at line 989 of file unix.cc.

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

Definition at line 772 of file unix.cc.

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

Definition at line 716 of file unix.cc.

bool Serial::SerialImpl::isOpen ( ) const

Definition at line 475 of file unix.cc.

void Serial::SerialImpl::open ( )

Definition at line 130 of file unix.cc.

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

Definition at line 533 of file unix.cc.

void Serial::SerialImpl::readLock ( )

Definition at line 1031 of file unix.cc.

void Serial::SerialImpl::readUnlock ( )

Definition at line 1040 of file unix.cc.

void Serial::SerialImpl::reconfigurePort ( )
protected

Definition at line 160 of file unix.cc.

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

Definition at line 819 of file unix.cc.

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

Definition at line 722 of file unix.cc.

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

Definition at line 828 of file unix.cc.

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

Definition at line 736 of file unix.cc.

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

Definition at line 878 of file unix.cc.

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

Definition at line 778 of file unix.cc.

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

Definition at line 750 of file unix.cc.

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

Definition at line 698 of file unix.cc.

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

Definition at line 852 of file unix.cc.

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

Definition at line 764 of file unix.cc.

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

Definition at line 710 of file unix.cc.

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

Definition at line 526 of file unix.cc.

bool Serial::SerialImpl::waitForChange ( )

Definition at line 904 of file unix.cc.

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

Definition at line 495 of file unix.cc.

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

Error

Timeout

Port ready to write

Definition at line 610 of file unix.cc.

void Serial::SerialImpl::writeLock ( )

Definition at line 1049 of file unix.cc.

void Serial::SerialImpl::writeUnlock ( )

Definition at line 1058 of file unix.cc.

Member Data Documentation

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

Definition at line 203 of file unix.h.

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

Definition at line 204 of file unix.h.

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

Definition at line 207 of file unix.h.

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

Definition at line 196 of file unix.h.

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

Definition at line 209 of file unix.h.

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

Definition at line 198 of file unix.h.

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

Definition at line 206 of file unix.h.

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

Definition at line 195 of file unix.h.

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

Definition at line 212 of file unix.h.

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

Definition at line 200 of file unix.h.

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

Definition at line 208 of file unix.h.

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

Definition at line 202 of file unix.h.

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

Definition at line 214 of file unix.h.

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

Definition at line 199 of file unix.h.


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


xarm_api
Author(s):
autogenerated on Sat May 8 2021 02:51:23