QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsgpsdetector.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgpsdetector.h - description
3  -------------------
4  begin : January 13th, 2009
5  copyright : (C) 2009 by Juergen E. Fischer
6  email : jef at norbit dot de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSGPSDETECTOR_H
19 #define QGSGPSDETECTOR_H
20 
21 #include <QObject>
22 #include <QList>
23 #include <QPair>
24 
25 #include "qgis_core.h"
26 #include "qextserialport.h"
27 
28 class QgsGpsConnection;
29 struct QgsGpsInformation;
30 
35 class CORE_EXPORT QgsGpsDetector : public QObject
36 {
37  Q_OBJECT
38  public:
39  QgsGpsDetector( const QString &portName );
40  ~QgsGpsDetector() override;
41 
42  static QList< QPair<QString, QString> > availablePorts();
43 
44  public slots:
45  void advance();
46  void detected( const QgsGpsInformation & );
47  void connDestroyed( QObject * );
48 
49  signals:
50  void detected( QgsGpsConnection * );
51  void detectionFailed();
52 
53  private:
54  int mPortIndex;
55  int mBaudIndex;
56  QList< QPair< QString, QString > > mPortList;
57  QList<BaudRateType> mBaudList;
58 
59  QgsGpsConnection *mConn = nullptr;
60 };
61 
62 #endif // QGSGPSDETECTOR_H
Class to detect the GPS port.
Abstract base class for connection to a GPS device.