9#ifndef QTPOKIT_DSOSERVICE_H
10#define QTPOKIT_DSOSERVICE_H
15#include <QBluetoothAddress>
16#include <QBluetoothUuid>
17#include <QVersionNumber>
19QTPOKIT_BEGIN_NAMESPACE
21class DsoServicePrivate;
23class QTPOKIT_EXPORT
DsoService :
public AbstractPokitService
63 static quint32 maxValue(
const PokitProduct product,
const quint8 range,
const Mode mode);
64 quint32 maxValue(
const quint8 range,
const Mode mode)
const;
Declares the AbstractPokitService class.
virtual bool readCharacteristics()=0
Read all characteristics.
void metadataRead(const DsoService::Metadata &meta)
This signal is emitted when the Metadata characteristic has been read successfully.
DsoService(QLowEnergyController *const pokitDevice, QObject *parent=nullptr)
Constructs a new Pokit service with parent.
Definition dsoservice.cpp:101
bool disableMetadataNotifications()
Disables client-side notifications of DSO metadata changes.
Definition dsoservice.cpp:244
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
Definition dsoservice.h:94
static const QBluetoothUuid serviceUuid
UUID of the "DSO" service.
Definition dsoservice.h:29
bool startDso(const Settings &settings)
Start the DSO with settings.
Definition dsoservice.cpp:170
bool setSettings(const Settings &settings)
Configures the Pokit device's DSO mode.
Definition dsoservice.cpp:146
void settingsWritten()
This signal is emitted when the Settings characteristic has been written successfully.
bool fetchSamples()
Fetch DSO samples.
Definition dsoservice.cpp:191
bool enableMetadataNotifications()
Enables client-side notifications of DSO metadata changes.
Definition dsoservice.cpp:231
DsoStatus
Values supported by the Status attribute of the Metadata characteristic.
Definition dsoservice.h:77
@ Sampling
Actively sampling.
Definition dsoservice.h:79
@ Error
An error has occurred.
Definition dsoservice.h:80
@ Done
Sampling has completed.
Definition dsoservice.h:78
bool enableReadingNotifications()
Enables client-side notifications of DSO readings.
Definition dsoservice.cpp:257
bool readMetadataCharacteristic()
Reads the DSO service's Metadata characteristic.
Definition dsoservice.cpp:133
Mode
Values supported by the Mode attribute of the Settings and Metadata characteristics.
Definition dsoservice.h:52
@ DcVoltage
Measure DC voltage.
Definition dsoservice.h:54
@ AcCurrent
Measure AC current.
Definition dsoservice.h:57
@ AcVoltage
Measure AC voltage.
Definition dsoservice.h:55
@ Idle
Make device idle.
Definition dsoservice.h:53
@ DcCurrent
Measure DC current.
Definition dsoservice.h:56
Command
Values supported by the Command attribute of the Settings characteristic.
Definition dsoservice.h:44
@ ResendData
Resend the last acquired data.
Definition dsoservice.h:48
@ FreeRunning
Run free, without waiting for edge triggers.
Definition dsoservice.h:45
@ RisingEdgeTrigger
Trigger on a rising edge.
Definition dsoservice.h:46
@ FallingEdgeTrigger
Trigger on a falling edge.
Definition dsoservice.h:47
bool disableReadingNotifications()
Disables client-side notifications of DSO readings.
Definition dsoservice.cpp:268
void samplesRead(const DsoService::Samples &samples)
This signal is emitted when the Reading characteristic has been notified.
Metadata metadata() const
Returns the most recent value of the DSO service's Metadata characteristic.
Definition dsoservice.cpp:213
Declares the PokitProduct enumeration, and related helper functions.
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 DSO service.
Definition dsoservice.h:32
static const QBluetoothUuid metadata
UUID of the DSO service's Metadata characterstic.
Definition dsoservice.h:37
static const QBluetoothUuid reading
UUID of the DSO service's Reading characterstic.
Definition dsoservice.h:40
static const QBluetoothUuid settings
UUID of the DSO service's Settings characterstic.
Definition dsoservice.h:34
Attributes included in the Settings characterstic.
Definition dsoservice.h:67
Mode mode
Desired operation mode.
Definition dsoservice.h:70
quint8 range
Desired range, eg settings.range = +PokitPro::CurrentRange::AutoRange;.
Definition dsoservice.h:71
Command command
Custom operation request.
Definition dsoservice.h:68
quint32 samplingWindow
Desired sampling window in microseconds.
Definition dsoservice.h:72
float triggerLevel
Trigger threshold level in Volts or Amps, depending on mode.
Definition dsoservice.h:69
quint16 numberOfSamples
Desired number of samples to acquire.
Definition dsoservice.h:73