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.
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
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
$
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.
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.
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 rigctl in interactive mode. Passing rig commands from the rigctl
command line and rigctld use the original input handling which has not
been modified.
Implemented hash table to temporarily store and sort the rig models by ID
to print the --list by model numbers. Hash is implemented using
uthash.h, see http://uthash.sourceforge.net/
Suppressed rig backend register output by setting rig_debug_level to 0
for list output.
Removed riglist definition of RPC backend.
The -r, -p , and -d options could result in a port pathname that is
not a NULL terminated string as the allowed string length is the same
size as the buffer per the strncpy manual page. This is corrected by
assuring that the allowed length is FILPATHLEN - 1.
introduce PRIll (printf format) and SCNll (scanf) in misc.h.
This needs to have config.h included beforehand.
* do likewise with freq_t type (double) in rig.h
FREQFMT is deprecated.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1903 7ae35d74-ebe9-4afe-98af-79ac388436b8