9#ifndef QTPOKIT_STATUSSERVICE_H
10#define QTPOKIT_STATUSSERVICE_H
14#include <QBluetoothAddress>
15#include <QBluetoothUuid>
16#include <QVersionNumber>
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") };
83 MultimeterDcVoltage = 1,
84 MultimeterAcVoltage = 2,
85 MultimeterDcCurrent = 3,
86 MultimeterAcCurrent = 4,
87 MultimeterResistance = 5,
89 MultimeterContinuity = 7,
90 MultimeterTemperature = 8,
92 LoggerModeSampling = 10,
147 bool readDeviceCharacteristics();
148 bool readStatusCharacteristic();
149 bool readNameCharacteristic();
150 bool readTorchCharacteristic();
151 bool readButtonPressCharacteristic();
154 DeviceCharacteristics deviceCharacteristics()
const;
157 Status status()
const;
158 bool enableStatusNotifications();
159 bool disableStatusNotifications();
163 bool setDeviceName(
const QString &name);
169 std::optional<TorchStatus> torchStatus()
const;
170 bool setTorchStatus(
const TorchStatus status);
171 bool enableTorchStatusNotifications();
172 bool disableTorchStatusNotifications();
175 std::optional<ButtonStatus> buttonPress()
const;
176 bool enableButtonPressedNotifications();
177 bool disableButtonPressedNotifications();
197 friend class TestStatusService;
Declares the AbstractPokitService class.
The AbstractPokitService class provides a common base for Pokit services classes.
virtual bool readCharacteristics()=0
Read all characteristics.
The StatusServicePrivate class provides private implementation for StatusService.
The StatusService class accesses the Pokit Status service of Pokit devices.
ButtonStatus
Values supported by the second byte of the attribute of the (undocumented) Button Press characteristi...
void torchStatusRead(const TorchStatus &status)
This signal is emitted when the Torch characteristic has been read successfully.
void buttonPressRead(const quint8 &unknown, const ButtonStatus status)
This signal is emitted when the Button Press characteristic has been read successfully.
BatteryStatus
Values supported by the Battery Status attribute of the Status characteristic.
void deviceLedFlashed()
This signal is emitted when device's LED has flashed in response to a write of the Flash LED characte...
DeviceStatus
Values supported by the Status attribute of the Status characteristic.
SwitchPosition
Values supported by the (undocumented) Switch Position attribute of the Status characteristic.
void deviceNameRead(const QString &deviceName)
This signal is emitted when the Device Name characteristic has been read successfully.
void deviceStatusRead(const StatusService::Status &status)
This signal is emitted when the Status characteristic has been read successfully.
void deviceCharacteristicsRead(const StatusService::DeviceCharacteristics &characteristics)
This signal is emitted when the Device Characteristics characteristic has been read successfully.
TorchStatus
Values supported by the single byte of the attribute of the (undocumented) Torch characteristic.
void deviceNameWritten()
This signal is emitted when the Device Name characteristic has been written successfully.
void torchStatusWritten()
This signal is emitted when the Torch characteristic has been written successfully.
ChargingStatus
Values supported by the (undocumented) Charging Statue attribute of the Status characteristic.
QTPOKIT_EXPORT QString toString(const PokitProduct product)
Returns product as user-friendly string.
#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 Pokit Status service.
Attributes included in the Device Characteristics characterstic.
quint16 maximumCurrent
Device's maximum input current.
quint16 maximumSamplingRate
Device's maximum sampling rate.
quint16 samplingBufferSize
Device's sampling buffer size.
quint16 maximumVoltage
Device's maximum input voltage.
quint16 capabilityMask
Reserved.
QBluetoothAddress macAddress
Device's MAC address.
quint16 maximumResistance
Device's maximum input resistance.
QVersionNumber firmwareVersion
Device's major and minor firmware version.
UUIDs of the Pokit Status service.
Attributes included in the Status characterstic.
float batteryVoltage
Current battery voltage level.
std::optional< ChargingStatus > chargingStatus
Current charging status, if supported by the device.
DeviceStatus deviceStatus
Current Pokit device status.
BatteryStatus batteryStatus
Logical interpretation the battery voltage level.
std::optional< SwitchPosition > switchPosition
Position of the Pokit device's physical mode switch.