diff --git a/main/int/classAbstractPokitServicePrivate.html b/main/int/classAbstractPokitServicePrivate.html index f6a3fb636..e7a86af20 100644 --- a/main/int/classAbstractPokitServicePrivate.html +++ b/main/int/classAbstractPokitServicePrivate.html @@ -680,7 +680,7 @@

References QString::arg(), PokitDevice::charcteristicToString(), QByteArray::size(), toHexString(), QUuid::toString(), QObject::tr(), and QLowEnergyCharacteristic::uuid().

-

Referenced by DataLoggerServicePrivate::characteristicRead(), DeviceInfoServicePrivate::characteristicRead(), DsoServicePrivate::characteristicRead(), GenericAccessServicePrivate::characteristicRead(), MultimeterServicePrivate::characteristicRead(), StatusServicePrivate::characteristicRead(), and createServiceObject().

+

Referenced by DataLoggerServicePrivate::characteristicRead(), DeviceInfoServicePrivate::characteristicRead(), DsoServicePrivate::characteristicRead(), GenericAccessServicePrivate::characteristicRead(), MultimeterServicePrivate::characteristicRead(), StatusServicePrivate::characteristicRead(), and createServiceObject().

Here is the call graph for this function:
@@ -742,7 +742,7 @@

References QString::arg(), PokitDevice::charcteristicToString(), QByteArray::size(), toHexString(), QUuid::toString(), QObject::tr(), and QLowEnergyCharacteristic::uuid().

-

Referenced by CalibrationServicePrivate::characteristicWritten(), DataLoggerServicePrivate::characteristicWritten(), DsoServicePrivate::characteristicWritten(), GenericAccessServicePrivate::characteristicWritten(), MultimeterServicePrivate::characteristicWritten(), StatusServicePrivate::characteristicWritten(), and createServiceObject().

+

Referenced by CalibrationServicePrivate::characteristicWritten(), DataLoggerServicePrivate::characteristicWritten(), DsoServicePrivate::characteristicWritten(), GenericAccessServicePrivate::characteristicWritten(), MultimeterServicePrivate::characteristicWritten(), StatusServicePrivate::characteristicWritten(), and createServiceObject().

Here is the call graph for this function:
@@ -829,7 +829,7 @@

References QString::arg(), QByteArray::mid(), QByteArray::size(), toHexString(), and QObject::tr().

-

Referenced by StatusServicePrivate::characteristicRead(), GenericAccessServicePrivate::parseAppearance(), StatusServicePrivate::parseButtonPress(), StatusServicePrivate::parseDeviceCharacteristics(), DataLoggerServicePrivate::parseMetadata(), DsoServicePrivate::parseMetadata(), MultimeterServicePrivate::parseReading(), StatusServicePrivate::parseStatus(), and StatusServicePrivate::parseTorchStatus().

+

Referenced by StatusServicePrivate::characteristicRead(), GenericAccessServicePrivate::parseAppearance(), StatusServicePrivate::parseButtonPress(), StatusServicePrivate::parseDeviceCharacteristics(), DataLoggerServicePrivate::parseMetadata(), DsoServicePrivate::parseMetadata(), MultimeterServicePrivate::parseReading(), StatusServicePrivate::parseStatus(), and StatusServicePrivate::parseTorchStatus().

Here is the call graph for this function:
@@ -1424,7 +1424,7 @@

References createServiceObject(), service, serviceUuid, and QObject::tr().

-

Referenced by AbstractPokitServicePrivate(), and StatusServicePrivate::serviceDiscovered().

+

Referenced by AbstractPokitServicePrivate(), and StatusServicePrivate::serviceDiscovered().

Here is the call graph for this function:
@@ -1743,7 +1743,7 @@

Definition at line 38 of file abstractpokitservice_p.h.

-

Referenced by DataLoggerServicePrivate::characteristicChanged(), DsoServicePrivate::characteristicChanged(), MultimeterServicePrivate::characteristicChanged(), DataLoggerServicePrivate::characteristicRead(), DeviceInfoServicePrivate::characteristicRead(), DsoServicePrivate::characteristicRead(), GenericAccessServicePrivate::characteristicRead(), MultimeterServicePrivate::characteristicRead(), StatusServicePrivate::characteristicRead(), CalibrationServicePrivate::characteristicWritten(), DataLoggerServicePrivate::characteristicWritten(), DsoServicePrivate::characteristicWritten(), GenericAccessServicePrivate::characteristicWritten(), MultimeterServicePrivate::characteristicWritten(), StatusServicePrivate::characteristicWritten(), createServiceObject(), serviceDiscovered(), and StatusServicePrivate::serviceDiscovered().

+

Referenced by DataLoggerServicePrivate::characteristicChanged(), DsoServicePrivate::characteristicChanged(), MultimeterServicePrivate::characteristicChanged(), DataLoggerServicePrivate::characteristicRead(), DeviceInfoServicePrivate::characteristicRead(), DsoServicePrivate::characteristicRead(), GenericAccessServicePrivate::characteristicRead(), MultimeterServicePrivate::characteristicRead(), StatusServicePrivate::characteristicRead(), CalibrationServicePrivate::characteristicWritten(), DataLoggerServicePrivate::characteristicWritten(), DsoServicePrivate::characteristicWritten(), GenericAccessServicePrivate::characteristicWritten(), MultimeterServicePrivate::characteristicWritten(), StatusServicePrivate::characteristicWritten(), createServiceObject(), serviceDiscovered(), and StatusServicePrivate::serviceDiscovered().

diff --git a/main/int/classStatusService.html b/main/int/classStatusService.html index 3ba194f91..bc790742f 100644 --- a/main/int/classStatusService.html +++ b/main/int/classStatusService.html @@ -1049,14 +1049,14 @@

495 const QLowEnergyCharacteristic characteristic = d->getCharacteristic(CharacteristicUuids::buttonPress);

496 return (characteristic.isValid()) ? StatusServicePrivate::parseButtonPress(characteristic.value()) : std::nullopt;
497}
-
static std::optional< StatusService::ButtonStatus > parseButtonPress(const QByteArray &value)
Parses the button press value, and returns the corresponding ButtonStatus.
+
static std::optional< StatusService::ButtonStatus > parseButtonPress(const QByteArray &value)
Parses the button press value, and returns the corresponding ButtonStatus.
The StatusService class accesses the Pokit Status service of Pokit devices.
bool isValid() const const
QByteArray value() const const
static const QBluetoothUuid buttonPress
UUID of the Pokit Status service's (undocumented) Button Press characterstic.

-

References StatusService::CharacteristicUuids::buttonPress, QLowEnergyCharacteristic::isValid(), StatusServicePrivate::parseButtonPress(), and QLowEnergyCharacteristic::value().

+

References StatusService::CharacteristicUuids::buttonPress, QLowEnergyCharacteristic::isValid(), StatusServicePrivate::parseButtonPress(), and QLowEnergyCharacteristic::value().

Referenced by StatusCommand::outputDeviceStatus().

@@ -1995,9 +1995,9 @@

403 const QLowEnergyCharacteristic characteristic = d->getCharacteristic(CharacteristicUuids::torch);

404 return (characteristic.isValid()) ? StatusServicePrivate::parseTorchStatus(characteristic.value()) : std::nullopt;
405}
-
static std::optional< StatusService::TorchStatus > parseTorchStatus(const QByteArray &value)
Parses the torch status value, and returns the corresponding TorchStatus.
+
static std::optional< StatusService::TorchStatus > parseTorchStatus(const QByteArray &value)
Parses the torch status value, and returns the corresponding TorchStatus.
-

References QLowEnergyCharacteristic::isValid(), StatusServicePrivate::parseTorchStatus(), StatusService::CharacteristicUuids::torch, and QLowEnergyCharacteristic::value().

+

References QLowEnergyCharacteristic::isValid(), StatusServicePrivate::parseTorchStatus(), StatusService::CharacteristicUuids::torch, and QLowEnergyCharacteristic::value().

Referenced by StatusCommand::outputDeviceStatus().

@@ -2257,7 +2257,7 @@

References DsoModeSampling, Idle, LoggerModeSampling, MultimeterAcCurrent, MultimeterAcVoltage, MultimeterContinuity, MultimeterDcCurrent, MultimeterDcVoltage, MultimeterDiode, MultimeterResistance, MultimeterTemperature, and status().

-

Referenced by StatusServicePrivate::characteristicRead(), StatusCommand::outputDeviceStatus(), StatusServicePrivate::parseButtonPress(), StatusServicePrivate::parseStatus(), StatusServicePrivate::parseTorchStatus(), and SetTorchCommand::serviceDetailsDiscovered().

+

Referenced by StatusServicePrivate::characteristicRead(), StatusCommand::outputDeviceStatus(), StatusServicePrivate::parseButtonPress(), StatusServicePrivate::parseStatus(), StatusServicePrivate::parseTorchStatus(), and SetTorchCommand::serviceDetailsDiscovered().

Here is the call graph for this function:
diff --git a/main/int/classStatusServicePrivate.html b/main/int/classStatusServicePrivate.html index a9005905a..c1f1f2085 100644 --- a/main/int/classStatusServicePrivate.html +++ b/main/int/classStatusServicePrivate.html @@ -584,57 +584,57 @@

AbstractPokitServicePrivate.

-

Definition at line 737 of file statusservice.cpp.

-
739{
- -
741
-
742 Q_Q(StatusService);
- -
744 emit q->deviceCharacteristicsRead(parseDeviceCharacteristics(value));
-
745 return;
-
746 }
-
747
-
748 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
-
749 emit q->deviceStatusRead(parseStatus(value));
-
750 return;
-
751 }
-
752
-
753 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
-
754 const QString deviceName = QString::fromUtf8(value);
-
755 qCDebug(lc).noquote() << tr(R"(Device name: "%1")").arg(deviceName);
-
756 emit q->deviceNameRead(deviceName);
-
757 return;
-
758 }
-
759
-
760 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
-
761 qCWarning(lc).noquote() << tr("Flash LED characteristic is write-only, but somehow read")
-
762 << serviceUuid << characteristic.name() << characteristic.uuid();
-
763 return;
-
764 }
-
765
-
766 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
-
767 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
-
768 return;
-
769 }
-
770 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
-
771 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
772 emit q->torchStatusRead(status);
-
773 return;
-
774 }
-
775
- -
777 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
-
778 return;
-
779 }
-
780 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
-
781 qCDebug(lc).noquote() << tr("Button status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
782 emit q->buttonPressRead(value.at(0), status);
-
783 return;
-
784 }
-
785
-
786 qCWarning(lc).noquote() << tr("Unknown characteristic read for Status service")
-
787 << serviceUuid << characteristic.name() << characteristic.uuid();
-
788}
+

Definition at line 734 of file statusservice.cpp.

+
736{
+ +
738
+
739 Q_Q(StatusService);
+ +
741 emit q->deviceCharacteristicsRead(parseDeviceCharacteristics(value));
+
742 return;
+
743 }
+
744
+
745 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
+
746 emit q->deviceStatusRead(parseStatus(value));
+
747 return;
+
748 }
+
749
+
750 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
+
751 const QString deviceName = QString::fromUtf8(value);
+
752 qCDebug(lc).noquote() << tr(R"(Device name: "%1")").arg(deviceName);
+
753 emit q->deviceNameRead(deviceName);
+
754 return;
+
755 }
+
756
+
757 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
+
758 qCWarning(lc).noquote() << tr("Flash LED characteristic is write-only, but somehow read")
+
759 << serviceUuid << characteristic.name() << characteristic.uuid();
+
760 return;
+
761 }
+
762
+
763 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
+
764 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
+
765 return;
+
766 }
+
767 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
+
768 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
769 emit q->torchStatusRead(status);
+
770 return;
+
771 }
+
772
+ +
774 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
+
775 return;
+
776 }
+
777 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
+
778 qCDebug(lc).noquote() << tr("Button status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
779 emit q->buttonPressRead(value.at(0), status);
+
780 return;
+
781 }
+
782
+
783 qCWarning(lc).noquote() << tr("Unknown characteristic read for Status service")
+
784 << serviceUuid << characteristic.name() << characteristic.uuid();
+
785}
QBluetoothUuid serviceUuid
UUIDs for service.
virtual void characteristicRead(const QLowEnergyCharacteristic &characteristic, const QByteArray &value)
Handles QLowEnergyService::characteristicRead events.
static bool checkSize(const QString &label, const QByteArray &data, const int minSize, const int maxSize=-1, const bool failOnMax=false)
Returns false if data is smaller than minSize, otherwise returns failOnMax if data is bigger than max...
@@ -706,41 +706,41 @@

AbstractPokitServicePrivate.

-

Definition at line 794 of file statusservice.cpp.

-
796{
- -
798
-
799 Q_Q(StatusService);
- -
801 qCWarning(lc).noquote() << tr("Device Characteristics is read-only, but somehow written")
-
802 << serviceUuid << characteristic.name() << characteristic.uuid();
-
803 return;
-
804 }
-
805
-
806 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
-
807 qCWarning(lc).noquote() << tr("Status characteristic is read-only, but somehow written")
-
808 << serviceUuid << characteristic.name() << characteristic.uuid();
-
809 return;
-
810 }
-
811
-
812 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
-
813 emit q->deviceNameWritten();
-
814 return;
-
815 }
-
816
-
817 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
-
818 emit q->deviceLedFlashed();
-
819 return;
-
820 }
-
821
-
822 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
-
823 emit q->torchStatusWritten();
-
824 return;
-
825 }
-
826
-
827 qCWarning(lc).noquote() << tr("Unknown characteristic written for Status service")
-
828 << serviceUuid << characteristic.name() << characteristic.uuid();
-
829}
+

Definition at line 791 of file statusservice.cpp.

+
793{
+ +
795
+
796 Q_Q(StatusService);
+ +
798 qCWarning(lc).noquote() << tr("Device Characteristics is read-only, but somehow written")
+
799 << serviceUuid << characteristic.name() << characteristic.uuid();
+
800 return;
+
801 }
+
802
+
803 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
+
804 qCWarning(lc).noquote() << tr("Status characteristic is read-only, but somehow written")
+
805 << serviceUuid << characteristic.name() << characteristic.uuid();
+
806 return;
+
807 }
+
808
+
809 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
+
810 emit q->deviceNameWritten();
+
811 return;
+
812 }
+
813
+
814 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
+
815 emit q->deviceLedFlashed();
+
816 return;
+
817 }
+
818
+
819 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
+
820 emit q->torchStatusWritten();
+
821 return;
+
822 }
+
823
+
824 qCWarning(lc).noquote() << tr("Unknown characteristic written for Status service")
+
825 << serviceUuid << characteristic.name() << characteristic.uuid();
+
826}
virtual void characteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
Handles QLowEnergyService::characteristicWritten events.

References AbstractPokitServicePrivate::characteristicWritten(), StatusService::CharacteristicUuids::deviceCharacteristics, StatusService::CharacteristicUuids::flashLed, StatusService::CharacteristicUuids::name, QLowEnergyCharacteristic::name(), AbstractPokitServicePrivate::serviceUuid, StatusService::CharacteristicUuids::status, StatusService::CharacteristicUuids::torch, QObject::tr(), and QLowEnergyCharacteristic::uuid().

@@ -778,27 +778,27 @@

Pokit Bluetooth API errata:
The button event is the second byte, but no idea what the first byte is. In all examples I've see it's always 0x02. It appears that the Pokit Android app only ever looks at bytes[1].
-
Pokit Bluetooth API errata:
Note, we can actually write to the Button Press characteristic too. If we do, the whatever we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current button state. So still no idea what that first byte is for.
+
Pokit Bluetooth API errata:
Note, we can actually write to the Button Press characteristic too. If we do, then whatever we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current button state. So still no idea what that first byte is for.
-

Definition at line 695 of file statusservice.cpp.

-
696{
-
697 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
-
698 return std::nullopt;
-
699 }
-
700
-
701 /*!
-
702 * \pokitApi The button event is the second byte, but no idea what the first byte is. In all examples
-
703 * I've see it's always `0x02`. It appears that the Pokit Android app only ever looks at `bytes[1]`.
-
704 *
-
705 * \pokitApi Note, we can actually write to the Button Press characteristic too. If we do, the whatever
-
706 * we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current
-
707 * button state. So still no idea what that first byte is for.
-
708 */
-
709
-
710 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
-
711 qCDebug(lc).noquote() << tr("Button: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
712 return status;
-
713}
+

Definition at line 692 of file statusservice.cpp.

+
693{
+
694 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
+
695 return std::nullopt;
+
696 }
+
697
+
698 /*!
+
699 * \pokitApi The button event is the second byte, but no idea what the first byte is. In all examples
+
700 * I've see it's always `0x02`. It appears that the Pokit Android app only ever looks at `bytes[1]`.
+
701 *
+
702 * \pokitApi Note, we can actually write to the Button Press characteristic too. If we do, then whatever
+
703 * we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current
+
704 * button state. So still no idea what that first byte is for.
+
705 */
+
706
+
707 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
+
708 qCDebug(lc).noquote() << tr("Button: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
709 return status;
+
710}

References QString::arg(), QByteArray::at(), AbstractPokitServicePrivate::checkSize(), StatusService::toString(), and QObject::tr().

@@ -885,7 +885,7 @@

References AbstractPokitServicePrivate::checkSize(), QByteArray::mid(), and QObject::tr().

-

Referenced by characteristicRead(), and StatusService::deviceCharacteristics().

+

Referenced by characteristicRead(), and StatusService::deviceCharacteristics().

Here is the call graph for this function:
@@ -925,8 +925,7 @@

Pokit Bluetooth API errata:
Pokit API 0.02 says the Status characteristic is 5 bytes. API 1.00 then added an additional byte for Battery Status, for 6 bytes in total. However, Pokit Pro devices return 8 bytes here. The purpose of those last 2 bytes are not currently known. Note also, Pokit Meter only uses the first 5 bytes - ie Battery Status is not present.
-

Update: it appears that the first of those 2 extra bytes is used to indicate the phycical switch position.

+
Pokit Bluetooth API errata:
Pokit API 0.02 says the Status characteristic is 5 bytes. API 1.00 then added an additional byte for Battery Status, for 6 bytes in total. However, Pokit Pro devices return 8 bytes here. It appears that the first of those 2 extra bytes is used to indicate the physical switch position, while the other extra byte indicates the device's current charging status.

Definition at line 626 of file statusservice.cpp.

627{
@@ -942,43 +941,40 @@

637 /*!

638 * \pokitApi Pokit API 0.02 says the `Status` characteristic is 5 bytes. API 1.00 then added an
639 * additional byte for `Battery Status`, for 6 bytes in total. However, Pokit Pro devices return
-
640 * 8 bytes here. The purpose of those last 2 bytes are not currently known. Note also, Pokit
-
641 * Meter only uses the first 5 bytes - ie `Battery Status` is not present.
-
642 *
-
643 * Update: it appears that the first of those 2 extra bytes is used to indicate the phycical switch
-
644 * position.
-
645 */
-
646
-
647 if (!checkSize(QLatin1String("Status"), value, 5, 6)) {
-
648 return status;
-
649 }
-
650
-
651 status.deviceStatus = static_cast<StatusService::DeviceStatus>(value.at(0));
-
652 status.batteryVoltage = qFromLittleEndian<float>(value.mid(1,4));
-
653 if (value.size() >= 6) { // Battery Status added to Pokit API docs v1.00.
-
654 status.batteryStatus = static_cast<StatusService::BatteryStatus>(value.at(5));
+
640 * 8 bytes here. It appears that the first of those 2 extra bytes is used to indicate the physical
+
641 * switch position, while the other extra byte indicates the device's current charging status.
+
642 */
+
643
+
644 if (!checkSize(QLatin1String("Status"), value, 5, 6)) {
+
645 return status;
+
646 }
+
647
+
648 status.deviceStatus = static_cast<StatusService::DeviceStatus>(value.at(0));
+
649 status.batteryVoltage = qFromLittleEndian<float>(value.mid(1,4));
+
650 if (value.size() >= 6) { // Battery Status added to Pokit API docs v1.00.
+
651 status.batteryStatus = static_cast<StatusService::BatteryStatus>(value.at(5));
+
652 }
+
653 if (value.size() >= 7) { // Switch Position - as yet, undocumented by Pokit Innovations.
+
654 status.switchPosition = static_cast<StatusService::SwitchPosition>(value.at(6));
655 }
-
656 if (value.size() >= 7) { // Switch Position - as yet, undocumented by Pokit Innovations.
-
657 status.switchPosition = static_cast<StatusService::SwitchPosition>(value.at(6));
+
656 if (value.size() >= 8) { // Charging Status - as yet, undocumented by Pokit Innovations.
+
657 status.chargingStatus = static_cast<StatusService::ChargingStatus>(value.at(7));
658 }
-
659 if (value.size() >= 8) { // Switch Position - as yet, undocumented by Pokit Innovations.
-
660 status.chargingStatus = static_cast<StatusService::ChargingStatus>(value.at(7));
-
661 }
-
662 qCDebug(lc).noquote() << tr("Device status: %1 (%2)")
-
663 .arg((quint8)status.deviceStatus).arg(StatusService::toString(status.deviceStatus));
-
664 qCDebug(lc).noquote() << tr("Battery voltage: %1 volts").arg(status.batteryVoltage);
-
665 qCDebug(lc).noquote() << tr("Battery status: %1 (%2)")
-
666 .arg((quint8)status.batteryStatus).arg(StatusService::toString(status.batteryStatus));
-
667 if (status.switchPosition) {
-
668 qCDebug(lc).noquote() << tr("Switch position: %1 (%2)")
-
669 .arg((quint8)*status.switchPosition).arg(StatusService::toString(*status.switchPosition));
-
670 }
-
671 if (status.chargingStatus) {
-
672 qCDebug(lc).noquote() << tr("Charging status: %1 (%2)")
-
673 .arg((quint8)*status.chargingStatus).arg(StatusService::toString(*status.chargingStatus));
-
674 }
-
675 return status;
-
676}
+
659 qCDebug(lc).noquote() << tr("Device status: %1 (%2)")
+
660 .arg((quint8)status.deviceStatus).arg(StatusService::toString(status.deviceStatus));
+
661 qCDebug(lc).noquote() << tr("Battery voltage: %1 volts").arg(status.batteryVoltage);
+
662 qCDebug(lc).noquote() << tr("Battery status: %1 (%2)")
+
663 .arg((quint8)status.batteryStatus).arg(StatusService::toString(status.batteryStatus));
+
664 if (status.switchPosition) {
+
665 qCDebug(lc).noquote() << tr("Switch position: %1 (%2)")
+
666 .arg((quint8)*status.switchPosition).arg(StatusService::toString(*status.switchPosition));
+
667 }
+
668 if (status.chargingStatus) {
+
669 qCDebug(lc).noquote() << tr("Charging status: %1 (%2)")
+
670 .arg((quint8)*status.chargingStatus).arg(StatusService::toString(*status.chargingStatus));
+
671 }
+
672 return status;
+
673}
BatteryStatus
Values supported by the Battery Status attribute of the Status characteristic.
DeviceStatus
Values supported by the Status attribute of the Status characteristic.
SwitchPosition
Values supported by the (undocumented) Switch Position attribute of the Status characteristic.
@@ -989,7 +985,7 @@

References QString::arg(), QByteArray::at(), AbstractPokitServicePrivate::checkSize(), StatusService::Status::deviceStatus, QByteArray::mid(), QByteArray::size(), StatusService::toString(), and QObject::tr().

-

Referenced by characteristicRead(), and StatusService::status().

+

Referenced by characteristicRead(), and StatusService::status().

Here is the call graph for this function:
@@ -1029,16 +1025,16 @@

Definition at line 681 of file statusservice.cpp.

-
682{
-
683 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
-
684 return std::nullopt;
-
685 }
-
686
-
687 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
-
688 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
689 return status;
-
690}
+

Definition at line 678 of file statusservice.cpp.

+
679{
+
680 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
+
681 return std::nullopt;
+
682 }
+
683
+
684 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
+
685 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
686 return status;
+
687}

References QString::arg(), QByteArray::at(), AbstractPokitServicePrivate::checkSize(), StatusService::toString(), and QObject::tr().

@@ -1085,17 +1081,17 @@

AbstractPokitServicePrivate.

-

Definition at line 721 of file statusservice.cpp.

-
722{
-
723 if (newService == StatusService::ServiceUuids::pokitMeter) {
-
724 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Meter device.");
- -
726 } else if (newService == StatusService::ServiceUuids::pokitPro) {
-
727 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Pro device.");
- -
729 }
- -
731}
+

Definition at line 718 of file statusservice.cpp.

+
719{
+
720 if (newService == StatusService::ServiceUuids::pokitMeter) {
+
721 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Meter device.");
+ +
723 } else if (newService == StatusService::ServiceUuids::pokitPro) {
+
724 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Pro device.");
+ +
726 }
+ +
728}
virtual void serviceDiscovered(const QBluetoothUuid &newService)
Handles QLowEnergyController::serviceDiscovered events.
static const QBluetoothUuid pokitPro
UUID of the Pokit Pro's Pokit Status service.
static const QBluetoothUuid pokitMeter
UUID of the Pokit Meter's Pokit Status service.
diff --git a/main/int/pokit.html b/main/int/pokit.html index 283440bf8..f0f52d1ff 100644 --- a/main/int/pokit.html +++ b/main/int/pokit.html @@ -128,10 +128,10 @@
These enum values are undocumented, but easily testable with a physical Pokit Pro device. Internally, Pokit's Android app calls these: SWITCH_MODE_VOLTAGE, SWITCH_MODE_ALL and SWITCH_MODE_CURRENT.
Member StatusServicePrivate::parseButtonPress (const QByteArray &value)

The button event is the second byte, but no idea what the first byte is. In all examples I've see it's always 0x02. It appears that the Pokit Android app only ever looks at bytes[1].

-

Note, we can actually write to the Button Press characteristic too. If we do, the whatever we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current button state. So still no idea what that first byte is for.

+

Note, we can actually write to the Button Press characteristic too. If we do, then whatever we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current button state. So still no idea what that first byte is for.

Member StatusServicePrivate::parseStatus (const QByteArray &value)
-
Pokit API 0.02 says the Status characteristic is 5 bytes. API 1.00 then added an additional byte for Battery Status, for 6 bytes in total. However, Pokit Pro devices return 8 bytes here. The purpose of those last 2 bytes are not currently known. Note also, Pokit Meter only uses the first 5 bytes - ie Battery Status is not present.
+
Pokit API 0.02 says the Status characteristic is 5 bytes. API 1.00 then added an additional byte for Battery Status, for 6 bytes in total. However, Pokit Pro devices return 8 bytes here. It appears that the first of those 2 extra bytes is used to indicate the physical switch position, while the other extra byte indicates the device's current charging status.

diff --git a/main/int/statusservice_8cpp_source.html b/main/int/statusservice_8cpp_source.html index 81c9e2865..c1971a1b4 100644 --- a/main/int/statusservice_8cpp_source.html +++ b/main/int/statusservice_8cpp_source.html @@ -804,209 +804,206 @@
637 /*!
638 * \pokitApi Pokit API 0.02 says the `Status` characteristic is 5 bytes. API 1.00 then added an
639 * additional byte for `Battery Status`, for 6 bytes in total. However, Pokit Pro devices return
-
640 * 8 bytes here. The purpose of those last 2 bytes are not currently known. Note also, Pokit
-
641 * Meter only uses the first 5 bytes - ie `Battery Status` is not present.
-
642 *
-
643 * Update: it appears that the first of those 2 extra bytes is used to indicate the phycical switch
-
644 * position.
-
645 */
-
646
-
647 if (!checkSize(QLatin1String("Status"), value, 5, 6)) {
-
648 return status;
-
649 }
-
650
-
651 status.deviceStatus = static_cast<StatusService::DeviceStatus>(value.at(0));
-
652 status.batteryVoltage = qFromLittleEndian<float>(value.mid(1,4));
-
653 if (value.size() >= 6) { // Battery Status added to Pokit API docs v1.00.
-
654 status.batteryStatus = static_cast<StatusService::BatteryStatus>(value.at(5));
+
640 * 8 bytes here. It appears that the first of those 2 extra bytes is used to indicate the physical
+
641 * switch position, while the other extra byte indicates the device's current charging status.
+
642 */
+
643
+
644 if (!checkSize(QLatin1String("Status"), value, 5, 6)) {
+
645 return status;
+
646 }
+
647
+
648 status.deviceStatus = static_cast<StatusService::DeviceStatus>(value.at(0));
+
649 status.batteryVoltage = qFromLittleEndian<float>(value.mid(1,4));
+
650 if (value.size() >= 6) { // Battery Status added to Pokit API docs v1.00.
+
651 status.batteryStatus = static_cast<StatusService::BatteryStatus>(value.at(5));
+
652 }
+
653 if (value.size() >= 7) { // Switch Position - as yet, undocumented by Pokit Innovations.
+
654 status.switchPosition = static_cast<StatusService::SwitchPosition>(value.at(6));
655 }
-
656 if (value.size() >= 7) { // Switch Position - as yet, undocumented by Pokit Innovations.
-
657 status.switchPosition = static_cast<StatusService::SwitchPosition>(value.at(6));
+
656 if (value.size() >= 8) { // Charging Status - as yet, undocumented by Pokit Innovations.
+
657 status.chargingStatus = static_cast<StatusService::ChargingStatus>(value.at(7));
658 }
-
659 if (value.size() >= 8) { // Switch Position - as yet, undocumented by Pokit Innovations.
-
660 status.chargingStatus = static_cast<StatusService::ChargingStatus>(value.at(7));
-
661 }
-
662 qCDebug(lc).noquote() << tr("Device status: %1 (%2)")
-
663 .arg((quint8)status.deviceStatus).arg(StatusService::toString(status.deviceStatus));
-
664 qCDebug(lc).noquote() << tr("Battery voltage: %1 volts").arg(status.batteryVoltage);
-
665 qCDebug(lc).noquote() << tr("Battery status: %1 (%2)")
-
666 .arg((quint8)status.batteryStatus).arg(StatusService::toString(status.batteryStatus));
-
667 if (status.switchPosition) {
-
668 qCDebug(lc).noquote() << tr("Switch position: %1 (%2)")
-
669 .arg((quint8)*status.switchPosition).arg(StatusService::toString(*status.switchPosition));
-
670 }
-
671 if (status.chargingStatus) {
-
672 qCDebug(lc).noquote() << tr("Charging status: %1 (%2)")
-
673 .arg((quint8)*status.chargingStatus).arg(StatusService::toString(*status.chargingStatus));
-
674 }
-
675 return status;
-
676}
+
659 qCDebug(lc).noquote() << tr("Device status: %1 (%2)")
+
660 .arg((quint8)status.deviceStatus).arg(StatusService::toString(status.deviceStatus));
+
661 qCDebug(lc).noquote() << tr("Battery voltage: %1 volts").arg(status.batteryVoltage);
+
662 qCDebug(lc).noquote() << tr("Battery status: %1 (%2)")
+
663 .arg((quint8)status.batteryStatus).arg(StatusService::toString(status.batteryStatus));
+
664 if (status.switchPosition) {
+
665 qCDebug(lc).noquote() << tr("Switch position: %1 (%2)")
+
666 .arg((quint8)*status.switchPosition).arg(StatusService::toString(*status.switchPosition));
+
667 }
+
668 if (status.chargingStatus) {
+
669 qCDebug(lc).noquote() << tr("Charging status: %1 (%2)")
+
670 .arg((quint8)*status.chargingStatus).arg(StatusService::toString(*status.chargingStatus));
+
671 }
+
672 return status;
+
673}

-
677
-
678/*!
-
679 * Parses the torch status \a value, and returns the corresponding TorchStatus.
-
680 */
-
-
681std::optional<StatusService::TorchStatus> StatusServicePrivate::parseTorchStatus(const QByteArray &value)
-
682{
-
683 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
-
684 return std::nullopt;
-
685 }
-
686
-
687 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
-
688 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
689 return status;
-
690}
+
674
+
675/*!
+
676 * Parses the torch status \a value, and returns the corresponding TorchStatus.
+
677 */
+
+
678std::optional<StatusService::TorchStatus> StatusServicePrivate::parseTorchStatus(const QByteArray &value)
+
679{
+
680 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
+
681 return std::nullopt;
+
682 }
+
683
+
684 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
+
685 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
686 return status;
+
687}
-
691
-
692/*!
-
693 * Parses the button press \a value, and returns the corresponding ButtonStatus.
-
694 */
-
-
695std::optional<StatusService::ButtonStatus> StatusServicePrivate::parseButtonPress(const QByteArray &value)
-
696{
-
697 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
-
698 return std::nullopt;
-
699 }
-
700
-
701 /*!
-
702 * \pokitApi The button event is the second byte, but no idea what the first byte is. In all examples
-
703 * I've see it's always `0x02`. It appears that the Pokit Android app only ever looks at `bytes[1]`.
-
704 *
-
705 * \pokitApi Note, we can actually write to the Button Press characteristic too. If we do, the whatever
-
706 * we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current
-
707 * button state. So still no idea what that first byte is for.
-
708 */
-
709
-
710 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
-
711 qCDebug(lc).noquote() << tr("Button: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
712 return status;
-
713}
+
688
+
689/*!
+
690 * Parses the button press \a value, and returns the corresponding ButtonStatus.
+
691 */
+
+
692std::optional<StatusService::ButtonStatus> StatusServicePrivate::parseButtonPress(const QByteArray &value)
+
693{
+
694 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
+
695 return std::nullopt;
+
696 }
+
697
+
698 /*!
+
699 * \pokitApi The button event is the second byte, but no idea what the first byte is. In all examples
+
700 * I've see it's always `0x02`. It appears that the Pokit Android app only ever looks at `bytes[1]`.
+
701 *
+
702 * \pokitApi Note, we can actually write to the Button Press characteristic too. If we do, then whatever
+
703 * we set as the first byte persists, and (unsurprisingly) the second byte reverts to the current
+
704 * button state. So still no idea what that first byte is for.
+
705 */
+
706
+
707 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
+
708 qCDebug(lc).noquote() << tr("Button: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
709 return status;
+
710}
-
714
-
715/*!
-
716 * Handles `QLowEnergyController::serviceDiscovered` events.
-
717 *
-
718 * Here we override the base implementation to detect if we're looking at a Pokit Meter, or Pokit
-
719 * Pro device, as the two devices have very slightly different Status Service UUIDs.
-
720 */
-
- -
722{
-
723 if (newService == StatusService::ServiceUuids::pokitMeter) {
-
724 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Meter device.");
- -
726 } else if (newService == StatusService::ServiceUuids::pokitPro) {
-
727 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Pro device.");
- -
729 }
- -
731}
+
711
+
712/*!
+
713 * Handles `QLowEnergyController::serviceDiscovered` events.
+
714 *
+
715 * Here we override the base implementation to detect if we're looking at a Pokit Meter, or Pokit
+
716 * Pro device, as the two devices have very slightly different Status Service UUIDs.
+
717 */
+
+ +
719{
+
720 if (newService == StatusService::ServiceUuids::pokitMeter) {
+
721 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Meter device.");
+ +
723 } else if (newService == StatusService::ServiceUuids::pokitPro) {
+
724 qCDebug(lc).noquote() << tr("Found Status Service for a Pokit Pro device.");
+ +
726 }
+ +
728}
-
732
-
733/*!
-
734 * Implements AbstractPokitServicePrivate::characteristicRead to parse \a value, then emit a
-
735 * specialised signal, for each supported \a characteristic.
-
736 */
-
- -
738 const QByteArray &value)
-
739{
- -
741
-
742 Q_Q(StatusService);
- -
744 emit q->deviceCharacteristicsRead(parseDeviceCharacteristics(value));
-
745 return;
-
746 }
-
747
-
748 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
-
749 emit q->deviceStatusRead(parseStatus(value));
-
750 return;
-
751 }
-
752
-
753 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
-
754 const QString deviceName = QString::fromUtf8(value);
-
755 qCDebug(lc).noquote() << tr(R"(Device name: "%1")").arg(deviceName);
-
756 emit q->deviceNameRead(deviceName);
-
757 return;
-
758 }
-
759
-
760 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
-
761 qCWarning(lc).noquote() << tr("Flash LED characteristic is write-only, but somehow read")
-
762 << serviceUuid << characteristic.name() << characteristic.uuid();
-
763 return;
-
764 }
-
765
-
766 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
-
767 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
-
768 return;
-
769 }
-
770 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
-
771 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
772 emit q->torchStatusRead(status);
-
773 return;
-
774 }
-
775
- -
777 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
-
778 return;
-
779 }
-
780 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
-
781 qCDebug(lc).noquote() << tr("Button status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
-
782 emit q->buttonPressRead(value.at(0), status);
-
783 return;
-
784 }
-
785
-
786 qCWarning(lc).noquote() << tr("Unknown characteristic read for Status service")
-
787 << serviceUuid << characteristic.name() << characteristic.uuid();
-
788}
+
729
+
730/*!
+
731 * Implements AbstractPokitServicePrivate::characteristicRead to parse \a value, then emit a
+
732 * specialised signal, for each supported \a characteristic.
+
733 */
+
+ +
735 const QByteArray &value)
+
736{
+ +
738
+
739 Q_Q(StatusService);
+ +
741 emit q->deviceCharacteristicsRead(parseDeviceCharacteristics(value));
+
742 return;
+
743 }
+
744
+
745 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
+
746 emit q->deviceStatusRead(parseStatus(value));
+
747 return;
+
748 }
+
749
+
750 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
+
751 const QString deviceName = QString::fromUtf8(value);
+
752 qCDebug(lc).noquote() << tr(R"(Device name: "%1")").arg(deviceName);
+
753 emit q->deviceNameRead(deviceName);
+
754 return;
+
755 }
+
756
+
757 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
+
758 qCWarning(lc).noquote() << tr("Flash LED characteristic is write-only, but somehow read")
+
759 << serviceUuid << characteristic.name() << characteristic.uuid();
+
760 return;
+
761 }
+
762
+
763 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
+
764 if (!checkSize(QLatin1String("Torch"), value, 1, 1)) {
+
765 return;
+
766 }
+
767 const StatusService::TorchStatus status = static_cast<StatusService::TorchStatus>(value.at(0));
+
768 qCDebug(lc).noquote() << tr("Torch status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
769 emit q->torchStatusRead(status);
+
770 return;
+
771 }
+
772
+ +
774 if (!checkSize(QLatin1String("Torch"), value, 2, 2)) {
+
775 return;
+
776 }
+
777 const StatusService::ButtonStatus status = static_cast<StatusService::ButtonStatus>(value.at(1));
+
778 qCDebug(lc).noquote() << tr("Button status: %1 (%2)").arg((quint8)status).arg(StatusService::toString(status));
+
779 emit q->buttonPressRead(value.at(0), status);
+
780 return;
+
781 }
+
782
+
783 qCWarning(lc).noquote() << tr("Unknown characteristic read for Status service")
+
784 << serviceUuid << characteristic.name() << characteristic.uuid();
+
785}
-
789
-
790/*!
-
791 * Implements AbstractPokitServicePrivate::characteristicWritten to parse \a newValue, then emit a
-
792 * specialised signal, for each supported \a characteristic.
-
793 */
-
- -
795 const QByteArray &newValue)
-
796{
- -
798
-
799 Q_Q(StatusService);
- -
801 qCWarning(lc).noquote() << tr("Device Characteristics is read-only, but somehow written")
-
802 << serviceUuid << characteristic.name() << characteristic.uuid();
-
803 return;
-
804 }
-
805
-
806 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
-
807 qCWarning(lc).noquote() << tr("Status characteristic is read-only, but somehow written")
-
808 << serviceUuid << characteristic.name() << characteristic.uuid();
-
809 return;
-
810 }
-
811
-
812 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
-
813 emit q->deviceNameWritten();
-
814 return;
-
815 }
-
816
-
817 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
-
818 emit q->deviceLedFlashed();
-
819 return;
-
820 }
-
821
-
822 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
-
823 emit q->torchStatusWritten();
-
824 return;
-
825 }
-
826
-
827 qCWarning(lc).noquote() << tr("Unknown characteristic written for Status service")
-
828 << serviceUuid << characteristic.name() << characteristic.uuid();
-
829}
+
786
+
787/*!
+
788 * Implements AbstractPokitServicePrivate::characteristicWritten to parse \a newValue, then emit a
+
789 * specialised signal, for each supported \a characteristic.
+
790 */
+
+ +
792 const QByteArray &newValue)
+
793{
+ +
795
+
796 Q_Q(StatusService);
+ +
798 qCWarning(lc).noquote() << tr("Device Characteristics is read-only, but somehow written")
+
799 << serviceUuid << characteristic.name() << characteristic.uuid();
+
800 return;
+
801 }
+
802
+
803 if (characteristic.uuid() == StatusService::CharacteristicUuids::status) {
+
804 qCWarning(lc).noquote() << tr("Status characteristic is read-only, but somehow written")
+
805 << serviceUuid << characteristic.name() << characteristic.uuid();
+
806 return;
+
807 }
+
808
+
809 if (characteristic.uuid() == StatusService::CharacteristicUuids::name) {
+
810 emit q->deviceNameWritten();
+
811 return;
+
812 }
+
813
+
814 if (characteristic.uuid() == StatusService::CharacteristicUuids::flashLed) {
+
815 emit q->deviceLedFlashed();
+
816 return;
+
817 }
+
818
+
819 if (characteristic.uuid() == StatusService::CharacteristicUuids::torch) {
+
820 emit q->torchStatusWritten();
+
821 return;
+
822 }
+
823
+
824 qCWarning(lc).noquote() << tr("Unknown characteristic written for Status service")
+
825 << serviceUuid << characteristic.name() << characteristic.uuid();
+
826}
-
830
-
831/// \endcond
+
827
+
828/// \endcond
The AbstractPokitServicePrivate class provides private implementation for AbstractPokitService.
QBluetoothUuid serviceUuid
UUIDs for service.
virtual void serviceDiscovered(const QBluetoothUuid &newService)
Handles QLowEnergyController::serviceDiscovered events.
@@ -1016,14 +1013,14 @@
The AbstractPokitService class provides a common base for Pokit services classes.
QLowEnergyService * service()
Returns a non-const pointer to the internal service object, if any.
The StatusServicePrivate class provides private implementation for StatusService.
-
void characteristicRead(const QLowEnergyCharacteristic &characteristic, const QByteArray &value) override
Implements AbstractPokitServicePrivate::characteristicRead to parse value, then emit a specialised si...
+
void characteristicRead(const QLowEnergyCharacteristic &characteristic, const QByteArray &value) override
Implements AbstractPokitServicePrivate::characteristicRead to parse value, then emit a specialised si...
StatusServicePrivate(QLowEnergyController *controller, StatusService *const q)
static StatusService::Status parseStatus(const QByteArray &value)
Parses the Status value into a Status struct.
-
void serviceDiscovered(const QBluetoothUuid &newService) override
Handles QLowEnergyController::serviceDiscovered events.
+
void serviceDiscovered(const QBluetoothUuid &newService) override
Handles QLowEnergyController::serviceDiscovered events.
static StatusService::DeviceCharacteristics parseDeviceCharacteristics(const QByteArray &value)
Parses the Device Characteristics value into a DeviceCharacteristics struct.
-
void characteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue) override
Implements AbstractPokitServicePrivate::characteristicWritten to parse newValue, then emit a speciali...
-
static std::optional< StatusService::ButtonStatus > parseButtonPress(const QByteArray &value)
Parses the button press value, and returns the corresponding ButtonStatus.
-
static std::optional< StatusService::TorchStatus > parseTorchStatus(const QByteArray &value)
Parses the torch status value, and returns the corresponding TorchStatus.
+
void characteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue) override
Implements AbstractPokitServicePrivate::characteristicWritten to parse newValue, then emit a speciali...
+
static std::optional< StatusService::ButtonStatus > parseButtonPress(const QByteArray &value)
Parses the button press value, and returns the corresponding ButtonStatus.
+
static std::optional< StatusService::TorchStatus > parseTorchStatus(const QByteArray &value)
Parses the torch status value, and returns the corresponding TorchStatus.
The StatusService class accesses the Pokit Status service of Pokit devices.
DeviceCharacteristics deviceCharacteristics() const
Returns the most recent value of the Status service's Device Characteristics characteristic.
bool enableButtonPressedNotifications()
Enables client-side notifications of button presses.
diff --git a/main/int/structStatusService_1_1CharacteristicUuids.html b/main/int/structStatusService_1_1CharacteristicUuids.html index 7470e7211..3f44add13 100644 --- a/main/int/structStatusService_1_1CharacteristicUuids.html +++ b/main/int/structStatusService_1_1CharacteristicUuids.html @@ -162,7 +162,7 @@

Definition at line 56 of file statusservice.h.

56{ QStringLiteral("8fe5b5a9-b5b4-4a7b-8ff2-87224b970f89") };
-

Referenced by StatusService::buttonPress(), StatusServicePrivate::characteristicRead(), PokitDevice::charcteristicToString(), StatusService::disableButtonPressedNotifications(), StatusService::enableButtonPressedNotifications(), StatusService::readButtonPressCharacteristic(), and StatusService::readCharacteristics().

+

Referenced by StatusService::buttonPress(), StatusServicePrivate::characteristicRead(), PokitDevice::charcteristicToString(), StatusService::disableButtonPressedNotifications(), StatusService::enableButtonPressedNotifications(), StatusService::readButtonPressCharacteristic(), and StatusService::readCharacteristics().

@@ -191,7 +191,7 @@

Definition at line 41 of file statusservice.h.

41{ QStringLiteral("6974f5e5-0e54-45c3-97dd-29e4b5fb0849") };
-

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::deviceCharacteristics(), and StatusService::readDeviceCharacteristics().

+

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::deviceCharacteristics(), and StatusService::readDeviceCharacteristics().

@@ -220,7 +220,7 @@

Definition at line 50 of file statusservice.h.

50{ QStringLiteral("ec9bb1f3-05a9-4277-8dd0-60a7896f0d6e") };
-

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), and StatusService::flashLed().

+

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), and StatusService::flashLed().

@@ -249,7 +249,7 @@

Definition at line 47 of file statusservice.h.

47{ QStringLiteral("7f0375de-077e-4555-8f78-800494509cc3") };
-

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::deviceName(), StatusService::readNameCharacteristic(), and StatusService::setDeviceName().

+

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::deviceName(), StatusService::readNameCharacteristic(), and StatusService::setDeviceName().

@@ -278,7 +278,7 @@

Definition at line 44 of file statusservice.h.

44{ QStringLiteral("3dba36e1-6120-4706-8dfd-ed9c16e569b6") };
-

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::disableStatusNotifications(), StatusService::enableStatusNotifications(), StatusService::readStatusCharacteristic(), and StatusService::status().

+

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::disableStatusNotifications(), StatusService::enableStatusNotifications(), StatusService::readStatusCharacteristic(), and StatusService::status().

@@ -307,7 +307,7 @@

Definition at line 53 of file statusservice.h.

53{ QStringLiteral("aaf3f6d5-43d4-4a83-9510-dff3d858d4cc") };
-

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::disableTorchStatusNotifications(), StatusService::enableTorchStatusNotifications(), StatusService::readCharacteristics(), StatusService::readTorchCharacteristic(), StatusService::setTorchStatus(), and StatusService::torchStatus().

+

Referenced by StatusServicePrivate::characteristicRead(), StatusServicePrivate::characteristicWritten(), PokitDevice::charcteristicToString(), StatusService::disableTorchStatusNotifications(), StatusService::enableTorchStatusNotifications(), StatusService::readCharacteristics(), StatusService::readTorchCharacteristic(), StatusService::setTorchStatus(), and StatusService::torchStatus().

diff --git a/main/int/structStatusService_1_1ServiceUuids.html b/main/int/structStatusService_1_1ServiceUuids.html index f48f01010..da49c6aeb 100644 --- a/main/int/structStatusService_1_1ServiceUuids.html +++ b/main/int/structStatusService_1_1ServiceUuids.html @@ -151,7 +151,7 @@

Definition at line 32 of file statusservice.h.

32{ QStringLiteral("57d3a771-267c-4394-8872-78223e92aec4") };
-

Referenced by isPokitProduct(), pokitProduct(), StatusServicePrivate::serviceDiscovered(), and PokitDevice::serviceToString().

+

Referenced by isPokitProduct(), pokitProduct(), StatusServicePrivate::serviceDiscovered(), and PokitDevice::serviceToString().

@@ -180,7 +180,7 @@

Definition at line 35 of file statusservice.h.

35{ QStringLiteral("57d3a771-267c-4394-8872-78223e92aec5") };
-

Referenced by isPokitProduct(), pokitProduct(), StatusServicePrivate::serviceDiscovered(), and PokitDevice::serviceToString().

+

Referenced by isPokitProduct(), pokitProduct(), StatusServicePrivate::serviceDiscovered(), and PokitDevice::serviceToString().