MRPT  1.9.9
rp::hal::serial_rxtx Class Referenceabstract

Detailed Description

Definition at line 40 of file abs_rxtx.h.

#include <rplidar/src/hal/abs_rxtx.h>

Inheritance diagram for rp::hal::serial_rxtx:

Public Types

enum  { ANS_OK = 0, ANS_TIMEOUT = -1, ANS_DEV_ERR = -2 }
 

Public Member Functions

 serial_rxtx ()
 
virtual ~serial_rxtx ()=default
 
virtual void flush (_u32 flags)=0
 
virtual bool bind (const char *portname, _u32 baudrate, _u32 flags=0)=0
 
virtual bool open ()=0
 
virtual void close ()=0
 
virtual int waitfordata (size_t data_count, _u32 timeout=-1, size_t *returned_size=nullptr)=0
 
virtual int senddata (const unsigned char *data, size_t size)=0
 
virtual int recvdata (unsigned char *data, size_t size)=0
 
virtual int waitforsent (_u32 timeout=-1, size_t *returned_size=nullptr)=0
 
virtual int waitforrecv (_u32 timeout=-1, size_t *returned_size=nullptr)=0
 
virtual size_t rxqueue_count ()=0
 
virtual void setDTR ()=0
 
virtual void clearDTR ()=0
 
virtual bool isOpened ()
 

Static Public Member Functions

static serial_rxtxCreateRxTx ()
 
static void ReleaseRxTx (serial_rxtx *)
 

Protected Attributes

volatile bool _is_serial_opened
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ANS_OK 
ANS_TIMEOUT 
ANS_DEV_ERR 

Definition at line 43 of file abs_rxtx.h.

Constructor & Destructor Documentation

◆ serial_rxtx()

rp::hal::serial_rxtx::serial_rxtx ( )
inline

Definition at line 53 of file abs_rxtx.h.

◆ ~serial_rxtx()

virtual rp::hal::serial_rxtx::~serial_rxtx ( )
virtualdefault

Member Function Documentation

◆ bind()

virtual bool rp::hal::serial_rxtx::bind ( const char *  portname,
_u32  baudrate,
_u32  flags = 0 
)
pure virtual

Implemented in rp::arch::net::raw_serial, rp::arch::net::raw_serial, and rp::arch::net::raw_serial.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::connect().

Here is the caller graph for this function:

◆ clearDTR()

virtual void rp::hal::serial_rxtx::clearDTR ( )
pure virtual

Implemented in rp::arch::net::raw_serial, rp::arch::net::raw_serial, and rp::arch::net::raw_serial.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::startMotor().

Here is the caller graph for this function:

◆ close()

virtual void rp::hal::serial_rxtx::close ( )
pure virtual

Implemented in rp::arch::net::raw_serial, rp::arch::net::raw_serial, and rp::arch::net::raw_serial.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::disconnect().

Here is the caller graph for this function:

◆ CreateRxTx()

serial_rxtx * rp::hal::serial_rxtx::CreateRxTx ( )
static

Definition at line 314 of file linux/net_serial.cpp.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::RPlidarDriverSerialImpl().

Here is the caller graph for this function:

◆ flush()

virtual void rp::hal::serial_rxtx::flush ( _u32  flags)
pure virtual

Implemented in rp::arch::net::raw_serial, rp::arch::net::raw_serial, and rp::arch::net::raw_serial.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::connect().

Here is the caller graph for this function:

◆ isOpened()

virtual bool rp::hal::serial_rxtx::isOpened ( )
inlinevirtual

Definition at line 78 of file abs_rxtx.h.

References _is_serial_opened.

Referenced by rp::arch::net::raw_serial::clearDTR(), rp::arch::net::raw_serial::open(), rp::arch::net::raw_serial::recvdata(), rp::arch::net::raw_serial::rxqueue_count(), rp::arch::net::raw_serial::senddata(), rp::arch::net::raw_serial::setDTR(), rp::arch::net::raw_serial::waitfordata(), and rp::arch::net::raw_serial::waitforrecv().

Here is the caller graph for this function:

◆ open()

virtual bool rp::hal::serial_rxtx::open ( )
pure virtual

Implemented in rp::arch::net::raw_serial, rp::arch::net::raw_serial, and rp::arch::net::raw_serial.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::connect().

Here is the caller graph for this function:

◆ recvdata()

◆ ReleaseRxTx()

void rp::hal::serial_rxtx::ReleaseRxTx ( serial_rxtx rxtx)
static

Definition at line 319 of file linux/net_serial.cpp.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::~RPlidarDriverSerialImpl().

Here is the caller graph for this function:

◆ rxqueue_count()

virtual size_t rp::hal::serial_rxtx::rxqueue_count ( )
pure virtual

◆ senddata()

virtual int rp::hal::serial_rxtx::senddata ( const unsigned char *  data,
size_t  size 
)
pure virtual

Implemented in rp::arch::net::raw_serial, and rp::arch::net::raw_serial.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::_sendCommand().

Here is the caller graph for this function:

◆ setDTR()

virtual void rp::hal::serial_rxtx::setDTR ( )
pure virtual

Implemented in rp::arch::net::raw_serial, rp::arch::net::raw_serial, and rp::arch::net::raw_serial.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::stopMotor().

Here is the caller graph for this function:

◆ waitfordata()

◆ waitforrecv()

virtual int rp::hal::serial_rxtx::waitforrecv ( _u32  timeout = -1,
size_t *  returned_size = nullptr 
)
pure virtual

◆ waitforsent()

virtual int rp::hal::serial_rxtx::waitforsent ( _u32  timeout = -1,
size_t *  returned_size = nullptr 
)
pure virtual

Member Data Documentation

◆ _is_serial_opened

volatile bool rp::hal::serial_rxtx::_is_serial_opened
protected



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019