1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

Fix for OSX to enumerate serial ports correctly

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2756 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2011-02-08 16:34:38 +00:00 committed by peabody124
parent 9f71f4121c
commit 58a0cce89b

View File

@ -112,12 +112,15 @@ bool QextSerialEnumerator::getServiceDetailsOSX( io_object_t service, QextPortIn
IORegistryEntryGetPath( service, kIOServicePlane, ioPathName ); IORegistryEntryGetPath( service, kIOServicePlane, ioPathName );
portInfo->portName = ioPathName; portInfo->portName = ioPathName;
if( bsdPathAsCFString ) if( bsdPathAsCFString )
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
if( CFStringGetCString((CFStringRef)bsdPathAsCFString, path, if( CFStringGetCString((CFStringRef)bsdPathAsCFString, path,
PATH_MAX, kCFStringEncodingUTF8) ) PATH_MAX, kCFStringEncodingUTF8) ) {
portInfo->physName = path; portInfo->physName = path;
portInfo->friendName = path;
}
CFRelease(bsdPathAsCFString); CFRelease(bsdPathAsCFString);
} }