9#ifndef QTPOKIT_DATALOGGERSERVICE_H
10#define QTPOKIT_DATALOGGERSERVICE_H
14#include <QBluetoothAddress>
15#include <QBluetoothUuid>
16#include <QVersionNumber>
18QTPOKIT_BEGIN_NAMESPACE
20class DataLoggerServicePrivate;
49 static QString toString(
const Mode &mode);
60 static QString toString(
const VoltageRange &range);
61 static QVariant minValue(
const VoltageRange &range);
62 static QVariant maxValue(
const VoltageRange &range);
72 static QString toString(
const CurrentRange &range);
73 static QVariant minValue(
const CurrentRange &range);
74 static QVariant maxValue(
const CurrentRange &range);
117 bool readMetadataCharacteristic();
120 bool setSettings(
const Settings &settings);
121 bool startLogger(
const Settings &settings);
127 bool enableMetadataNotifications();
128 bool disableMetadataNotifications();
131 bool enableReadingNotifications();
132 bool disableReadingNotifications();
147 friend class TestDataLoggerService;
Declares the AbstractPokitService class.
The AbstractPokitService class provides a common base for Pokit services classes.
Definition: abstractpokitservice.h:24
virtual bool readCharacteristics()=0
Read all characteristics.
The DataLoggerService class accesses the Data Logger service of Pokit devices.
Definition: dataloggerservice.h:23
CurrentRange
Values supported by the Range attribute of the Settings and Metadata characteristics,...
Definition: dataloggerservice.h:64
static const QBluetoothUuid serviceUuid
UUID of the "DataLogger" service.
Definition: dataloggerservice.h:27
LoggerStatus
Values supported by the Status attribute of the Metadata characteristic.
Definition: dataloggerservice.h:94
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
Definition: dataloggerservice.h:111
void metadataRead(const DataLoggerService::Metadata &meta)
This signal is emitted when the Metadata characteristic has been read successfully.
void samplesRead(const DataLoggerService::Samples &samples)
This signal is emitted when the Reading characteristic has been notified.
Command
Values supported by the Command attribute of the Settings characteristic.
Definition: dataloggerservice.h:35
Mode
Values supported by the Mode attribute of the Settings and Metadata characteristics.
Definition: dataloggerservice.h:41
VoltageRange
Values supported by the Range attribute of the Settings and Metadata characteristics,...
Definition: dataloggerservice.h:51
void settingsWritten()
This signal is emitted when the Settings characteristic has been written successfully.
QTPOKIT_EXPORT bool operator<=(const DataLoggerService::Range &lhs, const DataLoggerService::Range &rhs)
Returns true if lhs is numerically less than or equal to rhs, false otherwise.
Definition: dataloggerservice.cpp:244
QTPOKIT_EXPORT bool operator>=(const DataLoggerService::Range &lhs, const DataLoggerService::Range &rhs)
Returns true if lhs is numerically greater than or equal to rhs, false otherwise.
Definition: dataloggerservice.cpp:251
QTPOKIT_EXPORT bool operator<(const DataLoggerService::Range &lhs, const DataLoggerService::Range &rhs)
Returns true if lhs is numerically less than rhs, false otherwise.
Definition: dataloggerservice.cpp:230
QTPOKIT_EXPORT bool operator>(const DataLoggerService::Range &lhs, const DataLoggerService::Range &rhs)
Returns true if lhs is numerically greater than rhs, false otherwise.
Definition: dataloggerservice.cpp:237
QTPOKIT_EXPORT bool operator!=(const DataLoggerService::Range &lhs, const DataLoggerService::Range &rhs)
Returns true if lhs is numerically not-equal to rhs, false otherwise.
Definition: dataloggerservice.cpp:223
QTPOKIT_EXPORT bool operator==(const DataLoggerService::Range &lhs, const DataLoggerService::Range &rhs)
Returns true if lhs is numerically equal to rhs, false otherwise.
Definition: dataloggerservice.cpp:216
Characteristics available via the DataLogger service.
Definition: dataloggerservice.h:29
static const QBluetoothUuid metadata
UUID of the DataLogger service's Metadata characterstic.
Definition: dataloggerservice.h:31
static const QBluetoothUuid settings
UUID of the DataLogger service's Settings characterstic.
Definition: dataloggerservice.h:30
static const QBluetoothUuid reading
UUID of the DataLogger service's Reading characterstic.
Definition: dataloggerservice.h:32
Attributes included in the Settings characterstic.
Definition: dataloggerservice.h:85
quint32 timestamp
Custom timestamp for start time in retrieved metadata.
Definition: dataloggerservice.h:91
quint16 arguments
Reserved to used along with command in future.
Definition: dataloggerservice.h:87
Command command
Custom operation request.
Definition: dataloggerservice.h:86
Mode mode
Desired operation mode.
Definition: dataloggerservice.h:88
Range range
Desired range.
Definition: dataloggerservice.h:89
quint32 updateInterval
Desired update interval in milliseconds.
Definition: dataloggerservice.h:90
Values supported by the Range attribute of the Settings and Metadata characteristics.
Definition: dataloggerservice.h:76
CurrentRange currentRange
Range when in AC/DC current mode.
Definition: dataloggerservice.h:78
VoltageRange voltageRange
Range when in AC/DC voltage mode.
Definition: dataloggerservice.h:77