blob: d9ad510c859c09e7210d7f94620106d1c16a2f05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "qdbdevicetracker.h"
#include "qdbmessagetracker.h"
namespace Qdb::Internal {
class DeviceDetector : public QObject
{
Q_OBJECT
public:
DeviceDetector();
~DeviceDetector();
void start();
void stop();
private:
void handleDeviceEvent(QdbDeviceTracker::DeviceEventType eventType,
const QMap<QString, QString> &info);
void handleTrackerError(const QString &errorMessage);
void resetDevices();
enum State { Inactive, WaitingForDeviceUpdates };
State m_state = Inactive;
QdbDeviceTracker m_deviceTracker;
QdbMessageTracker m_messageTracker;
};
} // Qdb::Internal
|