Browse Source

Fix skipping of NMEA serial ports

QGCSerialPortInfo skips over serial ports which are not the first in any
composite device. However this is how some internal NMEA GPS's present.
So if the description contains 'NMEA', dont skip them.
QGC4.4
James Mare 2 years ago committed by Beat Küng
parent
commit
4cca4c8884
  1. 8
      src/comm/QGCSerialPortInfo.cc

8
src/comm/QGCSerialPortInfo.cc

@ -305,8 +305,12 @@ QList<QGCSerialPortInfo> QGCSerialPortInfo::availablePorts(void) @@ -305,8 +305,12 @@ QList<QGCSerialPortInfo> QGCSerialPortInfo::availablePorts(void)
VidPidPair_t vidPid(portInfo.vendorIdentifier(), portInfo.productIdentifier());
if (seenSerialNumbers.contains(vidPid) && seenSerialNumbers[vidPid].contains(portInfo.serialNumber())) {
// Some boards are a composite USB device, with the first port being mavlink and the second something else. We only expose to first mavlink port.
qCDebug(QGCSerialPortInfoLog) << "Skipping secondary port on same device" << portInfo.portName() << portInfo.vendorIdentifier() << portInfo.productIdentifier() << portInfo.serialNumber();
continue;
// However internal NMEA devices can present like this, so dont skip anything with NMEA in description
if(!portInfo.description().contains("NMEA"))
{
qCDebug(QGCSerialPortInfoLog) << "Skipping secondary port on same device" << portInfo.portName() << portInfo.vendorIdentifier() << portInfo.productIdentifier() << portInfo.serialNumber();
continue;
}
}
seenSerialNumbers[vidPid].append(portInfo.serialNumber());
}

Loading…
Cancel
Save