Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
cISSerialPort Class Reference

#include <ISSerialPort.h>

Inheritance diagram for cISSerialPort:
Inheritance graph
[legend]

Public Member Functions

 cISSerialPort (serial_port_t *serial=NULL)
 
int Close () OVERRIDE
 
bool IsOpen ()
 
bool Open (const std::string &portName, int baudRate=BAUDRATE_921600, int timeout=0, bool blocking=false)
 
int Read (void *data, int dataLength) OVERRIDE
 
int Write (const void *data, int dataLength) OVERRIDE
 
virtual ~cISSerialPort ()
 
- Public Member Functions inherited from cISStream
 cISStream ()
 
virtual int Flush ()
 
virtual long long GetBytesAvailableToRead ()
 
virtual ~cISStream ()
 

Static Public Member Functions

static void GetComPorts (vector< string > &ports)
 

Private Member Functions

 cISSerialPort (const cISSerialPort &copy)
 

Private Attributes

bool m_blocking
 
serial_port_t m_serial
 
int m_timeout
 

Detailed Description

Definition at line 25 of file ISSerialPort.h.

Constructor & Destructor Documentation

◆ cISSerialPort() [1/2]

cISSerialPort::cISSerialPort ( const cISSerialPort copy)
private

◆ cISSerialPort() [2/2]

cISSerialPort::cISSerialPort ( serial_port_t serial = NULL)

Constructor

Parameters
serialinner serial port implementation or NULL for default, if not NULL, it will be copied

Definition at line 17 of file ISSerialPort.cpp.

◆ ~cISSerialPort()

cISSerialPort::~cISSerialPort ( )
virtual

Destructor - closes the serial port

Definition at line 30 of file ISSerialPort.cpp.

Member Function Documentation

◆ Close()

int cISSerialPort::Close ( )
virtual

Close the serial port

Returns
0 if success, otherwise an error code

Reimplemented from cISStream.

Definition at line 42 of file ISSerialPort.cpp.

◆ GetComPorts()

void cISSerialPort::GetComPorts ( vector< string > &  ports)
static

Gets a list of com names of all connected usb ports

Parameters
portscleared and then receives the name of each connected usb port

Definition at line 57 of file ISSerialPort.cpp.

◆ IsOpen()

bool cISSerialPort::IsOpen ( )
inline

Checks if the serial port is open

Returns
true if open, false otherwise

Definition at line 60 of file ISSerialPort.h.

◆ Open()

bool cISSerialPort::Open ( const std::string &  portName,
int  baudRate = BAUDRATE_921600,
int  timeout = 0,
bool  blocking = false 
)

Open the serial port

Parameters
portNamethe port name to open
baudRatethe baud rate to open at
timeoutread timeout, 0 for none
blockingwhether the serial port blocks until data is read or written
Returns
true if success, false if failure

Definition at line 35 of file ISSerialPort.cpp.

◆ Read()

int cISSerialPort::Read ( void *  data,
int  dataLength 
)
virtual

Read data from the serial port

Parameters
datathe buffer to read data into
dataLengththe number of bytes available in data
Returns
the number of bytes read or less than 0 if error

Reimplemented from cISStream.

Definition at line 47 of file ISSerialPort.cpp.

◆ Write()

int cISSerialPort::Write ( const void *  data,
int  dataLength 
)
virtual

Write data to the serial port

Parameters
datathe data to write
dataLengththe number of bytes to write
Returns
the number of bytes written or less than 0 if error

Reimplemented from cISStream.

Definition at line 52 of file ISSerialPort.cpp.

Member Data Documentation

◆ m_blocking

bool cISSerialPort::m_blocking
private

Definition at line 32 of file ISSerialPort.h.

◆ m_serial

serial_port_t cISSerialPort::m_serial
private

Definition at line 30 of file ISSerialPort.h.

◆ m_timeout

int cISSerialPort::m_timeout
private

Definition at line 31 of file ISSerialPort.h.


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


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:09