Important: Please read the Qt Code of Conduct -

How to get NMEA sentences out of GPS device?

  • Hi, all,

    how can I get the raw NMEA data out of a GPS device?
    QGeoPositionInfo doesn't provide it...


  • Moderators


    You could subclass "QNmeaPositionInfoSource": and reimplement parsePosInfoFromNmeaData() to capture the raw NMEA sentence:

    bool MySource::parsePosInfoFromNmeaData(const char * data, int size, QGeoPositionInfo * posInfo, bool * hasFix) override
    // Store the raw sentence for later retrieval
    this->sentence += QString(data, size);

    // Call the base implementation to process the sentence
    return QNmeaPositionInfoSource::parsePosInfoFromNmeaData(data, size, posInfo, hasFix);


  • Hello,

    that sounds very interesting.

    But as QNmeaPositionInfoSource requires a QIODevice now the goal was to find out what device file is emitting the GPS' data...

    Sorry, I'm absolutely rookie to android development.


  • Moderators

    Hmm... reading through the documentation again, I might have misunderstood how QNmeaPositionInfoSource works.

    I have to admit I don't have experience with the Qt Positiioning classes; try asking at the "Interest mailing list": where you can find Qt engineers (you'll need to subscribe first)

Log in to reply