serial: fix blocking call on ports, esp. on win32

Summary from Lada:

On Win7, good testing command is:
C:\hamlib> rigctl -vvvvv -m 214 -r COM1 -s 4800 -C data_bits=8 -C
stop_bits=2 -C serial_handshake=Hardware -C timeout=1000

Behavior of this command differs on COM port. On hardware ports
(onboard, PCI NetMos, all probably 16550-compatible) rigctl freeze in
data write. It is correct, no hardware handshake is estabilished. On
FT232 USB port initialization failed by timeout. I think it is not
correct but this is not subject of this e-mail.

Looked into hamlib source and found, that timeout argument is no
longer handled. SetCommTimeouts takes timeout from c_cc[VTIME] which
is not filled.

Signed-off-by: Ladislav Vaiz <spam@nagano.cz>
Hamlib-3.0
Stephane Fillod 2013-05-06 23:47:56 +02:00
rodzic 683cc7eedd
commit 6c370dd36d
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
/*
* Hamlib Interface - serial communication low-level support
* Copyright (c) 2000-2010 by Stephane Fillod
* Copyright (c) 2000-2013 by Stephane Fillod
* Copyright (c) 2000-2003 by Frank Singleton
* Parts of the PTT handling are derived from soundmodem, an excellent
* ham packet softmodem written by Thomas Sailer, HB9JNX.
@ -346,6 +346,11 @@ int HAMLIB_API serial_setup(hamlib_port_t *rp)
sg.sg_flags = RAW;
#endif
/*
* VTIME in deciseconds, rp->timeout in miliseconds
*/
options.c_cc[VTIME] = rp->timeout / 100;
options.c_cc[VMIN] = 1;
/*
* Flush serial port