Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.2.1
-
None
-
MacOSX 10.9
Description
ok, after checking latest sources, I modified QSerialPort::open to add a few debug statements:
qDebug() << "SYS LOC:" << systemLocation; descriptor = qt_safe_open(systemLocation.toLocal8Bit().constData(), flags); qDebug() << "descriptor:" << descriptor;
and here's what I got:
SYS LOC: "/dev/cu./dev/ttys002"
descriptor: -1
so it led me to the following code:
#ifdef Q_OS_MAC static const QString defaultFilePathPrefix = QStringLiteral("/dev/cu."); static const QString unusedFilePathPrefix = QStringLiteral("/dev/tty."); #else static const QString defaultFilePathPrefix = QStringLiteral("/dev/"); #endif QString QSerialPortPrivate::portNameToSystemLocation(const QString &port) { QString ret = port; #ifdef Q_OS_MAC ret.remove(unusedFilePathPrefix); #endif if (!ret.contains(defaultFilePathPrefix)) ret.prepend(defaultFilePathPrefix); return ret; }
that is making the assumption that all serial ports are /dev/cu. prefixed files. Whereas a PTY is not...
As suggested by Sergey in QTBUG-32024, we can as well make all absolute path given to the open function skip the modifications, so an user can read from a chardev he has created outside of /dev.