After some experimenting and reading source codes I tried to connect to my GPS device as follows (from a QGIS plugin):
self.pushButton_conGPS.clicked.connect(self.connectGPS)
[...]
def connectGPS(self):
port = u'\\\\.\\COM4'
#port = u'localhost:2947:'
self.detector = QgsGPSDetector(port)
print 'detected, connection functions'
self.detector.detected[QgsGPSConnection].connect(self.connectionSucceed)
print '---'
self.detector.detectionFailed.connect(self.connectionFailed)
print 'advance'
self.detector.advance()
def connectionSucceed(self, connection):
print 'connection Succeed'
QgsGPSConnectionRegistry.instance().registerConnection(connection)
print QgsGPSConnectionRegistry.instance().connectionList()[0].currentGPSInformation().utcDateTime.toString()
def connectionFailed(self):
print 'connection failed.'
Pressing my above referred button results in
Note the output on the python console, minidump occurs at QgsGPSConnectionRegistry.instance().registerConnection(connection)
Related post: Connect / Disconnect GPS device via PyQGIS
What is it that causes the minidump? I think similiar c++ code of the GPS Information panel works pretty well...
