Public Member Functions | List of all members
sl::IChannel Class Referenceabstract

#include <sl_lidar_driver.h>

Inheritance diagram for sl::IChannel:
Inheritance graph
[legend]

Public Member Functions

virtual void clearReadCache ()=0
 
virtual void close ()=0
 
virtual void flush ()=0
 
virtual int getChannelType ()=0
 
virtual bool open ()=0
 
virtual int read (void *buffer, size_t size)=0
 
virtual bool waitForData (size_t size, sl_u32 timeoutInMs=-1, size_t *actualReady=nullptr)=0
 
virtual sl_result waitForDataExt (size_t &size_hint, sl_u32 timeoutInMs=1000)=0
 
virtual int write (const void *data, size_t size)=0
 
virtual ~IChannel ()
 

Detailed Description

Abstract interface of communication channel

Definition at line 171 of file sl_lidar_driver.h.

Constructor & Destructor Documentation

◆ ~IChannel()

virtual sl::IChannel::~IChannel ( )
inlinevirtual

Definition at line 174 of file sl_lidar_driver.h.

Member Function Documentation

◆ clearReadCache()

virtual void sl::IChannel::clearReadCache ( )
pure virtual

Clear read cache

Implemented in sl::SerialPortChannel, sl::UdpChannel, and sl::TcpChannel.

◆ close()

virtual void sl::IChannel::close ( )
pure virtual

Close communication channel

Implemented in sl::SerialPortChannel, sl::TcpChannel, and sl::UdpChannel.

◆ flush()

virtual void sl::IChannel::flush ( )
pure virtual

Flush all written data to remote endpoint

Implemented in sl::SerialPortChannel, sl::TcpChannel, and sl::UdpChannel.

◆ getChannelType()

virtual int sl::IChannel::getChannelType ( )
pure virtual

◆ open()

virtual bool sl::IChannel::open ( )
pure virtual

Open communication channel (return true if succeed)

Implemented in sl::SerialPortChannel, sl::TcpChannel, and sl::UdpChannel.

◆ read()

virtual int sl::IChannel::read ( void *  buffer,
size_t  size 
)
pure virtual

Read data from the chanel

Parameters
bufferThe buffer to receive data
sizeThe size of the read buffer
Returns
Bytes read (negative for read failure)

Implemented in sl::SerialPortChannel, sl::TcpChannel, and sl::UdpChannel.

◆ waitForData()

virtual bool sl::IChannel::waitForData ( size_t  size,
sl_u32  timeoutInMs = -1,
size_t *  actualReady = nullptr 
)
pure virtual

Wait for some data

Parameters
sizeBytes to wait
timeoutInMsWait timeout (in microseconds, -1 for forever)
actualReady[out] actual ready bytes
Returns
true for data ready

Implemented in sl::SerialPortChannel, sl::TcpChannel, and sl::UdpChannel.

◆ waitForDataExt()

virtual sl_result sl::IChannel::waitForDataExt ( size_t &  size_hint,
sl_u32  timeoutInMs = 1000 
)
pure virtual

Wait for some data

Parameters
size_hintByte count may available to retrieve without beening blocked
timeoutInMsWait timeout (in microseconds, -1 for forever)
Returns
RESULT_OK if there is data available for receiving RESULT_OPERATION_TIMEOUT if the given timeout duration is exceed RESULT_OPERATION_FAIL if there is something wrong with the channel

Implemented in sl::SerialPortChannel, sl::TcpChannel, and sl::UdpChannel.

◆ write()

virtual int sl::IChannel::write ( const void *  data,
size_t  size 
)
pure virtual

Send data to remote endpoint

Parameters
dataThe data buffer
sizeThe size of data buffer (in bytes)
Returns
Bytes written (negative for write failure)

Implemented in sl::SerialPortChannel, sl::TcpChannel, and sl::UdpChannel.


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


rplidar_ros
Author(s):
autogenerated on Fri Aug 2 2024 08:42:14