I was debugging termios.c and this patch fixes two small problems--two
debug printf format problems and another one that causes an extra char
to be read on timeout.
The extra char problem is easily duplicated by using the "w" command
under rigtctl. Most all other commands use fixed-length response
strings which don't exhibit the problem. But since "w" does not know
how long the response should be it loops until it times out. Every time
it times out it would return 1 extra character (this was 100% repeatable
on two different rigs).
Turns out it was a simple typo in the code as the read was using the
write event instead of the read event.
Fix bytes read count accumulation in Windows serial I/O.
read_string from communications port doesn't handle timeout on
anything but the first character read.
Honour VMIN tty parameter correctly.
The YACK() macro generates a message of variable length due the
__FILE__ string and a message returned by MS FormatMessage() being
inserted into a fixed length string buffer. I have increased the
buffer length to 1024 bytes and used snprintf to avoid overflows.
It looks like the whole YACK() macro should do nothing unless DEBUG is
defined so there is probably a small performance gain to be had by
doing that also. I have left that to the experts to decide.
Clean up various left over commented lines from dlopen to single
libhamlib transition. Remove unneeded configure variables.
Correct minor inconsistencies in Makefile.am files.
Define a new variable, READLINE_LIBS, so that only programs that offer
Readline support are linked against it.
Fix various compilation warnings and errors in test files revealed with
'make check' on MinGW.
Define rig and rotor backends to (mostly) be built in alphabetical
order.
Use the system gettaddrinfo function when possible as before. Tested on
GNU, Cygwin, MinGW on Linux, and MinGW on Windows. Under MinGW the
replacement getaddrinfo is used. Perhaps this is an area for
investigation to be certain MinGW really doesn't supply getaddrinfo.
This reverts some of the patches from Remi Chateauneu in commit
60019c9. This fixes build issues encountered building the Windows
binary daily snapshots.
Enabled static library build by default at configure time.
Fixed pthread library linking for the ars backend on MinGW.
Trying to run the pthread enabled binaries on W2k resulted in an error
dialog with the text, "The procedure entry point freeaddrinfo could not be
located in ws2_32.dll". A Microsoft support page
(http://support.microsoft.com/kb/955045) hints that when 'ws2tcpip.h' is
included that 'wspiapi.h' should be included as well. Since MinGw
includes both files, this patch corrects the runtime error on W2k
Under Windows, the Icom transceive messages do not get flushed
properly. Returned data is cached in windows serial buffer and
are received by hamlib as response to initial request.
Lada suggested to add PURGE_RXCLEAR flag to tcflush (lib/termios.c),
actually clearing and making the buffer empty.
Look at http://msdn.microsoft.com/en-us/library/windows/desktop/aa363428%28v=vs.85%29.aspx
PURGE_RXABORT only terminates overlapped reads but not input buffer.
Nate suggested to add the PURGE_TXCLEAR flag to the output queue as well.
Signed-off-by: Ladislav Vaiz <spam@nagano.cz>
Signed-off-by: Nate Bargmann <n0nb@n0nb.us>