<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Display device location with NMEA data sources(QT,100.11,C++) in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/display-device-location-with-nmea-data-sources-qt/m-p/1059532#M4146</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/452084"&gt;@cwaller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a quick sample code which exercises the QSerialPort on Windows and it works for me. In this code snippet I hard-coded the port parameters, but it should be fine since you said you can read the port without problems:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void nmeaTestClass::startGpsLocationReading()
{
  QSerialPort* serialPort = new QSerialPort();
  NmeaLocationDataSource* nmeaLocationDataSource = new NmeaLocationDataSource(this);
  m_mapview-&amp;gt;locationDisplay()-&amp;gt;setDataSource(nmeaLocationDataSource);

  connect(serialPort, &amp;amp;QSerialPort::readyRead, this, [serialPort, nmeaLocationDataSource]()
          {
            const QByteArray locData = serialPort-&amp;gt;readLine(1024);
            nmeaLocationDataSource-&amp;gt;pushData(locData);
          });
  serialPort-&amp;gt;setPortName("COM4");
  serialPort-&amp;gt;setBaudRate(9600);
  serialPort-&amp;gt;setDataBits(QSerialPort::DataBits::Data8);
  serialPort-&amp;gt;setParity(QSerialPort::Parity::NoParity);
  serialPort-&amp;gt;setStopBits(QSerialPort::StopBits::OneStop);
  serialPort-&amp;gt;setFlowControl(QSerialPort::FlowControl::NoFlowControl);

  serialPort-&amp;gt;open(QIODevice::ReadWrite);

  m_mapview-&amp;gt;locationDisplay()-&amp;gt;start();
}&lt;/LI-CODE&gt;&lt;P&gt;May I ask if you were following similar steps? If so, and still doesn't work, then if you could share your code-snippet that would be great help. Also, may I ask what platform are you trying to run your application?&lt;/P&gt;&lt;P&gt;Also, unfortunately QML does not support QSerialPort, but QBluetoothSocket is supported on both C++ and QML.&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 17:04:32 GMT</pubDate>
    <dc:creator>MartonFeigl</dc:creator>
    <dc:date>2021-05-19T17:04:32Z</dc:date>
    <item>
      <title>Display device location with NMEA data sources(QT,100.11,C++)</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/display-device-location-with-nmea-data-sources-qt/m-p/1059084#M4137</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have tried to implement your newer tools regarding NMEA sources. Using QSerialPort I am able to read the port etc., but when I push the data back using NmeaLocationDataSource::pushData nothing happens. I have tried a lot&amp;nbsp;of different ways to parse the data and update the location but the location never changes. Could someone make an example using realtime mode (not simulation) and for C++/QML . I'm sure the developers that make the GIT Samples are working on one, or at least hopefully are. But I am in need of an answer sooner than later. Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 17:59:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/display-device-location-with-nmea-data-sources-qt/m-p/1059084#M4137</guid>
      <dc:creator>cwaller</dc:creator>
      <dc:date>2021-05-18T17:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Display device location with NMEA data sources(QT,100.11,C++)</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/display-device-location-with-nmea-data-sources-qt/m-p/1059532#M4146</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/452084"&gt;@cwaller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a quick sample code which exercises the QSerialPort on Windows and it works for me. In this code snippet I hard-coded the port parameters, but it should be fine since you said you can read the port without problems:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void nmeaTestClass::startGpsLocationReading()
{
  QSerialPort* serialPort = new QSerialPort();
  NmeaLocationDataSource* nmeaLocationDataSource = new NmeaLocationDataSource(this);
  m_mapview-&amp;gt;locationDisplay()-&amp;gt;setDataSource(nmeaLocationDataSource);

  connect(serialPort, &amp;amp;QSerialPort::readyRead, this, [serialPort, nmeaLocationDataSource]()
          {
            const QByteArray locData = serialPort-&amp;gt;readLine(1024);
            nmeaLocationDataSource-&amp;gt;pushData(locData);
          });
  serialPort-&amp;gt;setPortName("COM4");
  serialPort-&amp;gt;setBaudRate(9600);
  serialPort-&amp;gt;setDataBits(QSerialPort::DataBits::Data8);
  serialPort-&amp;gt;setParity(QSerialPort::Parity::NoParity);
  serialPort-&amp;gt;setStopBits(QSerialPort::StopBits::OneStop);
  serialPort-&amp;gt;setFlowControl(QSerialPort::FlowControl::NoFlowControl);

  serialPort-&amp;gt;open(QIODevice::ReadWrite);

  m_mapview-&amp;gt;locationDisplay()-&amp;gt;start();
}&lt;/LI-CODE&gt;&lt;P&gt;May I ask if you were following similar steps? If so, and still doesn't work, then if you could share your code-snippet that would be great help. Also, may I ask what platform are you trying to run your application?&lt;/P&gt;&lt;P&gt;Also, unfortunately QML does not support QSerialPort, but QBluetoothSocket is supported on both C++ and QML.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 17:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/display-device-location-with-nmea-data-sources-qt/m-p/1059532#M4146</guid>
      <dc:creator>MartonFeigl</dc:creator>
      <dc:date>2021-05-19T17:04:32Z</dc:date>
    </item>
  </channel>
</rss>

