[BRLTTY] Focus 1 70 display and USB to serial adapter: possible connecting this scenario?

Dave Mielke Dave at mielke.cc
Sun Dec 29 13:14:52 UTC 2024


[quoted lines by Hammer Attila on 2024/12/28 at 14:15 +0100]

I haven't looked at the serial code for a long, long time. It turns out that the generic ready timeout was being applied before the port configuration changes were being applied. I guess, since by the time that brltty's generic I/O was introduced, most displays were using either USB or Bluetooth so this just went unnoticed.

Do you know how to apply a patch? If so, could you please test the attached patch (serial-1.patch) and then see what effect setting the ready timeout has?

-- 
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke            | 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: Dave at Mielke.cc  | Ottawa, Ontario   | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada  K2A 1H7   |

http://mielke.cc/xmother.html (Letter from a Feminist ex-Mother)
-------------- next part --------------
diff --git a/Programs/serial.c b/Programs/serial.c
index a29574824..d165b14ad 100644
--- a/Programs/serial.c
+++ b/Programs/serial.c
@@ -245,16 +245,6 @@ serialSetFlowControl (SerialDevice *serial, SerialFlowControl flow) {
   return 0;
 }
 
-int
-serialSetParameters (SerialDevice *serial, const SerialParameters *parameters) {
-  if (!serialSetBaud(serial, parameters->baud)) return 0;
-  if (!serialSetDataBits(serial, parameters->dataBits)) return 0;
-  if (!serialSetStopBits(serial, parameters->stopBits)) return 0;
-  if (!serialSetParity(serial, parameters->parity)) return 0;
-  if (!serialSetFlowControl(serial, parameters->flowControl)) return 0;
-  return 1;
-}
-
 unsigned int
 serialGetCharacterSize (const SerialParameters *parameters) {
   unsigned int size = 1 /* start bit */ + parameters->dataBits;
@@ -351,6 +341,16 @@ serialFlushAttributes (SerialDevice *serial) {
   return 1;
 }
 
+int
+serialSetParameters (SerialDevice *serial, const SerialParameters *parameters) {
+  if (!serialSetBaud(serial, parameters->baud)) return 0;
+  if (!serialSetDataBits(serial, parameters->dataBits)) return 0;
+  if (!serialSetStopBits(serial, parameters->stopBits)) return 0;
+  if (!serialSetParity(serial, parameters->parity)) return 0;
+  if (!serialSetFlowControl(serial, parameters->flowControl)) return 0;
+  return serialFlushAttributes(serial);
+}
+
 int
 serialAwaitInput (SerialDevice *serial, int timeout) {
   if (!serialFlushAttributes(serial)) return 0;


More information about the BRLTTY mailing list