QGIS API Documentation  2.99.0-Master (9fdd060)
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();
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
Abstract base class for connection to a GPS device.
Class to detect the GPS port.