LCOV - code coverage report
Current view: top level - include/qtpokit - calibrationservice.h (source / functions) Coverage Total Hit
Project: Dokit Lines: 14.3 % 21 3
Version: Functions: 100.0 % 3 3

            Line data    Source code
       1              : // SPDX-FileCopyrightText: 2022-2025 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              : 
      12              : #include "abstractpokitservice.h"
      13              : 
      14              : #include <QBluetoothAddress>
      15              : #include <QBluetoothUuid>
      16              : #include <QVersionNumber>
      17              : 
      18              : QTPOKIT_BEGIN_NAMESPACE
      19              : 
      20              : class CalibrationServicePrivate;
      21              : 
      22              : class QTPOKIT_EXPORT CalibrationService : public AbstractPokitService
      23              : {
      24           65 :     Q_OBJECT
      25            0 : 
      26            0 : public:
      27            0 :     /// UUID of the `Calibration` service.
      28            0 :     static inline const QBluetoothUuid serviceUuid { QStringLiteral("6f53be2f-780b-49b8-a7c3-e8a052b3ae2c") };
      29            0 : 
      30            0 :     /// Characteristics available via the `Calibration` service.
      31            0 :     struct QTPOKIT_EXPORT CharacteristicUuids {
      32            0 :         /// UUID of the `Calibration` service's `Temperature` characteristic.
      33            0 :         static inline const QBluetoothUuid temperature { QStringLiteral("0cd0f713-f5aa-4572-9e23-f8049f6bcaaa") };
      34            0 : 
      35            0 :         /// \todo UUID of the `Calibration` service's (undocumented) `Get Parameter` characteristic.
      36            0 :         static inline const QBluetoothUuid getParam { QStringLiteral("b6728f91-409c-4d6c-864e-272a6a7a0204") };
      37            0 : 
      38            0 :         /// \todo UUID of the `Calibration` service's (undocumented) `Set Parameter` characteristic.
      39            0 :         static inline const QBluetoothUuid setParam { QStringLiteral("5588e47b-cb81-4f7b-acc4-6029a3f39f72") };
      40            0 :     };
      41            0 : 
      42            0 :     CalibrationService(QLowEnergyController * const pokitDevice, QObject * parent = nullptr);
      43          404 :     ~CalibrationService() = default;
      44              : 
      45              :     bool readCharacteristics() override;
      46              : 
      47              :     // Temperature characteristic (BLE write only).
      48              :     bool calibrateTemperature(const float ambientTemperature);
      49              : 
      50              : Q_SIGNALS:
      51              :     void temperatureCalibrated();
      52              : 
      53              : protected:
      54              :     /// \cond internal
      55              :     CalibrationService(CalibrationServicePrivate * const d, QObject * const parent);
      56              :     /// \endcond
      57              : 
      58              : private:
      59          192 :     Q_DECLARE_PRIVATE(CalibrationService)
      60              :     Q_DISABLE_COPY(CalibrationService)
      61              :     QTPOKIT_BEFRIEND_TEST(CalibrationService)
      62              : };
      63              : 
      64              : QTPOKIT_END_NAMESPACE
      65              : 
      66              : #endif // QTPOKIT_CALIBRATIONSERVICE_H
        

Generated by: LCOV version 2.3.2-1