QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AndroidSerialAccess Namespace Reference

Functions

void setUsePosixSerial (bool use)
bool usePosixSerial ()
bool hasPosixSerialPorts ()
 Whether the device has a serial port node that QGC may read and write.
bool hasUsbPermission (const QString &portName)
 Whether the port is a USB one whose device QGC may open.
bool requestUsbPermission (const QString &portName)
bool isUsbPermissionDenied (const QString &portName)
 Whether the port is a USB one whose device the user has denied QGC, and has not been asked for again since.

Detailed Description

What the app decides about the serial ports of the Android device: which of them QSerialPortInfo::availablePorts() lists, and when the user is asked again for a USB permission.

Function Documentation

◆ hasPosixSerialPorts()

bool AndroidSerialAccess::hasPosixSerialPorts ( )

Whether the device has a serial port node that QGC may read and write.

Definition at line 27 of file AndroidSerialAccess.cc.

References QSerialPortInfo::posixPorts().

Referenced by QGCCorePlugin::adjustSettingMetaData().

◆ hasUsbPermission()

bool AndroidSerialAccess::hasUsbPermission ( const QString & portName)

Whether the port is a USB one whose device QGC may open.

Definition at line 32 of file AndroidSerialAccess.cc.

References AndroidSerial::hasPermission(), QSerialPortInfo::isUsbLocation(), and QSerialPortInfo::portNameToSystemLocation().

◆ isUsbPermissionDenied()

bool AndroidSerialAccess::isUsbPermissionDenied ( const QString & portName)

Whether the port is a USB one whose device the user has denied QGC, and has not been asked for again since.

Definition at line 45 of file AndroidSerialAccess.cc.

References AndroidSerial::isPermissionDenied(), QSerialPortInfo::isUsbLocation(), and QSerialPortInfo::portNameToSystemLocation().

◆ requestUsbPermission()

bool AndroidSerialAccess::requestUsbPermission ( const QString & portName)

Asks the user to let QGC open the USB device of this port, and returns whether it did. It does not for a port whose device QGC may open already or is not attached, nor for one that is not a USB port. The user answers later, and opening the port fails until then. Opening the port asks once for each time the device is attached; this asks whenever it is called, also after a denial, so call it only for a connection that the user has asked for.

Definition at line 38 of file AndroidSerialAccess.cc.

References AndroidSerial::hasPermission(), QSerialPortInfo::isUsbLocation(), QSerialPortInfo::portNameToSystemLocation(), and AndroidSerial::requestPermission().

◆ setUsePosixSerial()

void AndroidSerialAccess::setUsePosixSerial ( bool use)

Definition at line 16 of file AndroidSerialAccess.cc.

Referenced by LinkManager::init().

◆ usePosixSerial()

bool AndroidSerialAccess::usePosixSerial ( )

Definition at line 22 of file AndroidSerialAccess.cc.

Referenced by QSerialPortInfo::availablePorts().