Skip to content

Commit

Permalink
Merge branch '9-qbluetoothdevicediscoveryagentmissingpermissionserror…
Browse files Browse the repository at this point in the history
…-when-running-on-arm-macos' into 9-info-plist
  • Loading branch information
pcolby committed Aug 7, 2023
2 parents 12ef16b + 182a322 commit 3adf4df
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 42 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

## [Unreleased][]

### Added

- Warn when requesting an unsupported scan timeout ([4094bfb][])

### Changed

- Switch macOS CLI to Application Bundle ([#9][])
- Upgrade to Qt 6.6.0.

### Fixed

- Correctly exit on discovery agent errors ([7f70715][])

## [0.4.0][] (2023-06-03)

### Added
Expand Down Expand Up @@ -94,6 +103,9 @@ Thanks to [@lnxsr](https://github.com/lnxsr) for contributing to this release.
[0.1.1]: https://github.com/pcolby/dokit/releases/tag/v0.1.1
[0.1.0]: https://github.com/pcolby/dokit/releases/tag/v0.1.0

[4094bfb]: https://github.com/pcolby/dokit/commit/4094bfb218df20e1d34222b0b701fad8f57b0f2b "Warn when requesting an unsupported scan timeout"
[7f70715]: https://github.com/pcolby/dokit/commit/7f7071554cdb8170aeeaa7fb51fec26535f00321 "Correctly exit on discovery agent errors"
[#9]: https://github.com/pcolby/dokit/issues/9 "QBluetoothDeviceDiscoveryAgent::MissingPermissionsError when running on arm macos #9"
[Pokit Meter]: https://www.pokitinnovations.com/pokit-meter/
[Pokit Pro]: https://www.pokitinnovations.com/pokit-pro/
[Qt]: https://www.qt.io/
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

project(Dokit VERSION 0.4.1 LANGUAGES CXX)
project(Dokit VERSION 0.5.0 LANGUAGES CXX)

set(PROJECT_PRE_RELEASE pre)
#set(PROJECT_PRE_RELEASE rc1)
Expand Down
9 changes: 7 additions & 2 deletions src/cli/abstractcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <qtpokit/pokitdiscoveryagent.h>

#include <QLocale>
#include <QTimer>

#include <ratio>

Expand All @@ -33,8 +34,10 @@ AbstractCommand::AbstractCommand(QObject * const parent) : QObject(parent),
&PokitDiscoveryAgent::errorOccurred,
#endif
[](const PokitDiscoveryAgent::Error &error) {
qCWarning(lc).noquote() << tr("Bluetooth controller error:") << error;
QCoreApplication::exit(EXIT_FAILURE);
qCWarning(lc).noquote() << tr("Bluetooth discovery error:") << error;
QTimer::singleShot(0, QCoreApplication::instance(), [](){
QCoreApplication::exit(EXIT_FAILURE);
});
});
}

Expand Down Expand Up @@ -297,6 +300,8 @@ QStringList AbstractCommand::processOptions(const QCommandLineParser &parser)
const quint32 timeout = parseNumber<std::milli>(parser.value(QLatin1String("timeout")), QLatin1String("s"), 500);
if (timeout == 0) {
errors.append(tr("Invalid timeout: %1").arg(parser.value(QLatin1String("timeout"))));
} else if (discoveryAgent->lowEnergyDiscoveryTimeout() == -1) {
qCWarning(lc).noquote() << tr("Platform does not support Bluetooth scan timeout");
} else {
discoveryAgent->setLowEnergyDiscoveryTimeout(timeout);
qCDebug(lc).noquote() << tr("Set scan timeout to %1").arg(
Expand Down
31 changes: 18 additions & 13 deletions src/cli/i18n/en_AU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@
<context>
<name>AbstractCommand</name>
<message>
<location filename="../abstractcommand.cpp" line="36"/>
<source>Bluetooth controller error:</source>
<location filename="../abstractcommand.cpp" line="37"/>
<source>Bluetooth discovery error:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="269"/>
<location filename="../abstractcommand.cpp" line="272"/>
<source>Ignoring option: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="291"/>
<location filename="../abstractcommand.cpp" line="294"/>
<source>Unknown output format: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="299"/>
<location filename="../abstractcommand.cpp" line="302"/>
<source>Invalid timeout: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="302"/>
<location filename="../abstractcommand.cpp" line="304"/>
<source>Platform does not support Bluetooth scan timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="307"/>
<source>Set scan timeout to %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="311"/>
<location filename="../abstractcommand.cpp" line="316"/>
<source>Missing required option: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -301,37 +306,37 @@ success
<context>
<name>LoggerFetchCommand</name>
<message>
<location filename="../loggerfetchcommand.cpp" line="53"/>
<location filename="../loggerfetchcommand.cpp" line="62"/>
<source>Fetching logger samples...</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../loggerfetchcommand.cpp" line="74"/>
<location filename="../loggerfetchcommand.cpp" line="83"/>
<source>Fetching %Ln logger sample/s...</source>
<translation>
<numerusform>Fetching %Ln logger sample...</numerusform>
<numerusform>Fetching %Ln logger samples...</numerusform>
</translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="90"/>
<location filename="../loggerfetchcommand.cpp" line="99"/>
<source>No known unit for mode %1 &quot;%2&quot;.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="102"/>
<location filename="../loggerfetchcommand.cpp" line="111"/>
<source>timestamp,value,unit,range
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="120"/>
<location filename="../loggerfetchcommand.cpp" line="129"/>
<source>%1 %2 %3
</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../loggerfetchcommand.cpp" line="127"/>
<location filename="../loggerfetchcommand.cpp" line="136"/>
<source>Finished fetching %Ln sample/s (with %L1 remaining).</source>
<translation>
<numerusform>Finished fetching %Ln sample (with %L1 remaining).</numerusform>
Expand Down
31 changes: 18 additions & 13 deletions src/cli/i18n/en_GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@
<context>
<name>AbstractCommand</name>
<message>
<location filename="../abstractcommand.cpp" line="36"/>
<source>Bluetooth controller error:</source>
<location filename="../abstractcommand.cpp" line="37"/>
<source>Bluetooth discovery error:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="269"/>
<location filename="../abstractcommand.cpp" line="272"/>
<source>Ignoring option: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="291"/>
<location filename="../abstractcommand.cpp" line="294"/>
<source>Unknown output format: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="299"/>
<location filename="../abstractcommand.cpp" line="302"/>
<source>Invalid timeout: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="302"/>
<location filename="../abstractcommand.cpp" line="304"/>
<source>Platform does not support Bluetooth scan timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="307"/>
<source>Set scan timeout to %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="311"/>
<location filename="../abstractcommand.cpp" line="316"/>
<source>Missing required option: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -301,37 +306,37 @@ success
<context>
<name>LoggerFetchCommand</name>
<message>
<location filename="../loggerfetchcommand.cpp" line="53"/>
<location filename="../loggerfetchcommand.cpp" line="62"/>
<source>Fetching logger samples...</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../loggerfetchcommand.cpp" line="74"/>
<location filename="../loggerfetchcommand.cpp" line="83"/>
<source>Fetching %Ln logger sample/s...</source>
<translation>
<numerusform>Fetching %Ln logger sample...</numerusform>
<numerusform>Fetching %Ln logger samples...</numerusform>
</translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="90"/>
<location filename="../loggerfetchcommand.cpp" line="99"/>
<source>No known unit for mode %1 &quot;%2&quot;.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="102"/>
<location filename="../loggerfetchcommand.cpp" line="111"/>
<source>timestamp,value,unit,range
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="120"/>
<location filename="../loggerfetchcommand.cpp" line="129"/>
<source>%1 %2 %3
</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../loggerfetchcommand.cpp" line="127"/>
<location filename="../loggerfetchcommand.cpp" line="136"/>
<source>Finished fetching %Ln sample/s (with %L1 remaining).</source>
<translation>
<numerusform>Finished fetching %Ln sample (with %L1 remaining).</numerusform>
Expand Down
31 changes: 18 additions & 13 deletions src/cli/i18n/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@
<context>
<name>AbstractCommand</name>
<message>
<location filename="../abstractcommand.cpp" line="36"/>
<source>Bluetooth controller error:</source>
<location filename="../abstractcommand.cpp" line="37"/>
<source>Bluetooth discovery error:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="269"/>
<location filename="../abstractcommand.cpp" line="272"/>
<source>Ignoring option: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="291"/>
<location filename="../abstractcommand.cpp" line="294"/>
<source>Unknown output format: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="299"/>
<location filename="../abstractcommand.cpp" line="302"/>
<source>Invalid timeout: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="302"/>
<location filename="../abstractcommand.cpp" line="304"/>
<source>Platform does not support Bluetooth scan timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="307"/>
<source>Set scan timeout to %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../abstractcommand.cpp" line="311"/>
<location filename="../abstractcommand.cpp" line="316"/>
<source>Missing required option: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -301,37 +306,37 @@ success
<context>
<name>LoggerFetchCommand</name>
<message>
<location filename="../loggerfetchcommand.cpp" line="53"/>
<location filename="../loggerfetchcommand.cpp" line="62"/>
<source>Fetching logger samples...</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../loggerfetchcommand.cpp" line="74"/>
<location filename="../loggerfetchcommand.cpp" line="83"/>
<source>Fetching %Ln logger sample/s...</source>
<translation>
<numerusform>Fetching %Ln logger sample...</numerusform>
<numerusform>Fetching %Ln logger samples...</numerusform>
</translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="90"/>
<location filename="../loggerfetchcommand.cpp" line="99"/>
<source>No known unit for mode %1 &quot;%2&quot;.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="102"/>
<location filename="../loggerfetchcommand.cpp" line="111"/>
<source>timestamp,value,unit,range
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../loggerfetchcommand.cpp" line="120"/>
<location filename="../loggerfetchcommand.cpp" line="129"/>
<source>%1 %2 %3
</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../loggerfetchcommand.cpp" line="127"/>
<location filename="../loggerfetchcommand.cpp" line="136"/>
<source>Finished fetching %Ln sample/s (with %L1 remaining).</source>
<translation>
<numerusform>Finished fetching %Ln sample (with %L1 remaining).</numerusform>
Expand Down

0 comments on commit 3adf4df

Please sign in to comment.