QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AndroidSerialBackend Class Referenceabstract

#include <AndroidSerialBackend.h>

Public Member Functions

virtual ~AndroidSerialBackend ()=default
virtual bool open (QIODevice::OpenMode mode)=0
 Opens the device. The port applies its settings afterwards.
virtual void close ()=0
 Closes the device, after which no more of its input reaches the port. Does nothing if it is closed.
virtual int descriptor () const =0
 The file descriptor of the open device, or -1.
virtual bool startReading ()=0
virtual bool waitForInput (const QDeadlineTimer &deadline)=0
virtual qint64 startWrite (const char *data, qint64 maxSize)=0
virtual bool waitForWritable (const QDeadlineTimer &deadline)=0
 Blocks until the port's writeCompleted() may have been called, or the deadline has passed.
virtual bool setParameters (qint32 baudRate, QSerialPort::DataBits dataBits, QSerialPort::StopBits stopBits, QSerialPort::Parity parity, const QString &failureText)=0
 A backend that cannot tell why the device refused describes the failure by failureText.
virtual bool setFlowControl (QSerialPort::FlowControl flowControl)=0
virtual bool setBreakEnabled (bool set)=0
virtual bool clear (QSerialPort::Directions directions)=0
virtual QSerialPort::PinoutSignals pinoutSignals ()=0
virtual bool setDataTerminalReady (bool set)=0
virtual bool setRequestToSend (bool set)=0

Protected Member Functions

 AndroidSerialBackend ()=default

Detailed Description

The device behind a QSerialPort: a USB serial adapter or a device node. The port opens the one that its name calls for and calls it on its own thread.

A function that returns false, or startWrite() that returns -1, has set the port's error, and did so last: the port's owner may close the port in response before the function returns.

Definition at line 68 of file AndroidSerialBackend.h.

Constructor & Destructor Documentation

◆ ~AndroidSerialBackend()

virtual AndroidSerialBackend::~AndroidSerialBackend ( )
virtualdefault

◆ AndroidSerialBackend()

AndroidSerialBackend::AndroidSerialBackend ( )
protecteddefault

References AndroidSerialBackend().

Referenced by AndroidSerialBackend().

Member Function Documentation

◆ clear()

virtual bool AndroidSerialBackend::clear ( QSerialPort::Directions directions)
pure virtual

◆ close()

virtual void AndroidSerialBackend::close ( )
pure virtual

Closes the device, after which no more of its input reaches the port. Does nothing if it is closed.

◆ descriptor()

virtual int AndroidSerialBackend::descriptor ( ) const
pure virtual

The file descriptor of the open device, or -1.

◆ open()

virtual bool AndroidSerialBackend::open ( QIODevice::OpenMode mode)
pure virtual

Opens the device. The port applies its settings afterwards.

◆ pinoutSignals()

virtual QSerialPort::PinoutSignals AndroidSerialBackend::pinoutSignals ( )
pure virtual

◆ setBreakEnabled()

virtual bool AndroidSerialBackend::setBreakEnabled ( bool set)
pure virtual

◆ setDataTerminalReady()

virtual bool AndroidSerialBackend::setDataTerminalReady ( bool set)
pure virtual

◆ setFlowControl()

virtual bool AndroidSerialBackend::setFlowControl ( QSerialPort::FlowControl flowControl)
pure virtual

◆ setParameters()

virtual bool AndroidSerialBackend::setParameters ( qint32 baudRate,
QSerialPort::DataBits dataBits,
QSerialPort::StopBits stopBits,
QSerialPort::Parity parity,
const QString & failureText )
pure virtual

A backend that cannot tell why the device refused describes the failure by failureText.

◆ setRequestToSend()

virtual bool AndroidSerialBackend::setRequestToSend ( bool set)
pure virtual

◆ startReading()

virtual bool AndroidSerialBackend::startReading ( )
pure virtual

Starts passing the device's input to the port's newDataArrived(), or resumes it after newDataArrived() has answered that the port has no room for more. On that answer the backend reads the device no further, so that the device or the system holds its input back instead of the port dropping it. Once the device is lost it fails without setting the error again.

◆ startWrite()

virtual qint64 AndroidSerialBackend::startWrite ( const char * data,
qint64 maxSize )
pure virtual

Takes up to maxSize bytes to write and returns how many, or -1, without waiting for the device. It reports the bytes to the port's writeCompleted() as they are written, perhaps before it returns, and calls that with 0 when it took fewer than it was offered and can take more. The port offers nothing more until all that was taken is reported.

◆ waitForInput()

virtual bool AndroidSerialBackend::waitForInput ( const QDeadlineTimer & deadline)
pure virtual

Blocks until input may have reached the port, its writeCompleted() may have been called, or the deadline has passed.

◆ waitForWritable()

virtual bool AndroidSerialBackend::waitForWritable ( const QDeadlineTimer & deadline)
pure virtual

Blocks until the port's writeCompleted() may have been called, or the deadline has passed.


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