Dokit
Internal development documentation
Loading...
Searching...
No Matches
pokitdevice_p.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022-2023 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;
28class StatusService;
29
30class PokitDevice;
31
33{
34 Q_OBJECT
35
36public:
37 static Q_LOGGING_CATEGORY(lc, "pokit.ble.controller", QtInfoMsg); ///< Logging category.
38
39 QLowEnergyController * controller { nullptr }; ///< BLE controller for accessing the Pokit device.
40
41 CalibrationService * calibration { nullptr }; ///< Calibration service for this Pokit device.
42 DataLoggerService * dataLogger { nullptr }; ///< Data Logger service for this Pokit device.
43 DeviceInfoService * deviceInfo { nullptr }; ///< Device Info service for this Pokit device.
44 DsoService * dso { nullptr }; ///< DSO service for this Pokit device.
45 GenericAccessService * genericAccess { nullptr }; ///< Generic Access service for this Pokit device.
46 MultimeterService * multimeter { nullptr }; ///< Multimeter service for this Pokit device.
47 StatusService * status { nullptr }; ///< Status service for this Pokit device.
48
49 QMutex calibrationMutex; ///< Mutex for protecting access to #calibration.
50 QMutex dataLoggerMutex; ///< Mutex for protecting access to #dataLogger.
51 QMutex deviceInfoMutex; ///< Mutex for protecting access to #deviceInfo.
52 QMutex dsoMutex; ///< Mutex for protecting access to #dso.
53 QMutex genericAccessMutex; ///< Mutex for protecting access to #genericAccess.
54 QMutex multimeterMutex; ///< Mutex for protecting access to #multimeter.
55 QMutex statusMutex; ///< Mutex for protecting access to #status.
56
57 explicit PokitDevicePrivate(PokitDevice * const q);
58
59 void setController(QLowEnergyController * newController);
60
61public Q_SLOTS:
62 void connected() const;
63 void connectionUpdated(const QLowEnergyConnectionParameters &newParameters) const;
64 void disconnected() const;
65 void discoveryFinished() const;
66 void errorOccurred(QLowEnergyController::Error newError) const;
67 void serviceDiscovered(const QBluetoothUuid &newService) const;
68 void stateChanged(QLowEnergyController::ControllerState state) const;
69
70protected:
71 PokitDevice * q_ptr; ///< Internal q-pointer.
72
73private:
74 Q_DECLARE_PUBLIC(PokitDevice)
76 friend class TestPokitDevice;
77};
78
80
81#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 GenericAccessService class accesses the Generic Access service of Pokit devices.
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.
QMutex genericAccessMutex
Mutex for protecting access to genericAccess.
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:32
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).