7#include <QtCore/QString>
35 QIODevice*
device()
const override;
39 void waitWritten(QDeadlineTimer& deadline)
override;
47 static constexpr std::chrono::milliseconds CANCELLATION_POLL{50};
48 static constexpr std::chrono::milliseconds OPEN_RETRY{500};
50 QString _errorDetail()
const;
51 bool _inputBudgetExhausted()
const;
54 std::chrono::milliseconds _openTimeout;
55 std::unique_ptr<QSerialPort> _serial;
56 bool _inputOverflow =
false;
57 qint64 _acceptedTotal = 0;
58 qint64 _writtenTotal = 0;
const GPSCancelToken & cancelToken() const
Provides functions to access serial ports.
bool setBaudrate(unsigned baudrate) override
void waitWritten(QDeadlineTimer &deadline) override
Waits for queued bytes to drain. May expire deadline to end the write.
bool fatalError() const override
True once the port hits an error the receive loop should stop retrying past.
GPSOpenResult open() override
GPSReadResult readFailure() const override
Describes a failed link; by default, a closed connection with the device's error.
qint64 confirmedWritten(int accepted, qint64 drained) override
~SerialGPSTransport() override
bool waitReadable(QDeadlineTimer deadline) override
Waits until input is buffered. Input reported buffered is delivered even after the link fails.
bool readUnavailable() const override
Whether read() fails without waiting; by default, when there is no device.
static constexpr std::chrono::milliseconds OPEN_TIMEOUT
How long open() keeps retrying a device it is not permitted to open yet.
QIODevice * device() const override
The open device, or null before open().