OpenCurves  0.9
RealTimeSerialConnection Class Reference

A RealTimeConnection which reads from a serial port. More...

#include <realtimeserialconnection.h>

Inheritance diagram for RealTimeSerialConnection:
RealTimeConnection

Public Member Functions

 RealTimeSerialConnection ()
 Create an unconnected serial connection.
 
 ~RealTimeSerialConnection ()
 Destructor, ensures disconnect() is called.
 
virtual QString name () const override
 The name of the serial port being used. More...
 
bool open (const QString &name, quint32 baudRate, bool readOnly)
 Open a serial connection, first disconnecting any existing connection. More...
 
bool isConnected () const override
 Is the port open and connected? More...
 
void disconnect () override
 Disconnect if connected.
 
int send (const QByteArray &buffer) override
 Send the given buffer to the source. More...
 
int read (QByteArray &buffer) override
 Read data into the given buffer. More...
 
- Public Member Functions inherited from RealTimeConnection
virtual ~RealTimeConnection ()
 Virtual destructor.
 

Detailed Description

A RealTimeConnection which reads from a serial port.

Member Function Documentation

bool RealTimeSerialConnection::isConnected ( ) const
overridevirtual

Is the port open and connected?

Returns
True if open.

Implements RealTimeConnection.

virtual QString RealTimeSerialConnection::name ( ) const
overridevirtual

The name of the serial port being used.

Returns
The serial port name.

Implements RealTimeConnection.

bool RealTimeSerialConnection::open ( const QString &  name,
quint32  baudRate,
bool  readOnly 
)

Open a serial connection, first disconnecting any existing connection.

Parameters
nameThe name of the serial port to open. For example, "/dev/ttyUSB0" or "COM3".
baudRateThe baud rate at which to open the port.
readOnlyTrue to open the connection is a read only mode.
Returns
True on success, false on failure.
int RealTimeSerialConnection::read ( QByteArray &  buffer)
overridevirtual

Read data into the given buffer.

Parameters
bufferThe buffer to read into.

Implements RealTimeConnection.

int RealTimeSerialConnection::send ( const QByteArray &  buffer)
overridevirtual

Send the given buffer to the source.

Parameters
bufferThe buffer to send.

Implements RealTimeConnection.


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