Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.2.1
-
None
-
MacOSX, Linux, Unix
-
63d3fc0c0679a801da54cf390728120338fbd187
Description
When an opened device does not implement all the features of a "true" serial port, some settings may not work. Thus, the following:
if (!d->setBaudRate() || !d->setDataBits(d->dataBits) || !d->setParity(d->parity) || !d->setStopBits(d->stopBits) || !d->setFlowControl(d->flowControl)) { // || !d->setDataTerminalReady(d->dataTerminalReady) // THIS FAILS // || !d->setRequestToSend(d->requestToSend)) { // THIS FAILS AS WELL close(); return false; }
will end up closing a working serial port. For example, a PTY serial port opened by socat will not necessarily have DTR and RTS working. Thus, I suggest that in case those fail, we leave the serial port opening, and emit an error to the user so he can decide to deal or not with the problem.