Dokit
Internal development documentation
Loading...
Searching...
No Matches
pokitdevice_p.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4/*!
5 * \file
6 * Declares the PokitDevicePrivate class.
7 */
8
9#ifndef QTPOKIT_POKITDEVICE_P_H
10#define QTPOKIT_POKITDEVICE_P_H
11
13
14#include <QLoggingCategory>
15#include <QLowEnergyController>
16#include <QLowEnergyConnectionParameters>
17#include <QMutex>
18#include <QObject>
19
21
25class DsoService;
27class StatusService;
28
29class PokitDevice;
30
32{
33 Q_OBJECT
34
35public:
36 static Q_LOGGING_CATEGORY(lc, "pokit.ble.controller", QtInfoMsg); ///< Logging category.
37
38 QLowEnergyController * controller { nullptr }; ///< BLE controller for accessing the Pokit device.
39
40 CalibrationService * calibration { nullptr }; ///< Calibration service for this Pokit device.
41 DataLoggerService * dataLogger { nullptr }; ///< Data Logger service for this Pokit device.
42 DeviceInfoService * deviceInfo { nullptr }; ///< Device Info service for this Pokit device.
43 DsoService * dso { nullptr }; ///< DSO service for this Pokit device.
44 MultimeterService * multimeter { nullptr }; ///< Multimeter service for this Pokit device.
45 StatusService * status { nullptr }; ///< Status service for this Pokit device.
46
47 QMutex calibrationMutex; ///< Mutex for protecting access to #calibration.
48 QMutex dataLoggerMutex; ///< Mutex for protecting access to #dataLogger.
49 QMutex deviceInfoMutex; ///< Mutex for protecting access to #deviceInfo.
50 QMutex dsoMutex; ///< Mutex for protecting access to #dso.
51 QMutex multimeterMutex; ///< Mutex for protecting access to #multimeter.
52 QMutex statusMutex; ///< Mutex for protecting access to #status.
53
54 explicit PokitDevicePrivate(PokitDevice * const q);
55
56 void setController(QLowEnergyController * newController);
57
58public Q_SLOTS:
59 void connected() const;
60 void connectionUpdated(const QLowEnergyConnectionParameters &newParameters) const;
61 void disconnected() const;
62 void discoveryFinished() const;
63 void errorOccurred(QLowEnergyController::Error newError) const;
64 void serviceDiscovered(const QBluetoothUuid &newService) const;
65 void stateChanged(QLowEnergyController::ControllerState state) const;
66
67protected:
68 PokitDevice * q_ptr; ///< Internal q-pointer.
69
70private:
71 Q_DECLARE_PUBLIC(PokitDevice)
73 friend class TestPokitDevice;
74};
75
77
78#endif // QTPOKIT_POKITDEVICE_P_H
The CalibrationService class accesses the Calibrartion service of Pokit devices.
The DataLoggerService class accesses the Data Logger service of Pokit devices.
The DeviceInfoService class accesses the Device Info service of Pokit devices.
The DsoService class accesses the DSO (Digital Storage Oscilloscope) service of Pokit devices.
Definition dsoservice.h:24
The MultimeterService class accesses the Multimeter service of Pokit devices.
The PokitDevicePrivate class provides private implementation for PokitDevice.
QMutex deviceInfoMutex
Mutex for protecting access to deviceInfo.
QMutex multimeterMutex
Mutex for protecting access to multimeter.
QMutex dsoMutex
Mutex for protecting access to dso.
QMutex calibrationMutex
Mutex for protecting access to calibration.
QMutex dataLoggerMutex
Mutex for protecting access to dataLogger.
QMutex statusMutex
Mutex for protecting access to status.
PokitDevice * q_ptr
Internal q-pointer.
static Q_LOGGING_CATEGORY(lc, "pokit.ble.controller", QtInfoMsg)
Logging category.
The PokitDevice class simplifies Pokit device access.
Definition pokitdevice.h:31
The StatusService class accesses the Pokit Status service of Pokit devices.
Q_DISABLE_COPY(Class)
Q_SLOTSQ_SLOTS
Global QtPokit library macros.
#define QTPOKIT_BEGIN_NAMESPACE
Macro for starting the QtPokit library's top-most namespace (if one is defined).
#define QTPOKIT_EXPORT
QtPokit library export/import macro.
#define QTPOKIT_END_NAMESPACE
Macro for ending the QtPokit library's top-most namespace (if one is defined).