diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 64f818d97..bdc239117 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -367,8 +367,12 @@ jobs: copy /v /b src\cli\dokit.exe /b portable cd portable windeployqt --compiler-runtime --release --verbose 2 dokit.exe ${{ matrix.dll }} - :: dokit.exe --version + :: dokit.exe --version # This would hang the job, because Qt will show a message box. working-directory: ${{ runner.temp }} + - name: Check portable version + if: matrix.arch != 'arm64' + shell: bash + run: '"$RUNNER_TEMP/portable/dokit.exe" --version' - name: Setup artifacts shell: bash run: echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" >> $GITHUB_ENV diff --git a/src/lib/genericaccessservice.cpp b/src/lib/genericaccessservice.cpp index 5a4d36245..adc6e02cc 100644 --- a/src/lib/genericaccessservice.cpp +++ b/src/lib/genericaccessservice.cpp @@ -18,7 +18,7 @@ * * \cond internal * \pokitApi Pokit API 1.00 (and 0.02) claims support for the `Generic Access` (`0x1800`) service, - * however the neither the Pokit Meter, nor the Pokit Pro eport any support for this service, but + * however the neither the Pokit Meter, nor the Pokit Pro report any support for this service, but * both report support for an undocumented `Generic Attribute` (`0x1801`) service instead. * \endcond */ diff --git a/src/lib/statusservice.cpp b/src/lib/statusservice.cpp index 572880535..aef146136 100644 --- a/src/lib/statusservice.cpp +++ b/src/lib/statusservice.cpp @@ -637,14 +637,11 @@ StatusService::Status StatusServicePrivate::parseStatus(const QByteArray &value) /*! * \pokitApi 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. + * 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. */ - if (!checkSize(QLatin1String("Status"), value, 5, 6)) { + if (!checkSize(QLatin1String("Status"), value, 5, 8)) { return status; } @@ -656,7 +653,7 @@ StatusService::Status StatusServicePrivate::parseStatus(const QByteArray &value) if (value.size() >= 7) { // Switch Position - as yet, undocumented by Pokit Innovations. status.switchPosition = static_cast(value.at(6)); } - if (value.size() >= 8) { // Switch Position - as yet, undocumented by Pokit Innovations. + if (value.size() >= 8) { // Charging Status - as yet, undocumented by Pokit Innovations. status.chargingStatus = static_cast(value.at(7)); } qCDebug(lc).noquote() << tr("Device status: %1 (%2)") @@ -702,7 +699,7 @@ std::optional StatusServicePrivate::parseButtonPres * \pokitApi 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]`. * - * \pokitApi Note, we can actually write to the Button Press characteristic too. If we do, the whatever + * \pokitApi 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. */ diff --git a/test/unit/lib/teststatusservice.cpp b/test/unit/lib/teststatusservice.cpp index dc1f21e17..3e6234fda 100644 --- a/test/unit/lib/teststatusservice.cpp +++ b/test/unit/lib/teststatusservice.cpp @@ -534,7 +534,7 @@ void TestStatusService::parseStatus() QTest::ignoreMessage(QtWarningMsg, QRegularExpression(QStringLiteral( R"(^Status requires \d+ byte/s, but only \d+ present: 0x[a-zA-Z0-9,]*$)"))); } - if (value.size() > 6) { + if (value.size() > 8) { QTest::ignoreMessage(QtWarningMsg, QRegularExpression(QStringLiteral( R"(^Status has \d+ extraneous byte/s: 0x[a-zA-Z0-9,]*$)"))); }