Public Member Functions | Private Member Functions | Private Attributes
SerialDevice Class Reference

#include <SerialDevice.h>

List of all members.

Public Member Functions

bool ClosePort ()
const char * GetDevice () const
bool OpenPort ()
bool ReadPort (char *result, int bytes_to_read, int &bytes_read)
 Reads serial port.
 SerialDevice (const char *device, int baudrate, const char *parity, int datasize)
virtual ~SerialDevice ()

Private Member Functions

bool SetTermSpeed (int speed)
 Set serial communication speed.

Private Attributes

const int baudrate_
const int datasize_
const std::string device_
const std::string parity_
int serial_port_

Detailed Description

Definition at line 37 of file SerialDevice.h.


Constructor & Destructor Documentation

SerialDevice::SerialDevice ( const char *  device,
int  baudrate,
const char *  parity,
int  datasize 
)

Constructor by default

Definition at line 47 of file SerialDevice.cc.

Destructor by default

Definition at line 62 of file SerialDevice.cc.


Member Function Documentation

Closes serial port

Definition at line 138 of file SerialDevice.cc.

const char* SerialDevice::GetDevice ( ) const [inline]

Definition at line 59 of file SerialDevice.h.

Definition at line 70 of file SerialDevice.cc.

bool SerialDevice::ReadPort ( char *  result,
int  bytes_to_read,
int &  bytes_read 
)

Reads serial port.

Parameters:
bufferas char *, output buffer
bytes_readas int, number of read bytes
bytes_to_readas *int, number of desired bytes to read
Returns:
OK
NOT_INITIALIZED
ERROR

Definition at line 152 of file SerialDevice.cc.

bool SerialDevice::SetTermSpeed ( int  speed) [private]

Set serial communication speed.

Set serial communication speed. Valid values: 9600, 19200, 38400, 115200, 500000

Returns:
false if error occured

Definition at line 176 of file SerialDevice.cc.


Member Data Documentation

const int SerialDevice::baudrate_ [private]

Definition at line 45 of file SerialDevice.h.

const int SerialDevice::datasize_ [private]

Definition at line 47 of file SerialDevice.h.

Definition at line 41 of file SerialDevice.h.

Definition at line 43 of file SerialDevice.h.

Definition at line 49 of file SerialDevice.h.


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


s3000_laser
Author(s): Roman Navarro Garcia
autogenerated on Sat Jun 8 2019 20:55:59