1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +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 );
portInfo->portName = ioPathName;
if( bsdPathAsCFString )
{
char path[MAXPATHLEN];
if( CFStringGetCString((CFStringRef)bsdPathAsCFString, path,
PATH_MAX, kCFStringEncodingUTF8) )
PATH_MAX, kCFStringEncodingUTF8) ) {
portInfo->physName = path;
portInfo->friendName = path;
}
CFRelease(bsdPathAsCFString);
}