14#include "../Headers/bluetoothdevice.hpp"
15#include "../Headers/bluetoothservice.hpp"
16#include "../Headers/bluetoothinfo.hpp"
17#include <QBluetoothDeviceDiscoveryAgent>
18#include <QBluetoothDeviceInfo>
19#include <QLowEnergyController>
20#include <QRegularExpression>
25QT_FORWARD_DECLARE_CLASS (QBluetoothDeviceInfo)
ControllerType
ControllerType enumeration distinguishes between BlueCoin devices.
Definition: bluetooth.hpp:35
Auxiliary class that represents single Bluetooth device.
Definition: bluetoothdevice.hpp:33
This class manages Bluetooth connection capabilities.
Definition: bluetooth.hpp:53
bool Bluetooth_Connect(const QString &deviceAddress)
Manages selected device connection.
Definition: bluetooth.cpp:72
void Bluetooth_AddDevice(const QBluetoothDeviceInfo &device)
Slot that adds new found device to the list.
Definition: bluetooth.cpp:258
void Bluetooth_DeviceDisconnected()
Slot that reports device disconnection.
Definition: bluetooth.cpp:327
QLowEnergyService * mSecondaryService
QLowEnergyService member for secondary BLE service object.
Definition: bluetooth.hpp:412
bool mEnableDebugInformations
bool value that in its TRUE state enables additional debugging informations reporting while FALSE dis...
Definition: bluetooth.hpp:553
void Bluetooth_SignalDeviceConnected()
Signal that gets emitted when a device gets successfully connected.
QString mPrimaryLowLevelServiceUUID
QString with a pre-set value of characteristics UUID used by primary BlueCoin device.
Definition: bluetooth.hpp:510
QStringList Bluetooth_GetAddressList()
Getter function for device addresses list.
Definition: bluetooth.cpp:248
void Bluetooth_ServicesRegistered()
Slot function for service and characteristics analysis.
Definition: bluetooth.cpp:347
QTimer * mBluetoothRetrieveTimer
QTimer that is key part of Bluetooth module, it uses time in ms that will elapse before new data retr...
Definition: bluetooth.hpp:532
QList< QObject * > mDevices
QList<QObject>, a list of BLE devices held as a QObject pointers.
Definition: bluetooth.hpp:419
QList< QObject * > mServices
QList<QObject>, a list of discovered Bluetooth services held as a QObject pointers.
Definition: bluetooth.hpp:426
bool Bluetooth_IsDeviceConnected(const QString &deviceAddress)
Provides checking whether a device is connected or not.
Definition: bluetooth.cpp:204
QLowEnergyController * mSecondaryController
QLowEnergyController, a secondary controller member object.
Definition: bluetooth.hpp:400
BluetoothDevice mSecondaryBluetoothDevice
BluetoothDevice is custom class based member depicting secondary Bluetooth device.
Definition: bluetooth.hpp:447
QStringList mAddressList
QStringList that is a list of text strings with device addresses information.
Definition: bluetooth.hpp:461
void Bluetooth_ReportStatus()
Slot that manages discovery status reporting to MainWindow.
Definition: bluetooth.cpp:292
void Bluetooth_SetServiceRetrievalSpeed(qint16 serviceRetrievalSpeed)
Setter function for recovery timer member variable.
Definition: bluetooth.cpp:244
void Bluetooth_StartScanning()
Initiates the Bluetooth scanning process.
Definition: bluetooth.cpp:56
QString mSecondaryConnectedAddress
QString that holds information about the secondary connected device address.
Definition: bluetooth.hpp:475
void Bluetooth_ServiceDetailsObtained(qint16 serviceID, QLowEnergyService::ServiceState newState)
Slot that enables repeated characteristics reading.
Definition: bluetooth.cpp:447
QLowEnergyController * mPrimaryController
QLowEnergyController, a primary controller member object.
Definition: bluetooth.hpp:394
QString mSecondaryLowLevelServiceUUID
QString with a pre-set value of characteristics UUID used by secondary BlueCoin device.
Definition: bluetooth.hpp:517
QString mLatestDeviceAddress
QString that holds information about the latest connected device address used.
Definition: bluetooth.hpp:482
QString mPrimaryHighLevelServiceUUID
QString with a pre-set value of service UUID used by BlueCoin primary device.
Definition: bluetooth.hpp:489
void Bluetooth_SetDebugInformations(bool debugInformations)
Setter function for debugging informations member variable.
Definition: bluetooth.cpp:245
QTimer * mBluetoothDiscoveryTimer
QTimer that is used for continual Bluetooth devices discovery status reporting.
Definition: bluetooth.hpp:524
void Bluetooth_SignalDeviceBeyondLimit()
Signal that gets emitted if a connection occurs when all controllers are in use.
QStringList mDevicesList
QStringList, it is a list of text strings with device names information.
Definition: bluetooth.hpp:454
bool mScanningCompleted
bool value that in its TRUE state depicts a successful connection response while FALSE means a failur...
Definition: bluetooth.hpp:546
void Bluetooth_SignalSensorDataReady(const QString &hexValue)
Signal that gets emitted each time when measurement retrieving timer ticks.
void Bluetooth_SignalDeviceIncompatible()
Signal that gets emitted if a device is incompatible (not a BlueCoin).
void Bluetooth_StopRetrievingSensorData()
Function stops repeated data recovery.
Definition: bluetooth.cpp:239
QString mBaseLowLevelServiceUUID
QString with a pre-set value of characteristics UUID used by any BlueCoin device.
Definition: bluetooth.hpp:503
void Bluetooth_SignalDevicesReady()
Signal that gets emitted when device discovery finishes.
~Bluetooth()
Default class destructor.
Definition: bluetooth.cpp:41
void Bluetooth_StopScanning()
Slot that is processed when device discovery finishes.
Definition: bluetooth.cpp:294
BluetoothDevice mPrimaryBluetoothDevice
BluetoothDevice is custom class based member depicting primary Bluetooth device.
Definition: bluetooth.hpp:440
qint16 mServiceRetrievalSpeed
qint16 value that defines the time needed before mBluetoothRetrieveTimer ticks.
Definition: bluetooth.hpp:539
void Bluetooth_Disconnect(const QString &deviceAddress)
Manages chosen device's disconnection.
Definition: bluetooth.cpp:166
void Bluetooth_SignalConnectionError(const QString &error)
Signal that gets emitted when errors occur while discovering devices.
QLowEnergyService * mPrimaryService
QLowEnergyService member for primary BLE service object.
Definition: bluetooth.hpp:406
QBluetoothDeviceDiscoveryAgent * mDiscoveryAgent
QBluetoothDeviceDiscoveryAgent member variable pointer for device discovery functionalities.
Definition: bluetooth.hpp:388
void Bluetooth_RegisterService(ControllerType controllerType, const QBluetoothUuid &uuid)
Slot function for service registration.
Definition: bluetooth.cpp:333
void Bluetooth_DeviceHasError(ControllerType controllerType)
Slot that reports device error.
Definition: bluetooth.cpp:319
void Bluetooth_SignalDeviceUnreachable()
Signal that gets emitted if a device goes out of reach/availability.
QRegularExpression mHighLevelUUIDExpression
QRegularExpression, a member object for UUID pattern recognition used for services and characteristic...
Definition: bluetooth.hpp:433
void Bluetooth_SignalStatusReady()
Signal that depicts a need to update device discovery status bar in MainWindow.
QString mPrimaryConnectedAddress
QString that holds information about the primary connected device address.
Definition: bluetooth.hpp:468
QStringList Bluetooth_GetDevicesList()
Getter function for device names list.
Definition: bluetooth.cpp:247
void Bluetooth_RetrieveSensorData()
Handles the data recovery and possibility of further processing.
Definition: bluetooth.cpp:211
void Bluetooth_SignalDisconnected()
Signal that gets emitted when a device gets disconnected.
Bluetooth()
Default class constructor for Bluetooth.
Definition: bluetooth.cpp:14
void Bluetooth_DeviceConnected(ControllerType controllerType)
Slot that initiates service discovery.
Definition: bluetooth.cpp:303
void Bluetooth_SignalCharacteristicsUpdated()
Signal that gets emitted when characteristics properties change.
quint16 Bluetooth_GetConnectedDevicesCount()
Function for connected devices calculation.
Definition: bluetooth.cpp:250
void Bluetooth_CatchError(QBluetoothDeviceDiscoveryAgent::Error error)
Slot used for error catching while discovering devices.
Definition: bluetooth.cpp:269
QString mSecondaryHighLevelServiceUUID
QString with a pre-set value of service UUID used by BlueCoin secondary device.
Definition: bluetooth.hpp:496