Skip to content

Commit

Permalink
Fix connection to GPS using serial port
Browse files Browse the repository at this point in the history
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 9d22389
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/gps/qgsgpsdetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit 9d22389

Please sign in to comment.