9#ifndef QTPOKIT_STATUSSERVICE_H
10#define QTPOKIT_STATUSSERVICE_H
14#include <QBluetoothAddress>
15#include <QBluetoothUuid>
16#include <QVersionNumber>
20QTPOKIT_BEGIN_NAMESPACE
22class StatusServicePrivate;
32 static inline const QBluetoothUuid pokitMeter { QStringLiteral(
"57d3a771-267c-4394-8872-78223e92aec4") };
35 static inline const QBluetoothUuid pokitPro { QStringLiteral(
"57d3a771-267c-4394-8872-78223e92aec5") };
41 static inline const QBluetoothUuid deviceCharacteristics { QStringLiteral(
"6974f5e5-0e54-45c3-97dd-29e4b5fb0849") };
44 static inline const QBluetoothUuid status { QStringLiteral(
"3dba36e1-6120-4706-8dfd-ed9c16e569b6") };
47 static inline const QBluetoothUuid name { QStringLiteral(
"7f0375de-077e-4555-8f78-800494509cc3") };
50 static inline const QBluetoothUuid flashLed { QStringLiteral(
"ec9bb1f3-05a9-4277-8dd0-60a7896f0d6e") };
53 static inline const QBluetoothUuid torch { QStringLiteral(
"aaf3f6d5-43d4-4a83-9510-dff3d858d4cc") };
56 static inline const QBluetoothUuid buttonPress { QStringLiteral(
"8fe5b5a9-b5b4-4a7b-8ff2-87224b970f89") };
76 MultimeterDcVoltage = 1,
77 MultimeterAcVoltage = 2,
78 MultimeterDcCurrent = 3,
79 MultimeterAcCurrent = 4,
80 MultimeterResistance = 5,
82 MultimeterContinuity = 7,
83 MultimeterTemperature = 8,
85 LoggerModeSampling = 10,
140 bool readDeviceCharacteristics();
141 bool readStatusCharacteristic();
142 bool readNameCharacteristic();
143 bool readTorchCharacteristic();
144 bool readButtonPressCharacteristic();
147 DeviceCharacteristics deviceCharacteristics()
const;
150 Status status()
const;
151 bool enableStatusNotifications();
152 bool disableStatusNotifications();
156 bool setDeviceName(
const QString &name);
162 std::optional<TorchStatus> torchStatus()
const;
163 bool setTorchStatus(
const TorchStatus status);
164 bool enableTorchStatusNotifications();
165 bool disableTorchStatusNotifications();
168 std::optional<ButtonStatus> buttonPress()
const;
169 bool enableButtonPressedNotifications();
170 bool disableButtonPressedNotifications();
190 friend class TestStatusService;
Declares the AbstractPokitService class.
The AbstractPokitService class provides a common base for Pokit services classes.
Definition abstractpokitservice.h:27
virtual bool readCharacteristics()=0
Read all characteristics.
The StatusService class accesses the Pokit Status service of Pokit devices.
Definition statusservice.h:25
ButtonStatus
Values supported by the second byte of the attribute of the (undocumented) Button Press characteristi...
Definition statusservice.h:129
BatteryStatus
Values supported by the Battery Status attribute of the Status characteristic.
Definition statusservice.h:90
void torchStatusWritten()
This signal is emitted when the Torch characteristic has been written successfully.
void deviceNameWritten()
This signal is emitted when the Device Name characteristic has been written successfully.
void deviceStatusRead(const StatusService::Status &status)
This signal is emitted when the Status characteristic has been read successfully.
DeviceStatus
Values supported by the Status attribute of the Status characteristic.
Definition statusservice.h:74
SwitchPosition
Values supported by the (undocumented) Switch Position attribute of the Status characteristic.
Definition statusservice.h:97
void deviceLedFlashed()
This signal is emitted when device's LED has flashed in response to a write of the Flash LED characte...
void buttonPressRead(const quint8 &unknown, const ButtonStatus status)
This signal is emitted when the Button Press characteristic has been read successfully.
void torchStatusRead(const TorchStatus &status)
This signal is emitted when the Torch characteristic has been read successfully.
TorchStatus
Values supported by the single byte of the attribute of the (undocumented) Torch characteristic.
Definition statusservice.h:122
void deviceCharacteristicsRead(const StatusService::DeviceCharacteristics &characteristics)
This signal is emitted when the Device Characteristics characteristic has been read successfully.
void deviceNameRead(const QString &deviceName)
This signal is emitted when the Device Name characteristic has been read successfully.
ChargingStatus
Values supported by the (undocumented) Charging Statue attribute of the Status characteristic.
Definition statusservice.h:105
QTPOKIT_EXPORT QString toString(const PokitProduct product)
Returns product as user-friendly string.
Definition pokitproducts.cpp:26
Characteristics available via the Pokit Status service.
Definition statusservice.h:39
Attributes included in the Device Characteristics characterstic.
Definition statusservice.h:62
quint16 maximumCurrent
Device's maximum input current.
Definition statusservice.h:65
quint16 maximumSamplingRate
Device's maximum sampling rate.
Definition statusservice.h:67
quint16 samplingBufferSize
Device's sampling buffer size.
Definition statusservice.h:68
quint16 maximumVoltage
Device's maximum input voltage.
Definition statusservice.h:64
quint16 capabilityMask
Reserved.
Definition statusservice.h:69
QBluetoothAddress macAddress
Device's MAC address.
Definition statusservice.h:70
quint16 maximumResistance
Device's maximum input resistance.
Definition statusservice.h:66
QVersionNumber firmwareVersion
Device's major and minor firmware version.
Definition statusservice.h:63
UUIDs of the Pokit Status service.
Definition statusservice.h:30
Attributes included in the Status characterstic.
Definition statusservice.h:113
float batteryVoltage
Current battery voltage level.
Definition statusservice.h:115
std::optional< ChargingStatus > chargingStatus
Current charging status, if supported by the device.
Definition statusservice.h:118
DeviceStatus deviceStatus
Current Pokit device status.
Definition statusservice.h:114
BatteryStatus batteryStatus
Logical interpretation the battery voltage level.
Definition statusservice.h:116
std::optional< SwitchPosition > switchPosition
Position of the Pokit device's physical mode switch.
Definition statusservice.h:117