From 4cca4c88841de8cffc82baea41d07a406d7b558e Mon Sep 17 00:00:00 2001 From: James Mare Date: Tue, 1 Aug 2023 21:07:48 -0700 Subject: [PATCH] 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. --- src/comm/QGCSerialPortInfo.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/comm/QGCSerialPortInfo.cc b/src/comm/QGCSerialPortInfo.cc index 94acb81..ab169a3 100644 --- a/src/comm/QGCSerialPortInfo.cc +++ b/src/comm/QGCSerialPortInfo.cc @@ -305,8 +305,12 @@ QList 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()); }