Public Member Functions | Private Attributes | List of all members
segwayrmp::SerialRMPIO Class Reference

#include <rmp_serial.h>

Inheritance diagram for segwayrmp::SerialRMPIO:
Inheritance graph
[legend]

Public Member Functions

void configure (std::string port, int baudrate)
 
void connect ()
 
void disconnect ()
 
int read (unsigned char *buffer, int size)
 
 SerialRMPIO ()
 
int write (unsigned char *buffer, int size)
 
 ~SerialRMPIO ()
 
- Public Member Functions inherited from segwayrmp::RMPIO
void cancel ()
 
void getPacket (Packet &packet)
 
bool isConnected ()
 
 RMPIO ()
 
void sendPacket (Packet &packet)
 

Private Attributes

int baudrate
 
bool configured
 
std::string port
 
serial::Serial serial_port
 

Additional Inherited Members

- Protected Member Functions inherited from segwayrmp::RMPIO
unsigned char computeChecksum (unsigned char *usb_packet)
 
void fillBuffer ()
 
- Protected Attributes inherited from segwayrmp::RMPIO
bool canceled
 
bool connected
 
std::vector< unsigned char > data_buffer
 

Detailed Description

Provides a serial based interface for reading and writing packets.

Definition at line 49 of file rmp_serial.h.

Constructor & Destructor Documentation

SerialRMPIO::SerialRMPIO ( )

Constructs the SerialRMPIO object.

Definition at line 9 of file rmp_serial.cc.

SerialRMPIO::~SerialRMPIO ( )

Definition at line 13 of file rmp_serial.cc.

Member Function Documentation

void SerialRMPIO::configure ( std::string  port,
int  baudrate 
)

Configures the serial port.

Parameters
portThe com port identifier like '/dev/ttyUSB0' on POSIX and like 'COM1' on windows.
baudrateThe speed of the serial communication.

Definition at line 17 of file rmp_serial.cc.

void SerialRMPIO::connect ( )
virtual

Connects to the serial port if it has been configured. Can throw ConnectionFailedException.

Implements segwayrmp::RMPIO.

Definition at line 23 of file rmp_serial.cc.

void SerialRMPIO::disconnect ( )
virtual

Disconnects from the serial port if it is open.

Implements segwayrmp::RMPIO.

Definition at line 41 of file rmp_serial.cc.

int SerialRMPIO::read ( unsigned char *  buffer,
int  size 
)
virtual

Read Function, reads from the serial port.

Parameters
bufferAn unsigned char array for data to be read into.
sizeThe amount of data to be read.
Returns
int Bytes read.

Implements segwayrmp::RMPIO.

Definition at line 49 of file rmp_serial.cc.

int SerialRMPIO::write ( unsigned char *  buffer,
int  size 
)
virtual

Write Function, writes to the serial port.

Parameters
bufferAn unsigned char array of data to be written.
sizeThe amount of data to be written.
Returns
int Bytes written.

Implements segwayrmp::RMPIO.

Definition at line 53 of file rmp_serial.cc.

Member Data Documentation

int segwayrmp::SerialRMPIO::baudrate
private

Definition at line 97 of file rmp_serial.h.

bool segwayrmp::SerialRMPIO::configured
private

Definition at line 94 of file rmp_serial.h.

std::string segwayrmp::SerialRMPIO::port
private

Definition at line 96 of file rmp_serial.h.

serial::Serial segwayrmp::SerialRMPIO::serial_port
private

Definition at line 99 of file rmp_serial.h.


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


libsegwayrmp
Author(s): William Woodall
autogenerated on Mon Jun 10 2019 13:46:50