LCOV - code coverage report
Current view: top level - include/qtpokit - deviceinfoservice.h (source / functions) Hit Total Coverage
Project: QtPokit Lines: 2 2 100.0 %
Version: Functions: 0 0 -

          Line data    Source code
       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 DeviceInfoService class.
       7             :  */
       8             : 
       9             : #ifndef QTPOKIT_INFOSERVICE_H
      10             : #define QTPOKIT_INFOSERVICE_H
      11             : 
      12             : #include "abstractpokitservice.h"
      13             : 
      14             : #include <QBluetoothAddress>
      15             : #include <QBluetoothUuid>
      16             : #include <QVersionNumber>
      17             : 
      18             : QTPOKIT_BEGIN_NAMESPACE
      19             : 
      20             : class DeviceInfoServicePrivate;
      21             : 
      22             : class QTPOKIT_EXPORT DeviceInfoService : public AbstractPokitService
      23             : {
      24          17 :     Q_OBJECT
      25             : 
      26             : public:
      27             :     static const QBluetoothUuid serviceUuid;
      28             : 
      29             :     struct QTPOKIT_EXPORT CharacteristicUuids {
      30             :         static const QBluetoothUuid manufacturerName;
      31             :         static const QBluetoothUuid modelNumber;
      32             :         static const QBluetoothUuid hardwareRevision;
      33             :         static const QBluetoothUuid firmwareRevision;
      34             :         static const QBluetoothUuid softwareRevision;
      35             :     };
      36             : 
      37             :     DeviceInfoService(QLowEnergyController * const pokitDevice, QObject * parent = nullptr);
      38             :     ~DeviceInfoService() override;
      39             : 
      40             :     bool readCharacteristics() override;
      41             :     bool readFirmwareRevisionCharacteristic();
      42             :     bool readHardwareRevisionCharacteristic();
      43             :     bool readManufacturerCharacteristics();
      44             :     bool readModelNumberCharacteristic();
      45             :     bool readSoftwareRevisionCharacteristic();
      46             : 
      47             :     // All Device Info characteristics are read-only, single values.
      48             :     QString manufacturer() const;
      49             :     QString modelNumber() const;
      50             :     QString hardwareRevision() const;
      51             :     QString firmwareRevision() const;
      52             :     QString softwareRevision() const;
      53             : 
      54             : signals:
      55             :     void manufacturerRead(const QString &name);
      56             :     void modelNumberRead(const QString &model);
      57             :     void hardwareRevisionRead(const QString &revision);
      58             :     void firmwareRevisionRead(const QString &revision);
      59             :     void softwareRevisionRead(const QString &revision);
      60             : 
      61             : protected:
      62             :     /// \cond internal
      63             :     DeviceInfoService(DeviceInfoServicePrivate * const d, QObject * const parent);
      64             :     /// \endcond
      65             : 
      66             : private:
      67        1688 :     Q_DECLARE_PRIVATE(DeviceInfoService)
      68             :     Q_DISABLE_COPY(DeviceInfoService)
      69             :     friend class TestDeviceInfoService;
      70             : };
      71             : 
      72             : QTPOKIT_END_NAMESPACE
      73             : 
      74             : #endif // QTPOKIT_INFOSERVICE_H

Generated by: LCOV version 1.14