Line data Source code
1 : // SPDX-FileCopyrightText: 2022-2023 Paul Colby <git@colby.id.au>
2 : // SPDX-License-Identifier: LGPL-3.0-or-later
3 :
4 : #include "scancommand.h"
5 :
6 : #include <qtpokit/pokitdiscoveryagent.h>
7 :
8 : #include <QBluetoothUuid>
9 : #include <QJsonArray>
10 : #include <QJsonDocument>
11 : #include <QJsonObject>
12 :
13 : #include <iostream>
14 :
15 : /*!
16 : * \class ScanCommand
17 : *
18 : * The ScanCommand class implements the `scan` CLI command, by scanning for nearby Pokit Bluetooth
19 : * devices. When devices are found, they are logged to stdout in the chosen format.
20 : */
21 :
22 : /*!
23 : * Construct a new ScanCommand object with \a parent.
24 : */
25 945 : ScanCommand::ScanCommand(QObject * const parent) : AbstractCommand(parent)
26 : {
27 : #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) // Required signal, and Fields, added in Qt 5.12.
28 780 : connect(discoveryAgent, &PokitDiscoveryAgent::pokitDeviceUpdated,
29 : this, &ScanCommand::deviceUpdated);
30 : #endif
31 945 : }
32 :
33 72 : QStringList ScanCommand::requiredOptions(const QCommandLineParser &parser) const
34 : {
35 72 : return AbstractCommand::requiredOptions(parser);
36 : }
37 :
38 36 : QStringList ScanCommand::supportedOptions(const QCommandLineParser &parser) const
39 : {
40 72 : return AbstractCommand::supportedOptions(parser) + QStringList{
41 70 : };
42 : }
43 :
44 : /// \copydoc AbstractCommand::processOptions
45 18 : QStringList ScanCommand::processOptions(const QCommandLineParser &parser)
46 : {
47 18 : QStringList errors = AbstractCommand::processOptions(parser);
48 : if (!errors.isEmpty()) {
49 : return errors;
50 : }
51 :
52 : return errors;
53 : }
54 :
55 : /*!
56 : * Begins scanning for Pokit devices.
57 : */
58 18 : bool ScanCommand::start()
59 : {
60 : Q_ASSERT(discoveryAgent);
61 40 : qCInfo(lc).noquote() << tr("Scanning for Pokit devices...");
62 18 : discoveryAgent->start();
63 18 : return true;
64 : }
65 :
66 : /*!
67 : * Handles discovered Pokit devices, writing \a info to stdout.
68 : */
69 1395 : void ScanCommand::deviceDiscovered(const QBluetoothDeviceInfo &info)
70 : {
71 1395 : switch (format) {
72 : case OutputFormat::Csv:
73 744 : for (; showCsvHeader; showCsvHeader = false) {
74 351 : std::cout << qUtf8Printable(tr("uuid,address,name,major_class,minor_class,signal_strength\n"));
75 : }
76 1365 : std::cout << qUtf8Printable(QString::fromLatin1("%1,%2,%3,%4,%5,%6\n").arg(info.deviceUuid().toString(),
77 : info.address().toString(), escapeCsvField(info.name()), toString(info.majorDeviceClass()),
78 : toString(info.majorDeviceClass(), info.minorDeviceClass())).arg(info.rssi()));
79 465 : break;
80 465 : case OutputFormat::Json:
81 930 : std::cout << QJsonDocument(toJson(info)).toJson().toStdString();
82 465 : break;
83 465 : case OutputFormat::Text:
84 1365 : std::cout << qUtf8Printable(tr("%1 %2 %3 %4\n").arg(info.deviceUuid().toString(),
85 : info.address().toString(), info.name()).arg(info.rssi()));
86 465 : break;
87 : }
88 1395 : }
89 :
90 : /*!
91 : * Handles updated Pokit devices, writing \a info to stdout. Currently \a updatedFields us unused.
92 : */
93 : #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) // Required signal, and Fields, added in Qt 5.12.
94 585 : void ScanCommand::deviceUpdated(const QBluetoothDeviceInfo &info,
95 : const QBluetoothDeviceInfo::Fields updatedFields)
96 : {
97 : Q_UNUSED(updatedFields)
98 585 : deviceDiscovered(info);
99 585 : }
100 : #endif
101 :
102 : /*!
103 : * Handles the completion of device discovery. In this override we simply exit, as the scan command
104 : * is nothing more than logging of discovered devices.
105 : */
106 18 : void ScanCommand::deviceDiscoveryFinished()
107 : {
108 18 : qCDebug(lc).noquote() << tr("Finished scanning for Pokit devices.");
109 18 : QCoreApplication::quit();
110 18 : }
111 :
112 : /*!
113 : * Returns \a info as a JSON object.
114 : */
115 604 : QJsonObject ScanCommand::toJson(const QBluetoothDeviceInfo &info)
116 : {
117 604 : if (!info.isValid()) {
118 49 : return QJsonObject();
119 : }
120 : QJsonObject json{
121 1110 : { QLatin1String("address"), info.address().toString() },
122 1110 : { QLatin1String("name"), info.name() },
123 555 : { QLatin1String("isCached"), info.isCached() },
124 555 : { QLatin1String("majorDeviceClass"), info.majorDeviceClass() },
125 930 : { QLatin1String("majorDeviceClass"), toJson(info.majorDeviceClass()) },
126 930 : { QLatin1String("minorDeviceClass"), toJson(info.majorDeviceClass(), info.minorDeviceClass()) },
127 555 : { QLatin1String("signalStrength"), info.rssi() },
128 7670 : };
129 555 : if (info.coreConfigurations() != QBluetoothDeviceInfo::UnknownCoreConfiguration) {
130 98 : json.insert(QLatin1String("coreConfiguration"), toJson(info.coreConfigurations()));
131 : }
132 555 : if (!info.deviceUuid().isNull()) {
133 504 : json.insert(QLatin1String("deviceUuid"), info.deviceUuid().toString());
134 : }
135 : #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) // Added in Qt 5.12.
136 455 : if (!info.manufacturerData().isEmpty()) {
137 63 : json.insert(QLatin1String("manufacturerData"), toJson(info.manufacturerData()));
138 : }
139 : #endif
140 555 : if (info.serviceClasses() != QBluetoothDeviceInfo::NoService) {
141 115 : json.insert(QLatin1String("serviceClasses"), toJson(info.serviceClasses()));
142 : }
143 695 : if (!info.serviceUuids().isEmpty()) {
144 27 : json.insert(QLatin1String("serviceUuids"), toJson(info.serviceUuids()));
145 : }
146 285 : return json;
147 2355 : }
148 :
149 : /*!
150 : * Returns \a configuration as a JSON array of strings.
151 : */
152 139 : QJsonArray ScanCommand::toJson(const QBluetoothDeviceInfo::CoreConfigurations &configurations)
153 : {
154 139 : QJsonArray array;
155 : #define DOKIT_INTERNAL_IF_SET_THEN_APPEND(flag) \
156 : if (configurations.testFlag(QBluetoothDeviceInfo::flag)) \
157 : array.append(QLatin1String(#flag))
158 46 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(UnknownCoreConfiguration);
159 111 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(LowEnergyCoreConfiguration);
160 60 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(BaseRateCoreConfiguration);
161 : //DOKIT_INTERNAL_IF_SET_THEN_APPEND(BaseRateAndLowEnergyCoreConfiguration); // Combination flag.
162 : #undef DOKIT_INTERNAL_IF_SET_THEN_APPEND
163 139 : return array;
164 0 : }
165 :
166 : /*!
167 : * Returns \a majorClass as a JSON value. This is equivalent to toString, except that if toString
168 : * does not recognise \a majorClass, then \a majorClass is returned as a JSON number (not a string).
169 : *
170 : * \see toString(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass)
171 : */
172 807 : QJsonValue ScanCommand::toJson(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass)
173 : {
174 807 : const QString string = toString(majorClass);
175 1614 : return (string.isNull() ? QJsonValue(majorClass) : QJsonValue(string));
176 611 : }
177 :
178 : /*!
179 : * Returns \a minorClass as a JSON value. This is equivalent to toString, except that if toString
180 : * does not recognise \a minorClass as a sub-class of \a majorClass, then \a minorClass is returned
181 : * as a JSON number (not a string).
182 : *
183 : * \see toString(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass, const quint8 minorClass)
184 : */
185 2211 : QJsonValue ScanCommand::toJson(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass, const quint8 minorClass)
186 : {
187 2211 : const QString string = toString(majorClass, minorClass);
188 4422 : return (string.isNull() ? QJsonValue(minorClass) : QJsonValue(string));
189 1703 : }
190 :
191 : /*!
192 : * Returns \a classes as a JSON array of strings.
193 : */
194 260 : QJsonArray ScanCommand::toJson(const QBluetoothDeviceInfo::ServiceClasses &classes)
195 : {
196 260 : QJsonArray array;
197 : #define DOKIT_INTERNAL_IF_SET_THEN_APPEND(flag) \
198 : if (classes.testFlag(QBluetoothDeviceInfo::flag)) \
199 : array.append(QLatin1String(#flag))
200 148 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(PositioningService);
201 148 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(NetworkingService);
202 148 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(RenderingService);
203 134 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(CapturingService);
204 134 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(ObjectTransferService);
205 134 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(AudioService);
206 134 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(TelephonyService);
207 134 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(InformationService);
208 : #undef DOKIT_INTERNAL_IF_SET_THEN_APPEND
209 260 : return array;
210 0 : }
211 :
212 : /*!
213 : * Returns \a uuids as a JSON array.
214 : */
215 108 : QJsonArray ScanCommand::toJson(const QList<QBluetoothUuid> &uuids)
216 : {
217 108 : QJsonArray array;
218 324 : for (const QBluetoothUuid &uuid: uuids) {
219 216 : array.append(uuid.toString());
220 : }
221 108 : return array;
222 0 : }
223 :
224 : /*!
225 : * Returns Bluetooth manufacturer \a data as a JSON object that maps the manufacturer IDs (unsigned
226 : * integers as strings) to arrays of one or more values.
227 : */
228 91 : QJsonObject ScanCommand::toJson(const QMultiHash<quint16, QByteArray> &data)
229 : {
230 91 : QJsonObject object;
231 91 : QList<quint16> keys = data.uniqueKeys();
232 28 : std::sort(keys.begin(), keys.end());
233 221 : for (const quint16 key: keys) {
234 : // Convert the key's values to a JSON array, reversing the order, because QMultiHash
235 : // guarantees that the values are orderer "from the most recently inserted to the least
236 : // recently inserted", which is the oppoosit of what we want.
237 130 : QList<QByteArray> values = data.values(key);
238 40 : std::reverse(values.begin(), values.end());
239 130 : QJsonArray array;
240 313 : for (const QByteArray &value: values) {
241 366 : array.append(QLatin1String(value.toBase64()));
242 : }
243 170 : object.insert(QString::number(key), array);
244 130 : }
245 91 : return object;
246 63 : }
247 :
248 : /*!
249 : * Returns \a majorClass as a human-readable string, or a null QString if \a majorClass is not
250 : * recognised.
251 : *
252 : * For example, if \a majorClass is \c QBluetoothDeviceInfo::ToyDevice, then the string `ToyDevice`
253 : * is returned.
254 : */
255 1524 : QString ScanCommand::toString(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass)
256 : {
257 : #define DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(value) \
258 : if (majorClass == QBluetoothDeviceInfo::value) \
259 : return QLatin1String(#value)
260 1524 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(MiscellaneousDevice);
261 40 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ComputerDevice);
262 40 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(PhoneDevice);
263 : #if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
264 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(LANAccessDevice); // Deprecated since Qt 5.13.
265 : #else
266 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkDevice); // Added in Qt 5.13.
267 : #endif
268 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(AudioVideoDevice);
269 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(PeripheralDevice);
270 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImagingDevice);
271 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableDevice);
272 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyDevice);
273 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthDevice);
274 44 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedDevice);
275 : #undef DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN
276 108 : qCDebug(lc).noquote() << tr("Unknown major class %1.").arg(majorClass);
277 : return QString(); // Null QString indicates unknown minor class.
278 : }
279 :
280 : /*!
281 : * Returns \a minorClass as a human-readable string, or a null QString if \a minorClass is not
282 : * recognised as a sub-class of \a majorClass.
283 : *
284 : * For example, if \a majorClass is \c QBluetoothDeviceInfo::ToyDevice, and \a minorClass is
285 : * \c QBluetoothDeviceInfo::ToyRobot, then the string `ToyRobot` is returned.
286 : */
287 4332 : QString ScanCommand::toString(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass, const quint8 minorClass)
288 : {
289 : #define DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(value) \
290 : if (minorClass == QBluetoothDeviceInfo::value) \
291 : return QLatin1String(#value)
292 4332 : switch (majorClass) {
293 702 : case QBluetoothDeviceInfo::MiscellaneousDevice:
294 702 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedMiscellaneous);
295 : break;
296 412 : case QBluetoothDeviceInfo::ComputerDevice:
297 412 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedComputer);
298 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(DesktopComputer);
299 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ServerComputer);
300 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(LaptopComputer);
301 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HandheldClamShellComputer);
302 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HandheldComputer);
303 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableComputer);
304 : break;
305 376 : case QBluetoothDeviceInfo::PhoneDevice:
306 376 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedPhone);
307 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CellularPhone);
308 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CordlessPhone);
309 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(SmartPhone);
310 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WiredModemOrVoiceGatewayPhone);
311 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CommonIsdnAccessPhone);
312 : break;
313 : #if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
314 126 : case QBluetoothDeviceInfo::LANAccessDevice: // Deprecated since Qt 5.13.
315 : #else
316 198 : case QBluetoothDeviceInfo::NetworkDevice: // Added in Qt 5.13.
317 : #endif
318 324 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkFullService);
319 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorOne);
320 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorTwo);
321 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorThree);
322 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorFour);
323 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorFive);
324 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorSix);
325 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkNoService);
326 : break;
327 648 : case QBluetoothDeviceInfo::AudioVideoDevice:
328 648 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedAudioVideoDevice);
329 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableHeadsetDevice);
330 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HandsFreeDevice);
331 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Microphone);
332 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Loudspeaker);
333 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Headphones);
334 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(PortableAudioDevice);
335 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CarAudio);
336 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(SetTopBox);
337 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HiFiAudioDevice);
338 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Vcr);
339 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoCamera);
340 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Camcorder);
341 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoMonitor);
342 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoDisplayAndLoudspeaker);
343 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoConferencing);
344 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(GamingDevice);
345 : break;
346 396 : case QBluetoothDeviceInfo::PeripheralDevice:
347 396 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedPeripheral);
348 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(KeyboardPeripheral);
349 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(PointingDevicePeripheral);
350 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(KeyboardWithPointingDevicePeripheral);
351 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(JoystickPeripheral);
352 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(GamepadPeripheral);
353 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(RemoteControlPeripheral);
354 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(SensingDevicePeripheral);
355 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(DigitizerTabletPeripheral);
356 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CardReaderPeripheral);
357 : break;
358 216 : case QBluetoothDeviceInfo::ImagingDevice:
359 216 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedImagingDevice);
360 180 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImageDisplay);
361 144 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImageCamera);
362 108 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImageScanner);
363 72 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImagePrinter);
364 : break;
365 252 : case QBluetoothDeviceInfo::WearableDevice:
366 252 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedWearableDevice);
367 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableWristWatch);
368 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearablePager);
369 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableJacket);
370 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableHelmet);
371 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableGlasses);
372 : break;
373 324 : case QBluetoothDeviceInfo::ToyDevice:
374 324 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedToy);
375 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyRobot);
376 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyVehicle);
377 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyDoll);
378 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyController);
379 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyGame);
380 : break;
381 324 : case QBluetoothDeviceInfo::HealthDevice:
382 324 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedHealthDevice);
383 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthBloodPressureMonitor);
384 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthThermometer);
385 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthWeightScale);
386 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthGlucoseMeter);
387 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthPulseOximeter);
388 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthDataDisplay);
389 8 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthStepCounter);
390 : break;
391 : case QBluetoothDeviceInfo::UncategorizedDevice:
392 : // There are no minor classes defined (in Qt) for uncategorized devices.
393 : break;
394 : }
395 : #undef DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN
396 1162 : qCDebug(lc).noquote() << tr("Unknown minor class %1 for major class %2.")
397 0 : .arg(minorClass).arg(majorClass);
398 : return QString(); // Null QString indicates unknown minor class.
399 : }
|