Skip to content
Permalink
Browse files

Fix connection to GPS using serial port

It was impossible to start GPS live tracking when connecting via a serial port rather than gpsd.

QSerialPort in Qt5 does not support Unbuffered open mode and will just fail (around line 545):
https://github.com/qt/qtserialport/blob/5.11/src/serialport/qserialport.cpp

This was not a problem in QGIS 2.x / Qt4 where we used QextSerialPort which did not have such test.

(cherry picked from commit 9d22389)
  • Loading branch information
wonder-sk authored and nyalldawson committed Sep 14, 2018
1 parent 4eb407c commit 118b8a003f7ee560c5c7175715b8885d85b5e0e0
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/gps/qgsgpsdetector.cpp
@@ -175,7 +175,7 @@ void QgsGpsDetector::advance()
serial->setDataBits( DATA_8 );
serial->setStopBits( STOP_1 );

if ( serial->open( QIODevice::ReadOnly | QIODevice::Unbuffered ) )
if ( serial->open( QIODevice::ReadOnly ) )
{
mConn = new QgsNmeaConnection( serial );
}

0 comments on commit 118b8a0

Please sign in to comment.
You can’t perform that action at this time.