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

QGC's version of Qt QSerialPortInfo. It provides additional information about board types that QGC cares about. More...

#include <QGCSerialPortInfo.h>

+ Inheritance diagram for QGCSerialPortInfo:
+ Collaboration diagram for QGCSerialPortInfo:

Public Types

enum  BoardType_t {
  BoardTypePixhawk = 0 , BoardTypeSiKRadio , BoardTypeOpenPilot , BoardTypeRTKGPS ,
  BoardTypeUnknown
}
 

Public Member Functions

 QGCSerialPortInfo ()
 
 QGCSerialPortInfo (const QSerialPort &port)
 
 ~QGCSerialPortInfo ()
 
bool getBoardInfo (BoardType_t &boardType, QString &name) const
 
bool canFlash () const
 
bool isBootloader () const
 
bool isBlackCube () const
 
- Public Member Functions inherited from QSerialPortInfo
 QSerialPortInfo ()
 Constructs an empty QSerialPortInfo object.
 
 QSerialPortInfo (const QSerialPort &port)
 Constructs a QSerialPortInfo object from serial port.
 
 QSerialPortInfo (const QString &name)
 Constructs a QSerialPortInfo object from serial port name.
 
 QSerialPortInfo (const QSerialPortInfo &other)
 Constructs a copy of other.
 
 QSerialPortInfo (const QSerialPortInfoPrivate &dd)
 
 ~QSerialPortInfo ()
 Destroys the QSerialPortInfo object.
 
QSerialPortInfooperator= (const QSerialPortInfo &other)
 Sets the QSerialPortInfo object to be equal to other.
 
void swap (QSerialPortInfo &other)
 Swaps QSerialPortInfo other with this QSerialPortInfo.
 
QString portName () const
 Returns the name of the serial port.
 
QString systemLocation () const
 Returns the system location of the serial port.
 
QString description () const
 Returns the description string of the serial port, if available; otherwise returns an empty string.
 
QString manufacturer () const
 Returns the manufacturer string of the serial port, if available; otherwise returns an empty string.
 
QString serialNumber () const
 
quint16 vendorIdentifier () const
 Returns the 16-bit vendor number for the serial port, if available; otherwise returns zero.
 
quint16 productIdentifier () const
 Returns the 16-bit product number for the serial port, if available; otherwise returns zero.
 
bool hasVendorIdentifier () const
 Returns true if there is a valid 16-bit vendor number present; otherwise returns false.
 
bool hasProductIdentifier () const
 Returns true if there is a valid 16-bit product number present; otherwise returns false.
 
bool isNull () const
 Returns whether this QSerialPortInfo object holds a serial port definition.
 

Static Public Member Functions

static bool isSystemPort (const QSerialPortInfo &port)
 
static QList< QGCSerialPortInfoavailablePorts ()
 Override of QSerialPortInfo::availablePorts.
 
- Static Public Member Functions inherited from QSerialPortInfo
static QList< qint32 > standardBaudRates ()
 Returns a list of available standard baud rates supported by the target platform.
 
static QList< QSerialPortInfoavailablePorts ()
 Returns a list of available serial ports on the system.
 

Friends

class QGCSerialPortInfoTest
 

Detailed Description

QGC's version of Qt QSerialPortInfo. It provides additional information about board types that QGC cares about.

Definition at line 16 of file QGCSerialPortInfo.h.

Member Enumeration Documentation

◆ BoardType_t

Enumerator
BoardTypePixhawk 
BoardTypeSiKRadio 
BoardTypeOpenPilot 
BoardTypeRTKGPS 
BoardTypeUnknown 

Definition at line 24 of file QGCSerialPortInfo.h.

Constructor & Destructor Documentation

◆ QGCSerialPortInfo() [1/2]

QGCSerialPortInfo::QGCSerialPortInfo ( )

Definition at line 19 of file QGCSerialPortInfo.cc.

◆ QGCSerialPortInfo() [2/2]

QGCSerialPortInfo::QGCSerialPortInfo ( const QSerialPort port)
explicit

Definition at line 25 of file QGCSerialPortInfo.cc.

◆ ~QGCSerialPortInfo()

QGCSerialPortInfo::~QGCSerialPortInfo ( )

Definition at line 31 of file QGCSerialPortInfo.cc.

Member Function Documentation

◆ availablePorts()

QList< QGCSerialPortInfo > QGCSerialPortInfo::availablePorts ( )
static

◆ canFlash()

bool QGCSerialPortInfo::canFlash ( ) const
Returns
true: we can flash this board type

Definition at line 314 of file QGCSerialPortInfo.cc.

References BoardTypePixhawk, BoardTypeSiKRadio, and getBoardInfo().

◆ getBoardInfo()

◆ isBlackCube()

bool QGCSerialPortInfo::isBlackCube ( ) const
Returns
true: Board is BlackCube

Definition at line 285 of file QGCSerialPortInfo.cc.

References QSerialPortInfo::description().

◆ isBootloader()

bool QGCSerialPortInfo::isBootloader ( ) const
Returns
true: Board is currently in bootloader

Definition at line 274 of file QGCSerialPortInfo.cc.

References BoardTypePixhawk, QSerialPortInfo::description(), and getBoardInfo().

Referenced by SerialWorker::connectToPort().

◆ isSystemPort()

bool QGCSerialPortInfo::isSystemPort ( const QSerialPortInfo port)
static

Known operating system peripherals that are NEVER a peripheral that we should connect to.

Returns
true: Port is a system port and not an autopilot

Definition at line 290 of file QGCSerialPortInfo.cc.

References QSerialPortInfo::systemLocation().

Referenced by availablePorts().

Friends And Related Symbol Documentation

◆ QGCSerialPortInfoTest

friend class QGCSerialPortInfoTest
friend

Definition at line 18 of file QGCSerialPortInfo.h.


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