Simple Terminal about serialport bug on mac 10.10.1
-
Hi and welcome to devnet,
That's a bit vague, you should add which version of Qt you are running, what hardware you are using and how do you know that you get only 00
-
Are you sure you are using the same com port parameters on both sides ?
-
I verify it that It's qt's bug and fix it .
in qserialport_unix.cpp replice
const qint32 unixBaudRate = QSerialPortPrivate::settingFromBaudRate(baudRate);
const QSerialPort::SerialPortError error = (unixBaudRate > 0) ? setStandardBaudRate(unixBaudRate, directions) : setCustomBaudRate(baudRate, directions); if (error == QSerialPort::NoError) return updateTermios();
with
if (setBaudRate_helper(baudRate,directions)==QSerialPort::NoError)
return updateTermios();It's run well!!!!
-
A problem that on OSX/BSD (at least on v10.9.4 with XCode v6.1) the B921600 speed are not defined in termios.h. There are defined standard speeds up B0 to B230400.
Thus, apparently, you were lucky that your modification works because in BSD/OSX, the macroes of Bxxx have values of real speeds (i.e. it is not a bit flags as in Linux). Therefore your code works with miracle. :)
But it is strange, why it does not working via IOSSIOSPEED (as custom baud rate).
In your case, the setBaudRate(921600) method returns true without an errors?
PS: Perhaps, QtSerialPort need to correct somehow for specifics OSX in the future.
-
bq. In your case, the setBaudRate(921600) method returns true without an errors?
Probably, up to Qt 5.4.0 the setBaudRate() will not return an error (this is a bug: https://qt.gitorious.org/qt/qtserialport/commit/93717299150149646d7f1546c8cc86fe54d9319e) . But in Qt 5.4.1 it is fixed (you should get an error from the Terminal example).