Line data Source code
1 : // SPDX-FileCopyrightText: 2022-2024 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 1065 : 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 900 : connect(discoveryAgent, &PokitDiscoveryAgent::pokitDeviceUpdated,
29 60 : this, &ScanCommand::deviceUpdated);
30 : #endif
31 1065 : }
32 :
33 80 : QStringList ScanCommand::requiredOptions(const QCommandLineParser &parser) const
34 : {
35 80 : return AbstractCommand::requiredOptions(parser);
36 : }
37 :
38 40 : QStringList ScanCommand::supportedOptions(const QCommandLineParser &parser) const
39 : {
40 80 : return AbstractCommand::supportedOptions(parser) + QStringList{
41 76 : };
42 : }
43 :
44 : /// \copydoc AbstractCommand::processOptions
45 20 : QStringList ScanCommand::processOptions(const QCommandLineParser &parser)
46 : {
47 20 : 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 20 : bool ScanCommand::start()
59 : {
60 : Q_ASSERT(discoveryAgent);
61 48 : qCInfo(lc).noquote() << tr("Scanning for Pokit devices...");
62 20 : discoveryAgent->start();
63 20 : return true;
64 : }
65 :
66 : /*!
67 : * Handles discovered Pokit devices, writing \a info to stdout.
68 : */
69 1575 : void ScanCommand::deviceDiscovered(const QBluetoothDeviceInfo &info)
70 : {
71 1575 : switch (format) {
72 : case OutputFormat::Csv:
73 840 : for (; showCsvHeader; showCsvHeader = false) {
74 423 : std::cout << qUtf8Printable(tr("uuid,address,name,major_class,minor_class,signal_strength\n"));
75 : }
76 1605 : 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 525 : break;
80 525 : case OutputFormat::Json:
81 1050 : std::cout << QJsonDocument(toJson(info)).toJson().toStdString();
82 525 : break;
83 525 : case OutputFormat::Text:
84 1605 : std::cout << qUtf8Printable(tr("%1 %2 %3 %4\n").arg(info.deviceUuid().toString(),
85 : info.address().toString(), info.name()).arg(info.rssi()));
86 525 : break;
87 : }
88 1575 : }
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 675 : void ScanCommand::deviceUpdated(const QBluetoothDeviceInfo &info,
95 : const QBluetoothDeviceInfo::Fields updatedFields)
96 : {
97 : Q_UNUSED(updatedFields)
98 675 : deviceDiscovered(info);
99 675 : }
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 20 : void ScanCommand::deviceDiscoveryFinished()
107 : {
108 22 : qCDebug(lc).noquote() << tr("Finished scanning for Pokit devices.");
109 20 : QCoreApplication::quit();
110 20 : }
111 :
112 : /*!
113 : * Returns \a info as a JSON object.
114 : */
115 680 : QJsonObject ScanCommand::toJson(const QBluetoothDeviceInfo &info)
116 : {
117 680 : if (!info.isValid()) {
118 55 : return QJsonObject();
119 : }
120 : QJsonObject json{
121 1250 : { QLatin1String("address"), info.address().toString() },
122 1250 : { QLatin1String("name"), info.name() },
123 625 : { QLatin1String("isCached"), info.isCached() },
124 625 : { QLatin1String("majorDeviceClass"), info.majorDeviceClass() },
125 1070 : { QLatin1String("majorDeviceClass"), toJson(info.majorDeviceClass()) },
126 1070 : { QLatin1String("minorDeviceClass"), toJson(info.majorDeviceClass(), info.minorDeviceClass()) },
127 625 : { QLatin1String("signalStrength"), info.rssi() },
128 8580 : };
129 625 : if (info.coreConfigurations() != QBluetoothDeviceInfo::UnknownCoreConfiguration) {
130 106 : json.insert(QLatin1String("coreConfiguration"), toJson(info.coreConfigurations()));
131 : }
132 625 : if (!info.deviceUuid().isNull()) {
133 548 : json.insert(QLatin1String("deviceUuid"), info.deviceUuid().toString());
134 : }
135 : #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) // Added in Qt 5.12.
136 525 : if (!info.manufacturerData().isEmpty()) {
137 69 : json.insert(QLatin1String("manufacturerData"), toJson(info.manufacturerData()));
138 : }
139 : #endif
140 625 : if (info.serviceClasses() != QBluetoothDeviceInfo::NoService) {
141 125 : json.insert(QLatin1String("serviceClasses"), toJson(info.serviceClasses()));
142 : }
143 835 : if (!info.serviceUuids().isEmpty()) {
144 29 : json.insert(QLatin1String("serviceUuids"), toJson(info.serviceUuids()));
145 : }
146 355 : return json;
147 2425 : }
148 :
149 : /*!
150 : * Returns \a configuration as a JSON array of strings.
151 : */
152 155 : QJsonArray ScanCommand::toJson(const QBluetoothDeviceInfo::CoreConfigurations &configurations)
153 : {
154 155 : QJsonArray array;
155 : #define DOKIT_INTERNAL_IF_SET_THEN_APPEND(flag) \
156 : if (configurations.testFlag(QBluetoothDeviceInfo::flag)) \
157 : array.append(QLatin1String(#flag))
158 62 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(UnknownCoreConfiguration);
159 127 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(LowEnergyCoreConfiguration);
160 76 : 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 155 : 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 905 : QJsonValue ScanCommand::toJson(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass)
173 : {
174 905 : const QString string = toString(majorClass);
175 1810 : 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 2465 : QJsonValue ScanCommand::toJson(const QBluetoothDeviceInfo::MajorDeviceClass &majorClass, const quint8 minorClass)
186 : {
187 2465 : const QString string = toString(majorClass, minorClass);
188 4930 : return (string.isNull() ? QJsonValue(minorClass) : QJsonValue(string));
189 1703 : }
190 :
191 : /*!
192 : * Returns \a classes as a JSON array of strings.
193 : */
194 290 : QJsonArray ScanCommand::toJson(const QBluetoothDeviceInfo::ServiceClasses &classes)
195 : {
196 290 : QJsonArray array;
197 : #define DOKIT_INTERNAL_IF_SET_THEN_APPEND(flag) \
198 : if (classes.testFlag(QBluetoothDeviceInfo::flag)) \
199 : array.append(QLatin1String(#flag))
200 178 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(PositioningService);
201 178 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(NetworkingService);
202 178 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(RenderingService);
203 164 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(CapturingService);
204 164 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(ObjectTransferService);
205 164 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(AudioService);
206 164 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(TelephonyService);
207 164 : DOKIT_INTERNAL_IF_SET_THEN_APPEND(InformationService);
208 : #undef DOKIT_INTERNAL_IF_SET_THEN_APPEND
209 290 : return array;
210 0 : }
211 :
212 : /*!
213 : * Returns \a uuids as a JSON array.
214 : */
215 120 : QJsonArray ScanCommand::toJson(const QList<QBluetoothUuid> &uuids)
216 : {
217 120 : QJsonArray array;
218 360 : for (const QBluetoothUuid &uuid: uuids) {
219 240 : array.append(uuid.toString());
220 : }
221 120 : 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 105 : QJsonObject ScanCommand::toJson(const QMultiHash<quint16, QByteArray> &data)
229 : {
230 105 : QJsonObject object;
231 105 : QList<quint16> keys = data.uniqueKeys();
232 42 : std::sort(keys.begin(), keys.end());
233 255 : 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 150 : QList<QByteArray> values = data.values(key);
238 60 : std::reverse(values.begin(), values.end());
239 150 : QJsonArray array;
240 363 : for (const QByteArray &value: values) {
241 426 : array.append(QLatin1String(value.toBase64()));
242 : }
243 210 : object.insert(QString::number(key), array);
244 150 : }
245 105 : 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 1710 : 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 1710 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(MiscellaneousDevice);
261 60 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ComputerDevice);
262 60 : 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 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkDevice); // Added in Qt 5.13.
267 : #endif
268 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(AudioVideoDevice);
269 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(PeripheralDevice);
270 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImagingDevice);
271 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableDevice);
272 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyDevice);
273 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthDevice);
274 66 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedDevice);
275 : #undef DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN
276 132 : 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 4830 : 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 4830 : switch (majorClass) {
293 790 : case QBluetoothDeviceInfo::MiscellaneousDevice:
294 790 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedMiscellaneous);
295 : break;
296 460 : case QBluetoothDeviceInfo::ComputerDevice:
297 460 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedComputer);
298 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(DesktopComputer);
299 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ServerComputer);
300 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(LaptopComputer);
301 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HandheldClamShellComputer);
302 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HandheldComputer);
303 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableComputer);
304 : break;
305 420 : case QBluetoothDeviceInfo::PhoneDevice:
306 420 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedPhone);
307 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CellularPhone);
308 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CordlessPhone);
309 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(SmartPhone);
310 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WiredModemOrVoiceGatewayPhone);
311 12 : 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 234 : case QBluetoothDeviceInfo::NetworkDevice: // Added in Qt 5.13.
317 : #endif
318 360 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkFullService);
319 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorOne);
320 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorTwo);
321 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorThree);
322 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorFour);
323 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorFive);
324 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkLoadFactorSix);
325 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(NetworkNoService);
326 : break;
327 720 : case QBluetoothDeviceInfo::AudioVideoDevice:
328 720 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedAudioVideoDevice);
329 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableHeadsetDevice);
330 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HandsFreeDevice);
331 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Microphone);
332 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Loudspeaker);
333 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Headphones);
334 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(PortableAudioDevice);
335 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CarAudio);
336 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(SetTopBox);
337 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HiFiAudioDevice);
338 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Vcr);
339 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoCamera);
340 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(Camcorder);
341 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoMonitor);
342 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoDisplayAndLoudspeaker);
343 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(VideoConferencing);
344 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(GamingDevice);
345 : break;
346 440 : case QBluetoothDeviceInfo::PeripheralDevice:
347 440 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedPeripheral);
348 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(KeyboardPeripheral);
349 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(PointingDevicePeripheral);
350 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(KeyboardWithPointingDevicePeripheral);
351 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(JoystickPeripheral);
352 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(GamepadPeripheral);
353 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(RemoteControlPeripheral);
354 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(SensingDevicePeripheral);
355 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(DigitizerTabletPeripheral);
356 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(CardReaderPeripheral);
357 : break;
358 240 : case QBluetoothDeviceInfo::ImagingDevice:
359 240 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedImagingDevice);
360 200 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImageDisplay);
361 160 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImageCamera);
362 120 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImageScanner);
363 80 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ImagePrinter);
364 : break;
365 280 : case QBluetoothDeviceInfo::WearableDevice:
366 280 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedWearableDevice);
367 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableWristWatch);
368 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearablePager);
369 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableJacket);
370 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableHelmet);
371 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(WearableGlasses);
372 : break;
373 360 : case QBluetoothDeviceInfo::ToyDevice:
374 360 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedToy);
375 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyRobot);
376 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyVehicle);
377 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyDoll);
378 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyController);
379 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(ToyGame);
380 : break;
381 360 : case QBluetoothDeviceInfo::HealthDevice:
382 360 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(UncategorizedHealthDevice);
383 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthBloodPressureMonitor);
384 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthThermometer);
385 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthWeightScale);
386 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthGlucoseMeter);
387 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthPulseOximeter);
388 12 : DOKIT_INTERNAL_IF_EQUAL_THEN_RETURN(HealthDataDisplay);
389 12 : 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 1438 : 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 : }
|