9#ifndef QTPOKIT_DATALOGGERSERVICE_H
10#define QTPOKIT_DATALOGGERSERVICE_H
14#include <QBluetoothAddress>
15#include <QBluetoothUuid>
16#include <QVersionNumber>
18QTPOKIT_BEGIN_NAMESPACE
20class DataLoggerServicePrivate;
62 static quint32 maxValue(
const PokitProduct product,
const quint8 range,
const Mode mode);
63 quint32 maxValue(
const quint8 range,
const Mode mode)
const;
Declares the AbstractPokitService class.
virtual bool readCharacteristics()=0
Read all characteristics.
bool readMetadataCharacteristic()
Reads the DataLogger service's Metadata characteristic.
Definition dataloggerservice.cpp:140
bool enableMetadataNotifications()
Enables client-side notifications of Data Logger metadata changes.
Definition dataloggerservice.cpp:254
static const QBluetoothUuid serviceUuid
UUID of the "DataLogger" service.
Definition dataloggerservice.h:28
LoggerStatus
Values supported by the Status attribute of the Metadata characteristic.
Definition dataloggerservice.h:76
@ BufferFull
Buffer is full.
Definition dataloggerservice.h:79
@ Sampling
Actively sampling.
Definition dataloggerservice.h:78
@ Error
An error has occurred.
Definition dataloggerservice.h:80
@ Done
Sampling has completed.
Definition dataloggerservice.h:77
DataLoggerService(QLowEnergyController *const pokitDevice, QObject *parent=nullptr)
Constructs a new Pokit service with parent.
Definition dataloggerservice.cpp:108
bool disableMetadataNotifications()
Disables client-side notifications of Data Logger metadata changes.
Definition dataloggerservice.cpp:267
bool enableReadingNotifications()
Enables client-side notifications of Data Logger readings.
Definition dataloggerservice.cpp:280
bool setSettings(const Settings &settings)
Configures the Pokit device's data logger mode.
Definition dataloggerservice.cpp:153
bool startLogger(const Settings &settings)
Start the data logger with settings.
Definition dataloggerservice.cpp:179
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
Definition dataloggerservice.h:94
bool fetchSamples()
Start the data logger.
Definition dataloggerservice.cpp:214
void samplesRead(const DataLoggerService::Samples &samples)
This signal is emitted when the Reading characteristic has been notified.
void metadataRead(const DataLoggerService::Metadata &meta)
This signal is emitted when the Metadata characteristic has been read successfully.
Command
Values supported by the Command attribute of the Settings characteristic.
Definition dataloggerservice.h:43
@ Stop
Stop the Data Logger.
Definition dataloggerservice.h:45
@ Refresh
Refresh the Data Logger.
Definition dataloggerservice.h:46
@ Start
Start the Data Logger.
Definition dataloggerservice.h:44
bool disableReadingNotifications()
Disables client-side notifications of Data Logger readings.
Definition dataloggerservice.cpp:291
bool stopLogger()
Stop the data logger.
Definition dataloggerservice.cpp:196
Metadata metadata() const
Returns the most recent value of the DataLogger service's Metadata characteristic.
Definition dataloggerservice.cpp:236
Mode
Values supported by the Mode attribute of the Settings and Metadata characteristics.
Definition dataloggerservice.h:50
@ DcVoltage
Measure DC voltage.
Definition dataloggerservice.h:52
@ AcCurrent
Measure AC current.
Definition dataloggerservice.h:55
@ AcVoltage
Measure AC voltage.
Definition dataloggerservice.h:53
@ Idle
Make device idle.
Definition dataloggerservice.h:51
@ Temperature
Measure temperature.
Definition dataloggerservice.h:56
@ DcCurrent
Measure DC current.
Definition dataloggerservice.h:54
void settingsWritten()
This signal is emitted when the Settings characteristic has been written successfully.
PokitProduct
Pokit products known to, and supported by, the QtPokit library.
Definition pokitproducts.h:21
QTPOKIT_EXPORT QString toString(const PokitProduct product)
Returns product as user-friendly string.
Definition pokitproducts.cpp:33
QObject * parent() const const
Characteristics available via the DataLogger service.
Definition dataloggerservice.h:31
static const QBluetoothUuid metadata
UUID of the DataLogger service's Metadata characterstic.
Definition dataloggerservice.h:36
static const QBluetoothUuid settings
UUID of the DataLogger service's Settings characterstic.
Definition dataloggerservice.h:33
static const QBluetoothUuid reading
UUID of the DataLogger service's Reading characterstic.
Definition dataloggerservice.h:39
Attributes included in the Settings characterstic.
Definition dataloggerservice.h:66
quint32 timestamp
Custom timestamp for start time in retrieved metadata.
Definition dataloggerservice.h:72
quint16 arguments
Reserved to used along with command in future.
Definition dataloggerservice.h:68
Command command
Custom operation request.
Definition dataloggerservice.h:67
quint8 range
Desired range.
Definition dataloggerservice.h:70
Mode mode
Desired operation mode.
Definition dataloggerservice.h:69
quint32 updateInterval
Desired update interval in milliseconds.
Definition dataloggerservice.h:71