dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
telemetrymanager.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef TELEMETRYMANAGER_H
29 #define TELEMETRYMANAGER_H
30 
31 #include "uavtalk_global.h"
34 #include "telemetrymonitor.h"
35 #include "telemetry.h"
36 #include "uavtalk.h"
38 #include <QIODevice>
39 #include <QObject>
40 
41 class UAVTALK_EXPORT TelemetryManager : public QObject
42 {
43  Q_OBJECT
44  Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged)
45 
46 public:
49 
50  void start(QIODevice *dev);
51  void stop();
52  bool isConnected() const { return m_connected; }
53  QByteArray *downloadFile(quint32 fileId, quint32 maxSize,
54  std::function<void(quint32)>progressCb);
55 
56 signals:
57  void connected();
58  void disconnected();
59  void connectedChanged(bool);
60 
61 private slots:
62  void onConnect();
63  void onDisconnect();
64 
65 private:
66  UAVObjectManager *objMngr;
67  UAVTalk *utalk;
68  Telemetry *telemetry;
69  TelemetryMonitor *telemetryMon;
70 
71  bool m_connected;
72  QHash<quint16, QList<TelemetryMonitor::objStruc>> sessions;
74 };
75 
76 #endif // TELEMETRYMANAGER_H
function[]
bool isConnected() const