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

#include <AndroidSerialPortInfo.h>

Inheritance diagram for QSerialPortInfo:

Classes

struct  Data
 What is known of a port. More...

Public Member Functions

 QSerialPortInfo ()=default
 A null port info, which describes no port.
 QSerialPortInfo (const QString &name)
 The listed port of this port name or stable name. Null if there is none.
 QSerialPortInfo (const QSerialPort &port)
 The listed port that this port was named after.
 QSerialPortInfo (const Data &data)
QString portName () const
QString stableName () const
bool hasHardwareFlowControl () const
QString systemLocation () const
QString description () const
QString manufacturer () const
QString serialNumber () const
quint16 vendorIdentifier () const
quint16 productIdentifier () const
bool hasVendorIdentifier () const
bool hasProductIdentifier () const
bool isNull () const

Static Public Member Functions

static QList< qint32 > standardBaudRates ()
static QList< QSerialPortInfo > availablePorts ()
static QString portNameToSystemLocation (const QString &portName)
static QString portNameFromSystemLocation (const QString &systemLocation)
static bool isUsbLocation (const QString &systemLocation)
static QList< QSerialPortInfo > posixPorts (const QString &devDir, const QString &sysTtyDir, const QList< QSerialPortInfo > &usbPorts={})
static QList< QSerialPortInfo > availablePorts (const QString &devDir, const QString &sysTtyDir)
 What availablePorts() lists on a device that has its serial device nodes in these directories.

Detailed Description

A serial port of the Android device, described as Qt Serial Port's class of this name describes one elsewhere. The ports are the USB serial ports that Java lists and, if the app says so (AndroidSerialAccess), the serial device nodes.

Definition at line 13 of file AndroidSerialPortInfo.h.

Constructor & Destructor Documentation

◆ QSerialPortInfo() [1/4]

◆ QSerialPortInfo() [2/4]

QSerialPortInfo::QSerialPortInfo ( const QString & name)
explicit

The listed port of this port name or stable name. Null if there is none.

Definition at line 23 of file AndroidSerialPortInfo.cc.

References availablePorts(), and QSerialPortInfo().

◆ QSerialPortInfo() [3/4]

QSerialPortInfo::QSerialPortInfo ( const QSerialPort & port)
explicit

The listed port that this port was named after.

Definition at line 35 of file AndroidSerialPortInfo.cc.

References portName(), and QSerialPortInfo().

◆ QSerialPortInfo() [4/4]

QSerialPortInfo::QSerialPortInfo ( const Data & data)
explicit

Definition at line 39 of file AndroidSerialPortInfo.cc.

Member Function Documentation

◆ availablePorts() [1/2]

QList< QSerialPortInfo > QSerialPortInfo::availablePorts ( )
static

◆ availablePorts() [2/2]

QList< QSerialPortInfo > QSerialPortInfo::availablePorts ( const QString & devDir,
const QString & sysTtyDir )
static

What availablePorts() lists on a device that has its serial device nodes in these directories.

Definition at line 53 of file AndroidSerialPortInfo.cc.

References AndroidSerial::availablePorts(), posixPorts(), and AndroidSerialAccess::usePosixSerial().

◆ description()

QString QSerialPortInfo::description ( ) const
inline

◆ hasHardwareFlowControl()

bool QSerialPortInfo::hasHardwareFlowControl ( ) const
inline

Whether the port can be set to hardware flow control. The driver of a USB device may have none, as that of a CDC-ACM device, and its port then refuses the setting. Qt Serial Port has no such answer.

Definition at line 50 of file AndroidSerialPortInfo.h.

◆ hasProductIdentifier()

bool QSerialPortInfo::hasProductIdentifier ( ) const
inline

Definition at line 66 of file AndroidSerialPortInfo.h.

◆ hasVendorIdentifier()

bool QSerialPortInfo::hasVendorIdentifier ( ) const
inline

Definition at line 64 of file AndroidSerialPortInfo.h.

◆ isNull()

bool QSerialPortInfo::isNull ( ) const
inline

Definition at line 68 of file AndroidSerialPortInfo.h.

Referenced by QGCSerialPortInfo::getBoardInfo().

◆ isUsbLocation()

bool QSerialPortInfo::isUsbLocation ( const QString & systemLocation)
static

Whether a system location names a port of a USB device, which Java opens: the name that Android gives the device, or the one that survives a replug. Any other location is a device node.

Definition at line 77 of file AndroidSerialPortInfo.cc.

References systemLocation().

Referenced by AndroidSerialAccess::hasUsbPermission(), AndroidSerialAccess::isUsbPermissionDenied(), and AndroidSerialAccess::requestUsbPermission().

◆ manufacturer()

QString QSerialPortInfo::manufacturer ( ) const
inline

Definition at line 56 of file AndroidSerialPortInfo.h.

Referenced by QGCSerialPortInfo::getBoardInfo().

◆ portName()

QString QSerialPortInfo::portName ( ) const
inline

Definition at line 40 of file AndroidSerialPortInfo.h.

Referenced by portNameToSystemLocation(), and QSerialPortInfo().

◆ portNameFromSystemLocation()

QString QSerialPortInfo::portNameFromSystemLocation ( const QString & systemLocation)
static

Definition at line 72 of file AndroidSerialPortInfo.cc.

References systemLocation().

Referenced by AndroidSerial::availablePorts(), and QSerialPort::portName().

◆ portNameToSystemLocation()

QString QSerialPortInfo::portNameToSystemLocation ( const QString & portName)
static

The system location that a port name stands for: the path of a device node, or the name itself if it is a path or the stable name of a USB port.

Definition at line 63 of file AndroidSerialPortInfo.cc.

References portName().

Referenced by AndroidSerialAccess::hasUsbPermission(), AndroidSerialAccess::isUsbPermissionDenied(), AndroidSerialAccess::requestUsbPermission(), and QSerialPort::setPortName().

◆ posixPorts()

QList< QSerialPortInfo > QSerialPortInfo::posixPorts ( const QString & devDir,
const QString & sysTtyDir,
const QList< QSerialPortInfo > & usbPorts = {} )
static

The serial device nodes in devDir that QGC may read and write: the device's own UARTs and the USB serial adapters that the kernel drives. sysTtyDir is the kernel's /sys/class/tty, which names the ports that have a driver, tells a UART without hardware and describes the adapters. The node of an adapter that usbPorts has a port of is left out, so that no device is listed twice.

Definition at line 88 of file PosixSerialPorts.cc.

References QSerialPortInfo::Data::portName, QSerialPortInfo(), QSerialPortInfo::Data::systemLocation, and systemLocation().

Referenced by availablePorts(), and AndroidSerialAccess::hasPosixSerialPorts().

◆ productIdentifier()

quint16 QSerialPortInfo::productIdentifier ( ) const
inline

Definition at line 62 of file AndroidSerialPortInfo.h.

Referenced by QGCSerialPortInfo::getBoardInfo().

◆ serialNumber()

QString QSerialPortInfo::serialNumber ( ) const
inline

Definition at line 58 of file AndroidSerialPortInfo.h.

◆ stableName()

QString QSerialPortInfo::stableName ( ) const
inline

A name that still opens the port after its USB device is unplugged and plugged back in, which gives it another portName(). Pass it to QSerialPort::setPortName(). Empty if the port has no such name: until the user lets QGC open the device, and for a device node, whose portName() does not change. Qt Serial Port has no such name.

Definition at line 46 of file AndroidSerialPortInfo.h.

◆ standardBaudRates()

QList< qint32 > QSerialPortInfo::standardBaudRates ( )
static

Definition at line 43 of file AndroidSerialPortInfo.cc.

Referenced by SerialPortManager::supportedBaudRates().

◆ systemLocation()

QString QSerialPortInfo::systemLocation ( ) const
inline

◆ vendorIdentifier()

quint16 QSerialPortInfo::vendorIdentifier ( ) const
inline

Definition at line 60 of file AndroidSerialPortInfo.h.

Referenced by QGCSerialPortInfo::getBoardInfo().


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