|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <BluetoothConfiguration.h>
Inheritance diagram for BluetoothConfiguration:
Collaboration diagram for BluetoothConfiguration:Public Types | |
| enum class | BluetoothMode { ModeClassic , ModeLowEnergy } |
Public Types inherited from LinkConfiguration | |
| enum | LinkType { TypeSerial , TypeUdp , TypeTcp , TypeBluetooth , TypeLogReplay , TypeLast } |
Signals | |
| void | modeChanged () |
| void | deviceChanged () |
| void | devicesModelChanged () |
| void | scanningChanged () |
| void | serviceUuidChanged () |
| void | readUuidChanged () |
| void | writeUuidChanged () |
| void | connectedRssiChanged () |
| void | selectedRssiChanged () |
| void | errorOccurred (const QString &errorString) |
| void | adapterStateChanged () |
| void | pairingStatusChanged () |
Signals inherited from LinkConfiguration | |
| void | nameChanged (const QString &name) |
| void | linkChanged () |
| void | dynamicChanged () |
| void | autoConnectChanged () |
| void | highLatencyChanged () |
Public Member Functions | |
| BluetoothConfiguration (const QString &name, QObject *parent=nullptr) | |
| BluetoothConfiguration (const BluetoothConfiguration *copy, QObject *parent=nullptr) | |
| ~BluetoothConfiguration () override | |
| Q_INVOKABLE void | startScan () |
| Q_INVOKABLE void | stopScan () |
| Q_INVOKABLE void | setDevice (const QString &name) |
| Q_INVOKABLE void | setDeviceByAddress (const QString &address) |
| Q_INVOKABLE void | requestPairing (const QString &address) |
| Q_INVOKABLE void | removePairing (const QString &address) |
| Q_INVOKABLE QString | getPairingStatus (const QString &address) const |
| Q_INVOKABLE bool | isPaired (const QString &address) const |
| Q_INVOKABLE bool | isDiscoverable () const |
| Q_INVOKABLE bool | isAdapterAvailable () const |
| Q_INVOKABLE QString | getAdapterAddress () const |
| Q_INVOKABLE QString | getAdapterName () const |
| Q_INVOKABLE bool | isAdapterPoweredOn () const |
| Q_INVOKABLE QVariantList | getAllPairedDevices () const |
| Q_INVOKABLE QVariantList | getConnectedDevices () const |
| Q_INVOKABLE void | powerOnAdapter () |
| Q_INVOKABLE void | powerOffAdapter () |
| Q_INVOKABLE void | setAdapterDiscoverable (bool discoverable) |
| Q_INVOKABLE QVariantList | getAllAvailableAdapters () |
| Q_INVOKABLE void | selectAdapter (const QString &address) |
| Q_INVOKABLE QString | getHostMode () const |
| LinkType | type () const override |
| void | copyFrom (const LinkConfiguration *source) override |
| void | loadSettings (QSettings &settings, const QString &root) override |
| void | saveSettings (QSettings &settings, const QString &root) const override |
| QString | settingsURL () const override |
| Settings URL, Pure virtual method providing the URL for the (QML) settings dialog. | |
| QString | settingsTitle () const override |
| Settings Title, Pure virtual method providing the Title for the (QML) settings dialog. | |
| BluetoothMode | mode () const |
| void | setMode (BluetoothMode mode) |
| const QBluetoothDeviceInfo & | device () const |
| QString | deviceName () const |
| QString | address () const |
| QVariantList | devicesModel () const |
| bool | scanning () const |
| qint16 | connectedRssi () const |
| void | setConnectedRssi (qint16 rssi) |
| qint16 | selectedRssi () const |
| QString | serviceUuid () const |
| void | setServiceUuid (const QString &uuid) |
| QString | readUuid () const |
| void | setReadUuid (const QString &uuid) |
| QString | writeUuid () const |
| void | setWriteUuid (const QString &uuid) |
| const QBluetoothUuid & | readCharacteristicUuid () const |
| const QBluetoothUuid & | writeCharacteristicUuid () const |
Public Member Functions inherited from LinkConfiguration | |
| LinkConfiguration (const QString &name, QObject *parent=nullptr) | |
| LinkConfiguration (const LinkConfiguration *copy, QObject *parent=nullptr) | |
| virtual | ~LinkConfiguration () |
| QString | name () const |
| void | setName (const QString &name) |
| LinkInterface * | link () const |
| void | setLink (const std::shared_ptr< LinkInterface > link) |
| bool | isDynamic () const |
| void | setDynamic (bool dynamic=true) |
| Set if this is this a dynamic configuration. (decided at runtime) | |
| bool | isForwarding () const |
| void | setForwarding (bool forwarding=true) |
| Set if this is this a forwarding link configuration. (decided at runtime) | |
| bool | isAutoConnect () const |
| virtual void | setAutoConnect (bool autoc=true) |
| Set if this is this an Auto Connect configuration. | |
| bool | isHighLatency () const |
| void | setHighLatency (bool hl=false) |
| Set if this is this an High Latency configuration. | |
Static Public Member Functions | |
| static bool | isBluetoothAvailable () |
Static Public Member Functions inherited from LinkConfiguration | |
| static LinkConfiguration * | createSettings (int type, const QString &name) |
| static LinkConfiguration * | duplicateSettings (const LinkConfiguration *source) |
| static QString | settingsRoot () |
Static Public Attributes | |
| static const QBluetoothUuid | NORDIC_UART_SERVICE {QStringLiteral("6e400001-b5a3-f393-e0a9-e50e24dcca9e")} |
| static const QBluetoothUuid | NORDIC_UART_RX_CHAR {QStringLiteral("6e400003-b5a3-f393-e0a9-e50e24dcca9e")} |
| static const QBluetoothUuid | NORDIC_UART_TX_CHAR {QStringLiteral("6e400002-b5a3-f393-e0a9-e50e24dcca9e")} |
| static const QBluetoothUuid | TI_SENSORTAG_SERVICE {QStringLiteral("0000ffe0-0000-1000-8000-00805f9b34fb")} |
| static const QBluetoothUuid | TI_SENSORTAG_CHAR {QStringLiteral("0000ffe1-0000-1000-8000-00805f9b34fb")} |
Additional Inherited Members | |
Protected Attributes inherited from LinkConfiguration | |
| std::weak_ptr< LinkInterface > | _link |
| Link currently using this configuration (if any) | |
Definition at line 19 of file BluetoothConfiguration.h.
|
strong |
| Enumerator | |
|---|---|
| ModeClassic | |
| ModeLowEnergy | |
Definition at line 46 of file BluetoothConfiguration.h.
|
explicit |
Definition at line 19 of file BluetoothConfiguration.cc.
|
explicit |
Definition at line 25 of file BluetoothConfiguration.cc.
|
override |
Definition at line 37 of file BluetoothConfiguration.cc.
References stopScan().
|
signal |
Referenced by powerOnAdapter(), and selectAdapter().
|
inline |
Definition at line 90 of file BluetoothConfiguration.h.
Referenced by getPairingStatus(), isPaired(), loadSettings(), removePairing(), requestPairing(), selectAdapter(), and setDeviceByAddress().
|
inline |
Definition at line 93 of file BluetoothConfiguration.h.
Referenced by copyFrom().
|
signal |
Referenced by copyFrom(), and setConnectedRssi().
|
overridevirtual |
Copy instance data, When manipulating data, you create a copy of the configuration using the copy constructor, edit it and then transfer its content to the original using this method.
| [in] | source | The source instance (the edited copy) |
Reimplemented from LinkConfiguration.
Definition at line 281 of file BluetoothConfiguration.cc.
References connectedRssi(), connectedRssiChanged(), LinkConfiguration::copyFrom(), device(), deviceChanged(), mode(), modeChanged(), readCharacteristicUuid(), readUuidChanged(), serviceUuidChanged(), writeCharacteristicUuid(), and writeUuidChanged().
|
inline |
Definition at line 88 of file BluetoothConfiguration.h.
Referenced by copyFrom(), getAllPairedDevices(), and getConnectedDevices().
|
signal |
Referenced by copyFrom().
|
inline |
Definition at line 89 of file BluetoothConfiguration.h.
Referenced by getConnectedDevices(), and loadSettings().
| QVariantList BluetoothConfiguration::devicesModel | ( | ) | const |
Definition at line 369 of file BluetoothConfiguration.cc.
|
signal |
|
signal |
| QString BluetoothConfiguration::getAdapterAddress | ( | ) | const |
Definition at line 916 of file BluetoothConfiguration.cc.
| QString BluetoothConfiguration::getAdapterName | ( | ) | const |
Definition at line 924 of file BluetoothConfiguration.cc.
| QVariantList BluetoothConfiguration::getAllAvailableAdapters | ( | ) |
Definition at line 1104 of file BluetoothConfiguration.cc.
| QVariantList BluetoothConfiguration::getAllPairedDevices | ( | ) | const |
Definition at line 940 of file BluetoothConfiguration.cc.
References device().
| QVariantList BluetoothConfiguration::getConnectedDevices | ( | ) | const |
Definition at line 977 of file BluetoothConfiguration.cc.
References device(), and deviceName().
| QString BluetoothConfiguration::getHostMode | ( | ) | const |
Definition at line 1175 of file BluetoothConfiguration.cc.
| QString BluetoothConfiguration::getPairingStatus | ( | const QString & | address | ) | const |
Definition at line 858 of file BluetoothConfiguration.cc.
References address(), and ModeClassic.
| bool BluetoothConfiguration::isAdapterAvailable | ( | ) | const |
Definition at line 911 of file BluetoothConfiguration.cc.
| bool BluetoothConfiguration::isAdapterPoweredOn | ( | ) | const |
Definition at line 932 of file BluetoothConfiguration.cc.
|
static |
Definition at line 364 of file BluetoothConfiguration.cc.
References QGCNetworkHelper::isBluetoothAvailable().
Referenced by settingsTitle().
| bool BluetoothConfiguration::isDiscoverable | ( | ) | const |
Definition at line 901 of file BluetoothConfiguration.cc.
References mode().
| bool BluetoothConfiguration::isPaired | ( | const QString & | address | ) | const |
Definition at line 886 of file BluetoothConfiguration.cc.
References address(), and ModeClassic.
|
overridevirtual |
Load settings, Pure virtual method telling the instance to load its configuration.
| [in] | settings | The QSettings instance to use |
| [in] | root | The root path of the setting. |
Implements LinkConfiguration.
Definition at line 322 of file BluetoothConfiguration.cc.
References address(), deviceName(), and ModeClassic.
|
inline |
Definition at line 85 of file BluetoothConfiguration.h.
Referenced by copyFrom(), BluetoothWorker::create(), isDiscoverable(), and setMode().
|
signal |
Referenced by copyFrom(), and setMode().
|
signal |
| void BluetoothConfiguration::powerOffAdapter | ( | ) |
Definition at line 1063 of file BluetoothConfiguration.cc.
References errorOccurred(), scanning(), and stopScan().
| void BluetoothConfiguration::powerOnAdapter | ( | ) |
Definition at line 1010 of file BluetoothConfiguration.cc.
References adapterStateChanged(), and errorOccurred().
|
inline |
Definition at line 105 of file BluetoothConfiguration.h.
Referenced by copyFrom().
|
inline |
Definition at line 100 of file BluetoothConfiguration.h.
|
signal |
Referenced by copyFrom(), and setReadUuid().
| void BluetoothConfiguration::removePairing | ( | const QString & | address | ) |
Definition at line 836 of file BluetoothConfiguration.cc.
References address(), errorOccurred(), and ModeClassic.
| void BluetoothConfiguration::requestPairing | ( | const QString & | address | ) |
Definition at line 814 of file BluetoothConfiguration.cc.
References address(), errorOccurred(), and ModeClassic.
|
overridevirtual |
Save settings, Pure virtual method telling the instance to save its configuration.
| [in] | settings | The QSettings instance to use |
| [in] | root | The root path of the setting. |
Implements LinkConfiguration.
Definition at line 342 of file BluetoothConfiguration.cc.
| bool BluetoothConfiguration::scanning | ( | ) | const |
Definition at line 555 of file BluetoothConfiguration.cc.
Referenced by powerOffAdapter(), selectAdapter(), and stopScan().
|
signal |
Referenced by startScan().
| void BluetoothConfiguration::selectAdapter | ( | const QString & | address | ) |
Definition at line 1112 of file BluetoothConfiguration.cc.
References adapterStateChanged(), address(), errorOccurred(), scanning(), and stopScan().
| qint16 BluetoothConfiguration::selectedRssi | ( | ) | const |
Definition at line 383 of file BluetoothConfiguration.cc.
|
signal |
Referenced by setConnectedRssi().
|
inline |
Definition at line 98 of file BluetoothConfiguration.h.
|
signal |
Referenced by copyFrom(), and setServiceUuid().
| void BluetoothConfiguration::setAdapterDiscoverable | ( | bool | discoverable | ) |
Definition at line 1082 of file BluetoothConfiguration.cc.
References errorOccurred().
| void BluetoothConfiguration::setConnectedRssi | ( | qint16 | rssi | ) |
Definition at line 374 of file BluetoothConfiguration.cc.
References connectedRssiChanged(), and selectedRssiChanged().
| void BluetoothConfiguration::setDevice | ( | const QString & | name | ) |
Definition at line 485 of file BluetoothConfiguration.cc.
References LinkConfiguration::name(), and stopScan().
| void BluetoothConfiguration::setDeviceByAddress | ( | const QString & | address | ) |
Definition at line 496 of file BluetoothConfiguration.cc.
References address(), and stopScan().
| void BluetoothConfiguration::setMode | ( | BluetoothMode | mode | ) |
Definition at line 269 of file BluetoothConfiguration.cc.
References mode(), modeChanged(), and stopScan().
| void BluetoothConfiguration::setReadUuid | ( | const QString & | uuid | ) |
Definition at line 409 of file BluetoothConfiguration.cc.
References errorOccurred(), and readUuidChanged().
| void BluetoothConfiguration::setServiceUuid | ( | const QString & | uuid | ) |
Definition at line 396 of file BluetoothConfiguration.cc.
References errorOccurred(), and serviceUuidChanged().
|
overridevirtual |
Settings Title, Pure virtual method providing the Title for the (QML) settings dialog.
Implements LinkConfiguration.
Definition at line 356 of file BluetoothConfiguration.cc.
References isBluetoothAvailable(), and ModeLowEnergy.
|
inlineoverridevirtual |
Settings URL, Pure virtual method providing the URL for the (QML) settings dialog.
Implements LinkConfiguration.
Definition at line 82 of file BluetoothConfiguration.h.
| void BluetoothConfiguration::setWriteUuid | ( | const QString & | uuid | ) |
Definition at line 422 of file BluetoothConfiguration.cc.
References errorOccurred(), and writeUuidChanged().
| void BluetoothConfiguration::startScan | ( | ) |
Definition at line 435 of file BluetoothConfiguration.cc.
References errorOccurred(), ModeLowEnergy, and scanningChanged().
| void BluetoothConfiguration::stopScan | ( | ) |
Definition at line 478 of file BluetoothConfiguration.cc.
References scanning().
Referenced by powerOffAdapter(), selectAdapter(), setDevice(), setDeviceByAddress(), setMode(), and ~BluetoothConfiguration().
|
inlineoverridevirtual |
Connection type, pure virtual method returning one of the -TypeXxx types above.
Implements LinkConfiguration.
Definition at line 78 of file BluetoothConfiguration.h.
References LinkConfiguration::TypeBluetooth.
|
inline |
Definition at line 106 of file BluetoothConfiguration.h.
Referenced by copyFrom().
|
inline |
Definition at line 102 of file BluetoothConfiguration.h.
|
signal |
Referenced by copyFrom(), and setWriteUuid().
|
inlinestatic |
Definition at line 112 of file BluetoothConfiguration.h.
|
inlinestatic |
Definition at line 111 of file BluetoothConfiguration.h.
|
inlinestatic |
Definition at line 113 of file BluetoothConfiguration.h.
|
inlinestatic |
Definition at line 115 of file BluetoothConfiguration.h.
|
inlinestatic |
Definition at line 114 of file BluetoothConfiguration.h.