9#ifndef QTPOKIT_DSOSERVICE_H
10#define QTPOKIT_DSOSERVICE_H
14#include <QBluetoothAddress>
15#include <QBluetoothUuid>
16#include <QVersionNumber>
18QTPOKIT_BEGIN_NAMESPACE
20class DsoServicePrivate;
37 RisingEdgeTrigger = 1,
38 FallingEdgeTrigger = 2,
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);
116 bool readMetadataCharacteristic();
119 bool setSettings(
const Settings &settings);
120 bool startDso(
const Settings &settings);
125 bool enableMetadataNotifications();
126 bool disableMetadataNotifications();
129 bool enableReadingNotifications();
130 bool disableReadingNotifications();
145 friend class TestDsoService;
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 DsoService class accesses the Pokit Status service of Pokit devices.
Definition: dsoservice.h:23
static const QBluetoothUuid serviceUuid
UUID of the "DSO" service.
Definition: dsoservice.h:27
VoltageRange
Values supported by the Range attribute of the Settings and Metadata characteristics,...
Definition: dsoservice.h:51
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
Definition: dsoservice.h:110
void metadataRead(const DsoService::Metadata &meta)
This signal is emitted when the Metadata characteristic has been read successfully.
void samplesRead(const DsoService::Samples &samples)
This signal is emitted when the Reading characteristic has been notified.
DsoStatus
Values supported by the Status attribute of the Metadata characteristic.
Definition: dsoservice.h:94
Mode
Values supported by the Mode attribute of the Settings and Metadata characteristics.
Definition: dsoservice.h:42
void settingsWritten()
This signal is emitted when the Settings characteristic has been written successfully.
Command
Values supported by the Command attribute of the Settings characteristic.
Definition: dsoservice.h:35
CurrentRange
Values supported by the Range attribute of the Settings and Metadata characteristics,...
Definition: dsoservice.h:64
QTPOKIT_EXPORT bool operator>=(const DsoService::Range &lhs, const DsoService::Range &rhs)
Returns true if lhs is numerically greater than or equal to rhs, false otherwise.
Definition: dsoservice.cpp:247
QTPOKIT_EXPORT bool operator<=(const DsoService::Range &lhs, const DsoService::Range &rhs)
Returns true if lhs is numerically less than or equal to rhs, false otherwise.
Definition: dsoservice.cpp:240
QTPOKIT_EXPORT bool operator<(const DsoService::Range &lhs, const DsoService::Range &rhs)
Returns true if lhs is numerically less than rhs, false otherwise.
Definition: dsoservice.cpp:226
QTPOKIT_EXPORT bool operator!=(const DsoService::Range &lhs, const DsoService::Range &rhs)
Returns true if lhs is numerically not-equal to rhs, false otherwise.
Definition: dsoservice.cpp:219
QTPOKIT_EXPORT bool operator>(const DsoService::Range &lhs, const DsoService::Range &rhs)
Returns true if lhs is numerically greater than rhs, false otherwise.
Definition: dsoservice.cpp:233
QTPOKIT_EXPORT bool operator==(const DsoService::Range &lhs, const DsoService::Range &rhs)
Returns true if lhs is numerically equal to rhs, false otherwise.
Definition: dsoservice.cpp:212
Characteristics available via the DSO service.
Definition: dsoservice.h:29
static const QBluetoothUuid metadata
UUID of the DSO service's Metadata characterstic.
Definition: dsoservice.h:31
static const QBluetoothUuid reading
UUID of the DSO service's Reading characterstic.
Definition: dsoservice.h:32
static const QBluetoothUuid settings
UUID of the DSO service's Settings characterstic.
Definition: dsoservice.h:30
Attributes included in the Settings characterstic.
Definition: dsoservice.h:85
Mode mode
Desired operation mode.
Definition: dsoservice.h:88
Range range
Desired range.
Definition: dsoservice.h:89
Command command
Custom operation request.
Definition: dsoservice.h:86
quint32 samplingWindow
Desired sampling window in microseconds.
Definition: dsoservice.h:90
float triggerLevel
Trigger threshold level in Volts or Amps, depending on mode.
Definition: dsoservice.h:87
quint16 numberOfSamples
Desired number of samples to acquire.
Definition: dsoservice.h:91
Values supported by the Range attribute of the Settings and Metadata characteristics.
Definition: dsoservice.h:76
VoltageRange voltageRange
Range when in AC/DC voltage mode.
Definition: dsoservice.h:77
CurrentRange currentRange
Range when in AC/DC current mode.
Definition: dsoservice.h:78