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.
  • Loading branch information
wonder-sk committed Sep 11, 2018
1 parent 0865297 commit 9d2238907088ff71164b0ea36cd802064da570bf
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/gps/qgsgpsdetector.cpp
@@ -124,7 +124,7 @@ void QgsGpsDetector::advance()
serial->setDataBits( QSerialPort::Data8 );
serial->setStopBits( QSerialPort::OneStop );

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

0 comments on commit 9d22389

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