API Documentation
Loading...
Searching...
No Matches
SerialPortConnection Class Reference

#include <SerialPortConnection.h>

Inheritance diagram for SerialPortConnection:
[legend]
Collaboration diagram for SerialPortConnection:
[legend]

Public Member Functions

virtual uint04 bytesAvailable () const override
 
virtual void close () override
 
void handleSerialPortError (int error, ProgressInfo *log)
 
virtual bool isOpen () const override
 
virtual TranslatedString lastError () const override
 
virtual bool open (const ConnectionInfo &request) override
 
virtual uint04 peek (char *s, uint04 size) const override
 
virtual uint04 rx (char *, uint04 size=Constant< uint04 >::Max) override
 
 SerialPortConnection (ProgressInfo *log)
 
bool setSerialPort (QSerialPort *serial_port, ConnectionOpenType connection_type=ConnectionOpenType::e_read_write, ProgressInfo *log=nullptr)
 
String threadID () const override
 
virtual void tx (const String &command) override
 
virtual bool waitForReadyRead (const TimeSpan &span) override
 
 ~SerialPortConnection ()
 
- Public Member Functions inherited from ConnectionBackend
 ConnectionBackend (ProgressInfo *log)
 

Static Public Member Functions

static ConnectionInfo CreateInfo (const QSerialPort &value)
 
static ConnectionInfo CreateInfo (const QSerialPortInfo &value)
 
static void FromString (const String &string, QSerialPort &value)
 
static void ToString (const QSerialPort &value, String &string)
 

Protected Attributes

TranslatedString m_last_error
 
QSerialPort * m_serial_port = nullptr
 
- Protected Attributes inherited from ConnectionBackend
ProgressInfom_log
 

Additional Inherited Members

- Signals inherited from ConnectionBackend
void connectionStateChangedSignal (ConnectionState state)
 
void dataAvailableSignal ()
 

Constructor & Destructor Documentation

◆ SerialPortConnection()

◆ ~SerialPortConnection()

Member Function Documentation

◆ bytesAvailable()

virtual uint04 bytesAvailable ( ) const
overridevirtual

Implements ConnectionBackend.

◆ close()

virtual void close ( )
overridevirtual

Implements ConnectionBackend.

◆ CreateInfo() [1/2]

static ConnectionInfo CreateInfo ( const QSerialPort & value)
static

◆ CreateInfo() [2/2]

static ConnectionInfo CreateInfo ( const QSerialPortInfo & value)
static

◆ FromString()

static void FromString ( const String & string,
QSerialPort & value )
static

◆ handleSerialPortError()

void handleSerialPortError ( int error,
ProgressInfo * log )

◆ isOpen()

virtual bool isOpen ( ) const
overridevirtual

Implements ConnectionBackend.

◆ lastError()

virtual TranslatedString lastError ( ) const
overridevirtual

Implements ConnectionBackend.

◆ open()

virtual bool open ( const ConnectionInfo & request)
overridevirtual

Implements ConnectionBackend.

◆ peek()

virtual uint04 peek ( char * s,
uint04 size ) const
overridevirtual

Implements ConnectionBackend.

◆ rx()

virtual uint04 rx ( char * ,
uint04 size = Constantuint04 >::Max )
overridevirtual

Implements ConnectionBackend.

◆ setSerialPort()

bool setSerialPort ( QSerialPort * serial_port,
ConnectionOpenType connection_type = ConnectionOpenType::e_read_write,
ProgressInfo * log = nullptr )

◆ threadID()

String threadID ( ) const
overridevirtual

Reimplemented from ConnectionBackend.

◆ ToString()

static void ToString ( const QSerialPort & value,
String & string )
static

◆ tx()

virtual void tx ( const String & command)
overridevirtual

Implements ConnectionBackend.

◆ waitForReadyRead()

virtual bool waitForReadyRead ( const TimeSpan & span)
overridevirtual

Implements ConnectionBackend.

Member Data Documentation

◆ m_last_error

TranslatedString m_last_error
protected

◆ m_serial_port

QSerialPort* m_serial_port = nullptr
protected

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