QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSReceiverConnector.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <functional>
5
6#include <QtCore/QString>
7#include <QtCore/QStringList>
8
9#include "GPSReceiverConfig.h"
11#include "GPSReceiverWorker.h"
12#include "RTKSettings.h"
13#ifndef QGC_NO_SERIAL_LINK
14#include "SerialPortManager.h"
15#endif
16
58
62
63#ifndef QGC_NO_SERIAL_LINK
66#endif
67
71{
72public:
73 virtual bool hasReceiver() const = 0;
74 virtual void setConnectionError(const QString& message) = 0;
75 virtual void endConnection(bool clearError) = 0;
76 virtual bool connectTcp(const QString& host, quint16 port, GPSType type, bool allowPersistentChanges) = 0;
77 virtual bool connectUdp(quint16 port, GPSType type) = 0;
78#ifndef QGC_NO_SERIAL_LINK
79 virtual bool connectSerial(const QString& device, GPSType type, uint32_t baudRate, bool allowPersistentChanges,
80 GPSSerialClaim claim) = 0;
82 virtual bool serialPortAvailable(const QString& device) const = 0;
85 virtual QStringList rtkReceiverPorts() const = 0;
87 virtual GPSSerialClaim claimSerialPort(const QString& device) = 0;
88#endif
89
90protected:
92};
std::function< GPSReceiverWorker *(GPSReceiverWorker::TransportFactory, GPSType, const GPSReceiverConfig &, QObject *)> GPSReceiverWorkerFactory
Creates a receiver session's worker; tests inject scripted workers.
SerialPortManager::ReservationPtr GPSSerialClaim
Holds a serial device for one receiver session until the last copy is released.
constexpr int GPS_AUTOMATIC_MANUFACTURER
GPSTypes::GPSType GPSType
Definition GPSType.h:25
virtual QStringList rtkReceiverPorts() const =0
virtual GPSSerialClaim claimSerialPort(const QString &device)=0
Claims the device until the last copy is released; empty when it is in use.
virtual bool hasReceiver() const =0
virtual bool serialPortAvailable(const QString &device) const =0
The device is plugged in and not in its bootloader.
virtual void setConnectionError(const QString &message)=0
~GPSReceiverConnector()=default
virtual bool connectSerial(const QString &device, GPSType type, uint32_t baudRate, bool allowPersistentChanges, GPSSerialClaim claim)=0
virtual void endConnection(bool clearError)=0
virtual bool connectUdp(quint16 port, GPSType type)=0
virtual bool connectTcp(const QString &host, quint16 port, GPSType type, bool allowPersistentChanges)=0
std::function< std::unique_ptr< GPSTransport >(GPSCancelToken)> TransportFactory
Consumed on the worker thread, so transport construction, I/O and destruction share that thread.
ConnectionType
Persisted values of connectionType. The storage type keeps any saved value a valid enum value.
Definition RTKSettings.h:44
ReceiverRole
Persisted values of receiverRole. The storage type keeps any saved value a valid enum value.
Definition RTKSettings.h:36
std::shared_ptr< const Reservation > ReservationPtr
Configuration used only by the RTK base-station role.
The receiver configuration the application's settings binding supplies as values.
RTKSettings::ReceiverRole receiverRole
Only a configured base is written to by QGroundControl.
bool autoConnect
Keep the saved receiver connected, or discover a configured base on USB when no device is saved.
bool sameConnection(const GPSReceiverConfiguration &other) const
RTKSettings::ConnectionType effectiveConnectionType() const
The connection this configuration uses; builds without serial links connect a serial selection over T...
int baseReceiverManufacturer
A GPSReceiverDescriptor manufacturer, or GPS_AUTOMATIC_MANUFACTURER to detect the family on every con...
bool forwardReceiverRtcm
A passive receiver's RTCM output becomes a correction source for vehicles.
RTKSettings::ConnectionType connectionType
bool operator==(const GPSReceiverConfiguration &) const =default