Dokit
Internal development documentation
Loading...
Searching...
No Matches
statusservice_p.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 StatusServicePrivate class.
7 */
8
9#ifndef QTPOKIT_STATUSSERVICE_P_H
10#define QTPOKIT_STATUSSERVICE_P_H
11
13
15
16#include <optional>
17
19
21{
22 Q_OBJECT
23
24public:
25 explicit StatusServicePrivate(QLowEnergyController * controller, StatusService * const q);
26
27 static StatusService::DeviceCharacteristics parseDeviceCharacteristics(const QByteArray &value);
28 static StatusService::Status parseStatus(const QByteArray &value);
29 static std::optional<StatusService::TorchStatus> parseTorchStatus(const QByteArray &value);
30 static std::optional<StatusService::ButtonStatus> parseButtonPress(const QByteArray &value);
31
32protected:
33 void serviceDiscovered(const QBluetoothUuid &newService) override;
34
35 void characteristicRead(const QLowEnergyCharacteristic &characteristic,
36 const QByteArray &value) override;
37 void characteristicWritten(const QLowEnergyCharacteristic &characteristic,
38 const QByteArray &newValue) override;
39
40private:
41 Q_DECLARE_PUBLIC(StatusService)
43 friend class TestStatusService;
44};
45
47
48#endif // QTPOKIT_STATUSSERVICE_P_H
Declares the AbstractPokitServicePrivate class.
The AbstractPokitServicePrivate class provides private implementation for AbstractPokitService.
virtual void serviceDiscovered(const QBluetoothUuid &newService)
Handles QLowEnergyController::serviceDiscovered events.
virtual void characteristicRead(const QLowEnergyCharacteristic &characteristic, const QByteArray &value)
Handles QLowEnergyService::characteristicRead events.
virtual void characteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
Handles QLowEnergyService::characteristicWritten events.
The StatusServicePrivate class provides private implementation for StatusService.
The StatusService class accesses the Pokit Status service of Pokit devices.
Q_DISABLE_COPY(Class)
#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).
Declares the StatusService class.
Attributes included in the Device Characteristics characterstic.
Attributes included in the Status characterstic.