9#ifndef QTPOKIT_DSOSERVICE_H
10#define QTPOKIT_DSOSERVICE_H
15#include <QBluetoothAddress>
16#include <QBluetoothUuid>
17#include <QVersionNumber>
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.
The DsoServicePrivate class provides private implementation for DsoService.
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.
bool disableMetadataNotifications()
Disables client-side notifications of DSO metadata changes.
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
static const QBluetoothUuid serviceUuid
UUID of the "DSO" service.
bool startDso(const Settings &settings)
Start the DSO with settings.
bool setSettings(const Settings &settings)
Configures the Pokit device's DSO mode.
void settingsWritten()
This signal is emitted when the Settings characteristic has been written successfully.
bool fetchSamples()
Fetch DSO samples.
bool enableMetadataNotifications()
Enables client-side notifications of DSO metadata changes.
DsoStatus
Values supported by the Status attribute of the Metadata characteristic.
@ Sampling
Actively sampling.
@ Error
An error has occurred.
@ Done
Sampling has completed.
bool enableReadingNotifications()
Enables client-side notifications of DSO readings.
bool readMetadataCharacteristic()
Reads the DSO 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.
@ DcCurrent
Measure DC current.
Command
Values supported by the Command attribute of the Settings characteristic.
@ ResendData
Resend the last acquired data.
@ FreeRunning
Run free, without waiting for edge triggers.
@ RisingEdgeTrigger
Trigger on a rising edge.
@ FallingEdgeTrigger
Trigger on a falling edge.
bool disableReadingNotifications()
Disables client-side notifications of DSO readings.
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.
Declares the PokitProduct enumeration, and related helper functions.
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 DSO service.
static const QBluetoothUuid metadata
UUID of the DSO service's Metadata characterstic.
static const QBluetoothUuid reading
UUID of the DSO service's Reading characterstic.
static const QBluetoothUuid settings
UUID of the DSO service's Settings characterstic.
Attributes included in the Settings characterstic.
Mode mode
Desired operation mode.
quint8 range
Desired range, eg settings.range = +PokitPro::CurrentRange::AutoRange;.
Command command
Custom operation request.
quint32 samplingWindow
Desired sampling window in microseconds.
float triggerLevel
Trigger threshold level in Volts or Amps, depending on mode.
quint16 numberOfSamples
Desired number of samples to acquire.