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

#include <BluetoothBleWorker.h>

+ Inheritance diagram for BluetoothBleWorker:
+ Collaboration diagram for BluetoothBleWorker:

Public Member Functions

 BluetoothBleWorker (const BluetoothConfiguration *config, QObject *parent=nullptr)
 
 ~BluetoothBleWorker () override
 
- Public Member Functions inherited from BluetoothWorker
 BluetoothWorker (const BluetoothConfiguration *config, QObject *parent=nullptr)
 
 ~BluetoothWorker () override
 
bool isConnected () const
 

Protected Member Functions

void onSetupConnection () override
 
void onConnectLink () override
 
void onDisconnectLink () override
 
void onWriteData (const QByteArray &data) override
 
void onServiceDiscoveryTimeout () override
 
void onResetAfterConsecutiveFailures () override
 

Additional Inherited Members

- Public Slots inherited from BluetoothWorker
void setupConnection ()
 
void connectLink ()
 
void disconnectLink ()
 
void writeData (const QByteArray &data)
 
- Signals inherited from BluetoothWorker
void connected ()
 
void disconnected ()
 
void errorOccurred (const QString &errorString)
 
void dataReceived (const QByteArray &data)
 
void dataSent (const QByteArray &data)
 
void rssiUpdated (qint16 rssi)
 
- Static Public Member Functions inherited from BluetoothWorker
static BluetoothWorkercreate (const BluetoothConfiguration *config, QObject *parent=nullptr)
 
- Protected Slots inherited from BluetoothWorker
void _reconnectTimeout ()
 
void _serviceDiscoveryTimeout ()
 
- Protected Attributes inherited from BluetoothWorker
const QBluetoothDeviceInfo _device
 
const QBluetoothUuid _serviceUuid
 
const QBluetoothUuid _readCharacteristicUuid
 
const QBluetoothUuid _writeCharacteristicUuid
 
QPointer< QTimer > _reconnectTimer
 
QPointer< QTimer > _serviceDiscoveryTimer
 
std::atomic< bool > _intentionalDisconnect {false}
 
std::atomic< bool > _connected {false}
 
std::atomic< int > _reconnectAttempts {0}
 
int _consecutiveFailures = 0
 
- Static Protected Attributes inherited from BluetoothWorker
static constexpr int MAX_RECONNECT_ATTEMPTS = 10
 
static constexpr int RECONNECT_BASE_INTERVAL_MS = 5000
 
static constexpr int MAX_RECONNECT_INTERVAL_MS = 60000
 
static constexpr int SERVICE_DISCOVERY_TIMEOUT_MS = 30000
 
static constexpr int MAX_CONSECUTIVE_FAILURES = 3
 

Detailed Description

Definition at line 11 of file BluetoothBleWorker.h.

Constructor & Destructor Documentation

◆ BluetoothBleWorker()

BluetoothBleWorker::BluetoothBleWorker ( const BluetoothConfiguration config,
QObject *  parent = nullptr 
)
explicit

Definition at line 18 of file BluetoothBleWorker.cc.

◆ ~BluetoothBleWorker()

BluetoothBleWorker::~BluetoothBleWorker ( )
override

Member Function Documentation

◆ onConnectLink()

void BluetoothBleWorker::onConnectLink ( )
overrideprotectedvirtual

Implements BluetoothWorker.

Definition at line 59 of file BluetoothBleWorker.cc.

References BluetoothWorker::_device, and BluetoothWorker::errorOccurred().

◆ onDisconnectLink()

void BluetoothBleWorker::onDisconnectLink ( )
overrideprotectedvirtual

Implements BluetoothWorker.

Definition at line 78 of file BluetoothBleWorker.cc.

◆ onResetAfterConsecutiveFailures()

void BluetoothBleWorker::onResetAfterConsecutiveFailures ( )
overrideprotectedvirtual

Implements BluetoothWorker.

Definition at line 108 of file BluetoothBleWorker.cc.

References BluetoothWorker::_consecutiveFailures.

◆ onServiceDiscoveryTimeout()

void BluetoothBleWorker::onServiceDiscoveryTimeout ( )
overrideprotectedvirtual

Implements BluetoothWorker.

Definition at line 101 of file BluetoothBleWorker.cc.

◆ onSetupConnection()

void BluetoothBleWorker::onSetupConnection ( )
overrideprotectedvirtual

Implements BluetoothWorker.

Definition at line 54 of file BluetoothBleWorker.cc.

◆ onWriteData()

void BluetoothBleWorker::onWriteData ( const QByteArray &  data)
overrideprotectedvirtual

Implements BluetoothWorker.

Definition at line 96 of file BluetoothBleWorker.cc.


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