I'm trying to get GPS position information on a Windows 10 laptop using a Bluetooth GPS. I'm using the following QML:
MapView <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> mapView
anchors<SPAN class="punctuation token">.</SPAN>fill<SPAN class="punctuation token">:</SPAN> parent
<SPAN class="comment token">// set focus to enable keyboard navigation</SPAN>
focus<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN>
Map <SPAN class="punctuation token">{</SPAN>
BasemapTopographic <SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
locationDisplay <SPAN class="punctuation token">{</SPAN>
positionSource<SPAN class="punctuation token">:</SPAN> PositionSource <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> positionSource
name<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"SerialPortNmea"</SPAN>
preferredPositioningMethods<SPAN class="punctuation token">:</SPAN> PositionSource<SPAN class="punctuation token">.</SPAN>SatellitePositioningMethods
updateInterval<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1000</SPAN> <SPAN class="comment token">// 1 second</SPAN>
active<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN>
onPositionChanged<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> coord <SPAN class="operator token">=</SPAN> positionSource<SPAN class="punctuation token">.</SPAN>position<SPAN class="punctuation token">.</SPAN>coordinate<SPAN class="punctuation token">;</SPAN>
console<SPAN class="punctuation token">.</SPAN><SPAN class="token function">log</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Coordinate:"</SPAN><SPAN class="punctuation token">,</SPAN> coord<SPAN class="punctuation token">.</SPAN>longitude<SPAN class="punctuation token">,</SPAN> coord<SPAN class="punctuation token">.</SPAN>latitude<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">// compass: Compass {</SPAN>
<SPAN class="comment token">// id: compass</SPAN>
<SPAN class="comment token">// }</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>After pairing the GPS with the laptop, when I run the program in Qt Creator I see the following Application Output:
class QGeoPositionInfoSource *__cdecl PositionInfoSourceFactory::positionInfoSource(class QObject *) QDeclarativePositionSource(0x17768f05b20)
portName "COM4"
description "Standard Serial over Bluetooth link"
manufacturer "Microsoft"
systemLocation "\\\\.\\COM4"
portName "COM5"
description "Standard Serial over Bluetooth link"
manufacturer "Microsoft"
systemLocation "\\\\.\\COM5"
QNetworkReplyHttpImplPrivate::_q_startOperation was called more than once QUrl("https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json")
void __cdecl SerialPortNmeaPositionInfoSource::startUpdates(void) false "" "The system cannot find the path specified."
int __cdecl main(int,char *[]) QQuickApplicationWindow_QML_99(0x177687fcfc0)
void __cdecl SerialPortNmeaPositionInfoSource::startUpdates(void) false "" "The system cannot find the path specified."
It seems as though the COM ports are showing up (when the GPS wasn't paired those messages weren't appearing in the log), but I'm not sure what path it cannot find, nor how to give it a path so it can use the NMEA stream from the GPS.
Can someone help me set up my app to get locations from this device?
I'm using Qt 5.12.1, Visual Studio 2017, ArcGIS Runtime for Windows (x86_64) Version 100.4