LCOV - code coverage report
Current view: top level - src/cli - devicecommand.h (source / functions) Hit Total Coverage
Project: Dokit Lines: 1 2 50.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             : #ifndef DOKIT_DEVICECOMMAND_H
       5             : #define DOKIT_DEVICECOMMAND_H
       6             : 
       7             : #include "abstractcommand.h"
       8             : 
       9             : #include <QLowEnergyController>
      10             : 
      11             : class AbstractPokitService;
      12             : class PokitDevice;
      13             : 
      14           0 : class DeviceCommand : public AbstractCommand
      15             : {
      16         162 :     Q_OBJECT
      17             : 
      18             : public:
      19             :     explicit DeviceCommand(QObject * const parent);
      20             : 
      21             : public slots:
      22             :     bool start() override;
      23             : 
      24             : protected:
      25             :     PokitDevice * device { nullptr }; ///< Pokit Bluetooth device (if any) this command inerracts with.
      26             :     int exitCodeOnDisconnect { EXIT_FAILURE }; ///< Exit code to return on device disconnection.
      27             : 
      28             :     void disconnect(int exitCode=EXIT_SUCCESS);
      29             :     virtual AbstractPokitService * getService() = 0;
      30             : 
      31             : protected slots:
      32             :     virtual void controllerError(const QLowEnergyController::Error error);
      33             :     virtual void deviceDisconnected();
      34             :     virtual void serviceError(const QLowEnergyService::ServiceError error);
      35             :     virtual void serviceDetailsDiscovered();
      36             : 
      37             : private slots:
      38             :     // These are protected in the base class, but hidden (private) for our descendents.
      39             :     void deviceDiscovered(const QBluetoothDeviceInfo &info) override;
      40             :     void deviceDiscoveryFinished() override;
      41             : 
      42             :     friend class TestDeviceCommand;
      43             : };
      44             : 
      45             : #endif // DOKIT_DEVICECOMMAND_H

Generated by: LCOV version 1.14