Dokit
Internal development documentation
Loading...
Searching...
No Matches
dataloggerservice_p.h
Go to the documentation of this file.
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 DataLoggerServicePrivate class.
7 */
8
9#ifndef QTPOKIT_DATALOGGERSERVICE_P_H
10#define QTPOKIT_DATALOGGERSERVICE_P_H
11
13
15
17
19{
21
22public:
24
26 const bool updateIntervalIs32bit);
27
30
31protected:
32 void characteristicRead(const QLowEnergyCharacteristic &characteristic,
33 const QByteArray &value) override;
34 void characteristicWritten(const QLowEnergyCharacteristic &characteristic,
35 const QByteArray &newValue) override;
36 void characteristicChanged(const QLowEnergyCharacteristic &characteristic,
37 const QByteArray &newValue) override;
38
39private:
40 Q_DECLARE_PUBLIC(DataLoggerService)
43};
44
46
47#endif // QTPOKIT_DATALOGGERSERVICE_P_H
Declares the AbstractPokitServicePrivate class.
virtual void characteristicChanged(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
Handles QLowEnergyService::characteristicChanged events.
AbstractPokitServicePrivate(const QBluetoothUuid &serviceUuid, QLowEnergyController *controller, AbstractPokitService *const q)
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.
QLowEnergyController * controller
BLE controller to fetch the service from.
static QByteArray encodeSettings(const DataLoggerService::Settings &settings, const bool updateIntervalIs32bit)
Returns settings in the format Pokit devices expect.
static DataLoggerService::Samples parseSamples(const QByteArray &value)
Parses the Reading value into a DataLoggerService::Samples vector.
static DataLoggerService::Metadata parseMetadata(const QByteArray &value)
Parses the Metadata value into a DataLoggerService::Metatdata struct.
DataLoggerServicePrivate(QLowEnergyController *controller, DataLoggerService *const q)
The DataLoggerService class accesses the Data Logger service of Pokit devices.
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
Declares the DataLoggerService class.
Q_DISABLE_COPY(Class)
Q_OBJECTQ_OBJECT
#define QTPOKIT_BEFRIEND_TEST(Class)
Macro for befriending a related unit test class, but only when QT_TESTLIB_LIB is defined.
#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).
Attributes included in the Metadata characterstic.
Attributes included in the Settings characterstic.