mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
GCS Serial: Was double detecting USBCDC devices.
This commit is contained in:
parent
06fc1ed963
commit
8bb6a2600f
@ -22,8 +22,7 @@ QextSerialEnumerator::~QextSerialEnumerator( )
|
||||
|
||||
// static
|
||||
QList<QextPortInfo> QextSerialEnumerator::getPorts()
|
||||
{
|
||||
QList<QextPortInfo> infoList;
|
||||
{ QList<QextPortInfo> infoList;
|
||||
io_iterator_t serialPortIterator = 0;
|
||||
kern_return_t kernResult = KERN_FAILURE;
|
||||
CFMutableDictionaryRef matchingDictionary;
|
||||
@ -44,18 +43,6 @@ QList<QextPortInfo> QextSerialEnumerator::getPorts()
|
||||
IOObjectRelease(serialPortIterator);
|
||||
serialPortIterator = 0;
|
||||
|
||||
if( !(matchingDictionary = IOServiceNameMatching("AppleUSBCDC")) ) {
|
||||
qWarning("IOServiceNameMatching returned a NULL dictionary.");
|
||||
return infoList;
|
||||
}
|
||||
|
||||
if( IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDictionary, &serialPortIterator) != KERN_SUCCESS ) {
|
||||
qCritical() << "IOServiceGetMatchingServices failed, returned" << kernResult;
|
||||
return infoList;
|
||||
}
|
||||
iterateServicesOSX(serialPortIterator, infoList);
|
||||
IOObjectRelease(serialPortIterator);
|
||||
|
||||
return infoList;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user