This is a workaround for some apps like Gpredict, which use comma as a decimal
separator (depending on locale settings), but sscanf in Hamlib can only handle
dots.
without breaking make dist, developer, builds, downstream builds
whether in-source or out-of-source. Done by putting generated files in
the build tree rather than the source tree.
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
Remote PTT must always be either RIG_PTT_RIG_MICDATA or
RIG_PTT_NONE. Also take care not to override any locally set PTT type
as it is feasible to use a local hardware PTT at the client end with
remote CAT control. Maybe an odd arrangement but Hamlib does not
preclude it. This is all done while preserving the accuracy of the
ptt_type value in dump_state requests.
Rename tests/hamlibdatetime.h to tests/hamlibdatetime.h.in which is
tracked and ignore tests/hamlibdatetime.h which is not tracked and will
be generated or copied depending on whether the top source directory is
a Git working tree or not.
https://github.com/Hamlib/Hamlib/issues/259
set_vfo_opt can now dynamically change vfo mode on rigctld
So this example now works...does some non-vfo stuff then switches to vfo mode
rigctl -m 2 F 14074000 V VFOB F 14076000 V VFOA f V VFOB f set_vfo_opt 1 f VFOA
rigctl commands v,V and S have been changed to not require VFO arguments
New API function rig_set_vfo_opt -- only implemented for Net rigctl as it doesn't apply to any other rigs
This needs to be validated on the rigs to see the individual behavior
It only gives an error when read_only=0, read_only=1 does not give any error
We want the behavior of actually setting the rig display to be based on this flag
https://github.com/Hamlib/Hamlib/issues/227
Protocol 1 is setting=value. Order does not matter. Can be multiline.
And is forward compatible as new values will just generate warnings on older versions
On Icom rigs, for example you will see "currVFO" if no VFO has been set
Eventually we will start showing MainA/MainB SubA/SubB for rigs that have that capability
Put a looplimit on icom_get_ant_count trying to get autodetect to work
Changes to icom_get_ant_count to try and get this working
Added dummy antenna # args to rigs that don't care i.e. only have 1 antenna
ICOM test via rigctl
Rig command: w \0xfe\0xfe\0x58\0xe0\0x03\0xfd
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: W \0xfe\0xfe\0x58\0xe0\0x03\0xfd 17
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: w FA;
send_cmd: error = Invalid parameter
Rig command: W FA; 14
send_cmd_rx: error = Invalid parameter
ICOM test via rigctld
Rig command: w \0xfe\0xfe\0x58\0xe0\0x03\0xfd
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: W \0xfe\0xfe\0x58\0xe0\0x03\0xfd 17
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: w FA;
Reply:RPRT -1
Rig command: W FA; 14
Reply:RPRT -1
Kenwood test via rigctl
Rig command: w FA;
Reply:FA00014074000;
Rig command: W FA; 14
Reply:FA00014074000;
Rig command: w \0x46\0x41\0x3b
Reply:FA00014074000;
Rig command: W \0x46\0x41\0x3b 14
Reply:FA00014074000;
Kenwood test via rigctld
Rig command: w FA;
Reply:FA00014074000;
Rig command: W FA; 14
Reply:FA00014074000;
Rig command: w \0x46\0x41\0x3b
Reply:FA00014074000;
Rig command: W \0x46\0x41\0x3b 14
Reply:FA00014074000;
So we can now do this...write once to see how many bytes you get back
Rig command: w \0xfe\0xfe\0x58\0xe0\0x03\0xfd
Cmd:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x00\0x09\0x14\0x00\0xFD 17
Then use 'W' to write the command with the # of bytes to expect -- no timeout this way
Rig command: W \0xfe\0xfe\0x58\0xe0\0x03\0xfd 17
Cmd:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x00\0x09\0x14\0x00\0xFD 17
Fix declarations after statements
Remove some !rig checks...we either don't need them or need them everywhere with a new error code
If you pass a NULL rig you get what you deserve :-)
Now responds with hex string just like the input and the # of bytes
Will get hex string response for any binary data from rig from any command
Next step is to implement W command for known # of bytes in response to avoid the timeout
This found tons of errors in rig_debug statements
So this patch cleans up all the files that were producing warnings or errors
This should fix a few segfaults when running with debug turned on
The \chk_vfo command to rigctl_parse() accepts an extended response
prefix but does not act upon it, instead it is held over until the
next command. This seems unnecessary as an extended response prefix
can just as easily be added to the following command if required. By
removing this carried over state the processing of commands can be
greatly simplified as per this commit.
Virtual com ports providing a TS-2000 Emulator
Example connecting N1MM or such to FLRig via COM5/COM6 virtual COM pair
rigctlcom -m 4 -R COM5 -S 115200
N1MM connects to COM6 TS-2000 115200 8N1
The warning was:
CC rotctl_parse.o
../../hamlib/tests/rotctl_parse.c:1012:50: warning: format string is not a string literal (potentially insecure)
[-Wformat-security]
snprintf(cmd_name, sizeof(cmd_name), parsed_input[0] + 1);
^~~~~~~~~~~~~~~~~~~
../../hamlib/tests/rotctl_parse.c:1012:50: note: treat the string as an argument to avoid this
snprintf(cmd_name, sizeof(cmd_name), parsed_input[0] + 1);
^
"%s",
1 warning generated.
On Debian Buster gcc ((Debian 8.2.0-8) 8.2.0) was throwing the following
warning:
CC rigctl.o
../../hamlib/tests/rigctl.c:125:18: warning: ‘have_rl’ defined but not used [-Wunused-const-variable=]
static const int have_rl = 0;
^~~~~~~
and:
CC rotctl.o
../../hamlib/tests/rotctl.c:113:18: warning: ‘have_rl’ defined but not used [-Wunused-const-variable=]
static const int have_rl = 0;
^~~~~~~
Turns out I didn't have the readline-dev package installed. As the have_rl
variable is wrapped in CPP macros, it indeed is not used when readline is not
available.
As some content was getting dated, refresh the content of the various
manual pages and while doing so, update the pages to conform more
closely to man-pages(7), man(7), and groff_man(7).
Because some rigs lock their front panel when opened for CAT it is
helpful to call rig_close() in rigctld when no clients are
connected. This change does that.
A CTRL+C handler is also added to allow rig_close() to be called
during exit.
on the real rig. In rigctl_parse.c, we make sure that invalid attempts to
so so are mapped on a safe variant.
Second change to netrigctl: drain the input line before sending a new
command, to reach sync again after a timeout.
Separate FT-891 features
Fix rigctl and rigctld to not abort on function not available
Change Yaesu detection of FA length to automatic method instead of rig specific
Although there is no reasonable recovery from SIGPIPE we do not want
to terminate the server process, just the client servicing thread. We
do this by setting the disposition for SIGPIPE to ignored, this causes
an EPIPE to be returned from blocked write() and send() calls that end
up trying to send to a broken pipe/socket.
This makes the first non-option argument end getopt_long() parsing
stop rather than shuffling non-option arguments to the end. This is
necessary so that rig/rotator command language arguments can start
with a '-' character and also it enables the '-' pseudo command to
switch to reading commands from stdin work correctly.
The change also make checking for the '-', switch to stdin, command
stricter in that it must be where a command is expected and it must be
a word containing exactly a single '-' character.
Overall this allows the following styles of use:
$ rigctl R -
$ rigctl - <<EOF
>R -
>EOF
R -
$ echo "R -" | rigctl -
R -
$ rigctl -m 1 M CW -1
$ rigctl F 434000000 - <<EOF
>M FM 15000
>f m
>EOF
M FM 15000
f 145000000
m FM
15000
$
as well as the command line interpreter operation where no commands
nor '-' are provided:
$ rigctl
Rig command: R -
Rig command: r
Rptr Shift: -
Rig command: f
Frequency: 145000000
Rig command: m
Mode: FM
Passband: 15000
Rig command: F 434000000
Rig command: f
Frequency: 434000000
Rig command: q
$
CAT protocols that don't allow direct addressing of VFOs require that
the "other" VFO be queried or set via a select then get/set then
select back to original or swap then get/set then swap again. When
both frequncy and mode need to be set the sequences can be optimized
if a single funciton is avaiable.
This enhancement adds those single functions rig_set_split_freq_mode()
and rig_get_split_freq_mode() with a default impelementation that
calls the individual rig_{get,set}_split_{freq,mode}() functions. Back
ends can choose to implement an optimized version which is used
instead of the default if present.
Using these functions when an optimized implementation is available
allows the TX VFO's frequency and mode to be set in a single operation
with only one VFO exchange or selection either side of the
operation. Many CAT protocols are very efficient when getting or
setting both frequency and mode and some even combine the two in a
single command.
The letters 'K' and 'k' are used for the rigctl short command name for
these functions.
After discussions with Greg N1DAM I have changed the dual stack
support to explicitly allow IPv4 connections mapped to IPv6 for any
AF_INET6 address since BSD as well as Windows defaults this socket
option to on (disallowed).
IPv4 mapped to IPv6 makes sense for Hamlib servers since starting two
servers one for each protocol family (the other option) is not
possible since there is only a single rig/rotator which cannot be
shared between two servers.
As the rigctld and rotctld programs are actually user programs and
installed in ${prefix}/bin, it was erroneous to install the associated
manual pages into the man8 directory. Correct this error going forward
and install them into man1 with the other manual pages.
As Hamlib now restores the rig auto information state (AI) on exit
there is now a need to disable that functionality so that rigctl can
be used to set/reset AI mode on the rig explicitly.
A new public API function 'rig_no_restore_ai()' is also added that
allows any client to disable this auto AI restore functionality if
required. Most clients should do nothing as restoring AI state is a
good thing.
This means that rigctl & rigctld now work with default arguments on a
modern Windows machine with dual stack and localhost being [::1] as
the first interface returned by getaddrinfo().
Try all the interfaces return by DNS lookups to establish a connection
or listening port. Handle Windows network errors correctly so that
meaningful messages are printed.
The rigctl program now accepts IPv6 numeric addresses in the portname
field like [<addr>}:<port> for example the IPv6 loopback on port 4531
would be [::1]:4531.
This means that rigctl & rigctld now work with default arguments on a
modern Windows machine with dual stack and localhost being [::1] as
the first interface returned by getaddrinfo().
Try all the interfaces return by DNS lookups to establish a connection
or listening port. Handle Windows network errors correctly so that
meaningful messages are printed.
The rigctl program now accepts IPv6 numeric addresses in the portname
field like [<addr>}:<port> for example the IPv6 loopback on port 4531
would be [::1]:4531.
Richard Sahw, KF5OIM, reported a failure in the C++ test when attempting
to build an RPM package in a clean environment. This patch amends the
LD_LIBRARY_PATH in the generated shell scripts in the c++ and tests
directories.
This allows repeatable regression testing where a command has a finite
"settling" time. This will probably be of most use in the related
rotctl command set.
In order to write regression tests before making disruptive changes to
back ends I have added a new command to the rigctl parser which is '-'
that causes it to read commands from stdin until they are exhausted.
The commands must be white space separated and can include comments
from a '#' character until the end of the current line.
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.
LIBUSB_LIBS was not passed to the LDADD variable for the Hamlib test
utilities. This fix permits the user invoking 'configure' to specify a
static libusb to include the libusb symbols in libhamlib:
./configure LIBUSB_LIBS="/usr/lib/i386-linux-gnu/libusb.a"
Note that the actual path will vary from system to system.
Revise the preprocessor conditional test for MinGW variables. Tested on
all of my MinGW installations. The prior test was broken by MinGW 3.0
on Debian Unstable.
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.
MinGW does not natively support the POSIX sleep() function so we have
had an override that was a part of the GR_PWIN32 macro and included in
the generated config.h file. When compiling for Windows on POSIX using
MinGW, Autotools will detect sleep() and set HAVE_SLEEP which prevented
the substitution from being included in the source. Adding a test for
_WIN32 (set by MinGW's gcc) then caused a warning from src/network.c on
POSIX about winsock2.h needing to be included before windows.h. As
config.h needed to be included first, the solution to break out the
substitution that includes windows.h into its own file. This patch
provides that solution and allows the code to compile cleanly on POSIX,
using MinGW on both POSIX and Windows, and on Cygwin.
The Automake manual makes it clear that certain user variables such as
CC, CFLAGS, CXXFLAGS, CPPFLAGS, and so on are to be preserved for the
user running configure. This patch cleans up such assignments and
assures that PTHREAD_CFLAGS and so forth are applied to those targets
that require it.
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
The AX_PTHREAD macro sets the PTHREAD_LIBS variable, however we were not
providing this variable to the needed *_LDFLAGS variable. With the
addition of PTHREAD_LIBS, rigctld and rotctld are now multi-threaded on
MS Windows. Tested on Windows 2000, Windows XP, and Windows 7.
Setting LD_LIBRARY_PATH for testcpp and testrig in the generated test
shell scripts corrects a long-standing bug that broke 'make check'.
Add Hamlib_design.eps to allow 'make dvi' to succeed when running
'make distcheck'.
Document Readline and history additions to rotctl along with new
-i/--read-history and -I/--save-history options.
Document use of ROTCTL_HIST_DIR environment variable to set an alternate
path for the .rotctl_history file.
Other minor edits.
As commands from a previous session may not be desired, make reading the
history file at rotctl start and writing to it at rotctl close optional
by use of the -i/--read_history or -I/--save-history options.
Compilation is conditional on having Readline and Readline History
support detected at build system configuration time.
History is stored in '$HOME/.rotctl_history' by default. An alternate
path may be specified by setting the ROTCTL_HIST_DIR environment
variable:
$ ROTCTL_HIST_DIR=~/.rotctl rotctl -iI
will temporarily set the history directory to /home/USER/.rotctl and
create .rotctl_history if it does not exist. If the file cannot be read
or written a warning message will be given on stderr.
Implement first cut at storing and recalling history. At this point
history is retained for the current session only.
History is stored as complete command lines even if values are entered
at separate prompts. Readline allows editing and even deleting recalled
history lines.
Initial implementation of Readline input handling. Only if 'configure'
finds Readline will it be enabled and when enabled it will only be used
by rotctl in interactive mode. Passing rotator commands from the rotctl
command line and rotctld use the original input handling which has not
been modified.
Document Readline and history additions to rigctl along with new
-i/--read-history and -I/--save-history options.
Document use of RIGCTL_HIST_DIR environment variable to set an alternate
path for the .rigctl_history file.
Other minor edits.
As commands from a previous session may not be desired, make reading the
history file at rigctl start and writing to it at rigctl close optional
by use of the -i/--read_history or -I/--save-history options.
Compilation is conditional on having Readline and Readline History
support detected at build system configuration time.
History is stored in '$HOME/.rigctl_history' by default. An alternate
path may be specified by setting the RIGCTL_HIST_DIR environment
variable:
$ RIGCTL_HIST_DIR=~/.rigctl rigctl -iI
will temporarily set the history directory to /home/USER/.rigctl and
create .rigctl_history if it does not exist. If the file cannot be read
or written a warning message will be given on stderr.