QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AndroidSerialBackendHost Class Reference

A QSerialPort as its backend sees it: what the backend asks of the port and reports to it. More...

#include <AndroidSerialBackend.h>

Public Member Functions

QSerialPort & serialPort () const
 The port itself, for its settings, its error and its thread.
QString systemLocation () const
void setError (QSerialPort::SerialPortError error, const QString &text=QString())
bool newDataArrived (const char *bytes, int length)
bool hasRoomForInput ()
 Returns whether the port has room for more input, on any thread.
bool inputArrived ()
 Returns whether input has arrived that the port's owner has not been told of and can be told of now.
void waitForArrivedInput (const QDeadlineTimer &deadline)
void writeCompleted (qint64 bytes)
void waitForWriteProgress (const QDeadlineTimer &deadline)
void interruptWait ()

Friends

class QSerialPort

Detailed Description

A QSerialPort as its backend sees it: what the backend asks of the port and reports to it.

Definition at line 13 of file AndroidSerialBackend.h.

Member Function Documentation

◆ hasRoomForInput()

bool AndroidSerialBackendHost::hasRoomForInput ( )
inline

Returns whether the port has room for more input, on any thread.

Definition at line 31 of file AndroidSerialBackend.h.

◆ inputArrived()

bool AndroidSerialBackendHost::inputArrived ( )
inline

Returns whether input has arrived that the port's owner has not been told of and can be told of now.

Definition at line 34 of file AndroidSerialBackend.h.

◆ interruptWait()

void AndroidSerialBackendHost::interruptWait ( )
inline

Ends the wait that waitForArrivedInput() or waitForWriteProgress() is in, or else the next one, on any thread. For a backend that has something else to tell the port's thread, which runs no event loop while it waits.

Definition at line 51 of file AndroidSerialBackend.h.

◆ newDataArrived()

bool AndroidSerialBackendHost::newDataArrived ( const char * bytes,
int length )
inline

Takes input from the backend, on any thread, and returns whether the port has room for more. If not, the backend stops reading the device, which then holds its input back, until the port calls its startReading().

Definition at line 28 of file AndroidSerialBackend.h.

◆ serialPort()

QSerialPort & AndroidSerialBackendHost::serialPort ( ) const
inline

The port itself, for its settings, its error and its thread.

Definition at line 17 of file AndroidSerialBackend.h.

References QSerialPort.

◆ setError()

void AndroidSerialBackendHost::setError ( QSerialPort::SerialPortError error,
const QString & text = QString() )
inline

Sets the port's error and tells the port's owner, who may close the port before this returns. An error without a text is described by the text of its kind.

Definition at line 23 of file AndroidSerialBackend.h.

◆ systemLocation()

QString AndroidSerialBackendHost::systemLocation ( ) const
inline

Definition at line 19 of file AndroidSerialBackend.h.

◆ waitForArrivedInput()

void AndroidSerialBackendHost::waitForArrivedInput ( const QDeadlineTimer & deadline)
inline

Blocks until newDataArrived(), writeCompleted() or interruptWait() has been called or the deadline has passed, unless what one of them brought is still waiting.

Definition at line 38 of file AndroidSerialBackend.h.

◆ waitForWriteProgress()

void AndroidSerialBackendHost::waitForWriteProgress ( const QDeadlineTimer & deadline)
inline

Blocks until writeCompleted() or interruptWait() has been called or the deadline has passed, unless the report of either is still waiting.

Definition at line 46 of file AndroidSerialBackend.h.

◆ writeCompleted()

void AndroidSerialBackendHost::writeCompleted ( qint64 bytes)
inline

Takes the backend's report, on any thread, that it has written this many of the bytes it took, or with 0 that it can take more.

Definition at line 42 of file AndroidSerialBackend.h.

◆ QSerialPort

friend class QSerialPort
friend

Definition at line 54 of file AndroidSerialBackend.h.

References QSerialPort.

Referenced by QSerialPort, and serialPort().


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