Dokit
Internal development documentation
Loading...
Searching...
No Matches
calibrationservice.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 CalibrationService class.
7 */
8
9#ifndef QTPOKIT_CALIBRATIONSERVICE_H
10#define QTPOKIT_CALIBRATIONSERVICE_H
11
13
14#include <QBluetoothAddress>
15#include <QBluetoothUuid>
16#include <QVersionNumber>
17
19
21
23{
24 Q_OBJECT
25
26public:
27 /// UUID of the `Calibration` service.
28 static inline const QBluetoothUuid serviceUuid { QStringLiteral("6f53be2f-780b-49b8-a7c3-e8a052b3ae2c") };
29
30 /// Characteristics available via the `Calibration` service.
32 /// UUID of the `Calibration` service's `Temperature` characterstic.
33 static inline const QBluetoothUuid temperature { QStringLiteral("0cd0f713-f5aa-4572-9e23-f8049f6bcaaa") };
34
35 /// \todo UUID of the `Calibration` service's (undocumented) `Get Parameter` characterstic.
36 static inline const QBluetoothUuid getParam { QStringLiteral("b6728f91-409c-4d6c-864e-272a6a7a0204") };
37
38 /// \todo UUID of the `Calibration` service's (undocumented) `Set Parameter` characterstic.
39 static inline const QBluetoothUuid setParam { QStringLiteral("5588e47b-cb81-4f7b-acc4-6029a3f39f72") };
40 };
41
42 CalibrationService(QLowEnergyController * const pokitDevice, QObject * parent = nullptr);
43 ~CalibrationService() = default;
44
45 bool readCharacteristics() override;
46
47 // Temperature characteristic (BLE write only).
48 bool calibrateTemperature(const float ambientTemperature);
49
52
53protected:
54 /// \cond internal
55 CalibrationService(CalibrationServicePrivate * const d, QObject * const parent);
56 /// \endcond
57
58private:
59 Q_DECLARE_PRIVATE(CalibrationService)
61 friend class TestCalibrationService;
62};
63
65
66#endif // QTPOKIT_CALIBRATIONSERVICE_H
Declares the AbstractPokitService class.
The AbstractPokitService class provides a common base for Pokit services classes.
virtual bool readCharacteristics()=0
Read all characteristics.
The CalibrationServicePrivate class provides private implementation for CalibrationService.
The CalibrationService class accesses the Calibrartion service of Pokit devices.
void temperatureCalibrated()
This signal is emitted when the Temperature characteristic has been written succesfully.
Q_DISABLE_COPY(Class)
Q_SIGNALSQ_SIGNALS
#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).
Characteristics available via the Calibration service.