9#ifndef QTPOKIT_DATALOGGERSERVICE_H
10#define QTPOKIT_DATALOGGERSERVICE_H
14#include <QBluetoothAddress>
15#include <QBluetoothUuid>
16#include <QVersionNumber>
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.
The DataLoggerServicePrivate class provides private implementation for DataLoggerService.
bool readMetadataCharacteristic()
Reads the DataLogger service's Metadata characteristic.
bool enableMetadataNotifications()
Enables client-side notifications of Data Logger metadata changes.
static const QBluetoothUuid serviceUuid
UUID of the "DataLogger" service.
LoggerStatus
Values supported by the Status attribute of the Metadata characteristic.
@ BufferFull
Buffer is full.
@ Sampling
Actively sampling.
@ Error
An error has occurred.
@ Done
Sampling has completed.
DataLoggerService(QLowEnergyController *const pokitDevice, QObject *parent=nullptr)
Constructs a new Pokit service with parent.
bool disableMetadataNotifications()
Disables client-side notifications of Data Logger metadata changes.
bool enableReadingNotifications()
Enables client-side notifications of Data Logger readings.
bool setSettings(const Settings &settings)
Configures the Pokit device's data logger mode.
bool startLogger(const Settings &settings)
Start the data logger with settings.
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
bool fetchSamples()
Start the data logger.
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.
@ Stop
Stop the Data Logger.
@ Refresh
Refresh the Data Logger.
@ Start
Start the Data Logger.
bool disableReadingNotifications()
Disables client-side notifications of Data Logger readings.
bool stopLogger()
Stop the data logger.
Metadata metadata() const
Returns the most recent value of the DataLogger service's Metadata characteristic.
Mode
Values supported by the Mode attribute of the Settings and Metadata characteristics.
@ DcVoltage
Measure DC voltage.
@ AcCurrent
Measure AC current.
@ AcVoltage
Measure AC voltage.
@ Temperature
Measure temperature.
@ DcCurrent
Measure DC current.
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.
QTPOKIT_EXPORT QString toString(const PokitProduct product)
Returns product as user-friendly string.
QObject * parent() const const
#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).
Characteristics available via the DataLogger service.
static const QBluetoothUuid metadata
UUID of the DataLogger service's Metadata characterstic.
static const QBluetoothUuid settings
UUID of the DataLogger service's Settings characterstic.
static const QBluetoothUuid reading
UUID of the DataLogger service's Reading characterstic.
Attributes included in the Settings characterstic.
quint32 timestamp
Custom timestamp for start time in retrieved metadata.
quint16 arguments
Reserved to used along with command in future.
Command command
Custom operation request.
quint8 range
Desired range.
Mode mode
Desired operation mode.
quint32 updateInterval
Desired update interval in milliseconds.