Wykres commitów

39 Commity (8e0ddf743c6bdc5bb37f33b17984867e26758255)

Autor SHA1 Wiadomość Data
Michael Black a7335595de
Add az and el offset to rotctl & rotctld 2019-12-02 23:30:08 -06:00
Michael Black 6bf3b00c4f
astyle all files 2019-11-30 10:19:08 -06:00
Michael Black 2f4d62709e
Added a dummy snprintf to rig_debug to allow gcc to check format strings
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
2019-11-30 10:04:31 -06:00
Bill Somerville 8028663ef9
Simplify unnecessary persistence of extended response state
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.
2019-08-29 14:27:22 +01:00
Bill Somerville d931bd4e18
Move unnecessary global and file static variables to the stack 2019-08-29 00:39:39 +01:00
Michael Black 3dce8b01d1
Make rigctld thread safe for vfo_mode and ext_resp and change other globals to thread_local for future reference 2019-07-31 16:03:46 -05:00
Nate Bargmann b0ebeaeda4 Quell gcc 8.2.0 defined but not used warning
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.
2018-10-25 18:26:25 -05:00
Michael Black W9MDB abca0653fd Fix compile warnings for tests 2018-04-22 18:38:16 -05:00
Michael Black W9MDB 6c369109e6 Add debug time stamps via -Z and --debug-time-stamps 2018-04-15 15:06:52 -05:00
Nate Bargmann b692fb22ef Formatted tests/ to final coding guidelines 2017-10-06 18:58:42 -05:00
Nate Bargmann d489b8bcb5 Apply formatting to 'tests/' directory
Format per style guide.
2017-08-10 05:46:12 -05:00
Bill Somerville fcb93b98fa Switch to POSIXLY_CORRECT mode for getopt_long()
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

$
2016-04-19 21:52:02 -05:00
Nate Bargmann fafbb772c5 rigctl.c/rotctl.c: fix closing brace placement
A closing brace was improperly placed before a pair of CPP #endif
directives rather than between them.  Caught by a cppcheck audit.
2014-03-07 05:55:54 -06:00
Nate Bargmann 275acd2a60 rotctl.c: Add options to save/read command history
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.
2013-02-22 21:06:30 -06:00
Nate Bargmann e34a94ad66 rotctl_parse.c: Implement history recall
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.
2013-02-22 21:06:30 -06:00
Nate Bargmann e549fee11a rotctl_parse.c: Implement readline interactive mode
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.
2013-02-22 21:06:30 -06:00
Nate Bargmann 7e9f628648 rigctld/rotctld: Remove -e|--end-marker option
Remove support for deprecated "End Marker" protocol in rigctld and
rotctld.
2013-02-05 14:40:41 -06:00
Nate Bargmann c3bc66eafc Tidy up rotctl --list output
Implemented hash table to temporarily store and sort the rot models by ID
to print the --list by model numbers.  Hash is implemented using
uthash.h, see http://uthash.sourceforge.net/

Suppressed rot backend register output by setting rig_debug_level to 0
for list output.

Removed rotlist definition of RPC backend.
2012-02-13 15:28:03 -06:00
Nate Bargmann 1229a0a42a Assure NULL terminated strings in tests programs.
Various strncpy operations 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.
2012-01-07 20:36:50 -06:00
Nate Bargmann 0882cd696d Update GPL/LGPL header in tests source files.
TNX to Lucian Laga, YO6PLB, for the notification.
2011-08-22 21:38:37 -05:00
Stéphane Fillod, F8CFE 8690fb0594 Implement exit status according to manual page:
1 if there was an invalid command line option or argument;
  2 if an error was returned by Hamlib.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@3009 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-12-01 21:41:55 +00:00
Stéphane Fillod, F8CFE ecda326342 - allow litteral command for \move
- added dump-caps option to rotctl


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2895 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-04-25 17:29:53 +00:00
Nate Bargmann, N0NB e6f311cdd0 Really set rotctl/rotctld to follow debug level set on command line.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2835 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-02-14 23:58:54 +00:00
Nate Bargmann, N0NB cba52fadf5 Remove default verbose setting of 2, call it when needed.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2834 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-02-14 23:41:19 +00:00
Nate Bargmann, N0NB 121f4a996b Implement and document Extended Response Protocol for rotctld
New test program, testrotctld.pl for rotctld
Implemented locator.c functions in rotctl and rotctld



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2831 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-02-14 22:18:00 +00:00
Stéphane Fillod, F8CFE bef812b7e4 report hamlib version upon startup
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2637 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-02-17 08:03:22 +00:00
Stéphane Fillod, F8CFE 025c1f4dd1 flexible command termination for send_cmd
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2557 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-04 14:49:17 +00:00
Stéphane Fillod, F8CFE f541b221fe new netrigctl/netrotctl protocol with return value
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2428 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-10-27 22:23:36 +00:00
Stéphane Fillod, F8CFE 4cbfe38c1d initial rotctld release (same idea as rigctld)
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2382 7ae35d74-ebe9-4afe-98af-79ac388436b8
2008-09-12 22:55:10 +00:00
Nate Bargmann, N0NB 6fb48baf21 Many man page updates to provide needed information and (hopefully)
improve readability.  Also, tried to keep the man pages as consistent
as possible.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2189 7ae35d74-ebe9-4afe-98af-79ac388436b8
2007-02-24 20:24:34 +00:00
Alexandru Csete OZ9AEC b0c3a5e439 - Cast unsigned char to char in order to avoid compiler warnings.
- Handle all enum values in switch statements.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2130 7ae35d74-ebe9-4afe-98af-79ac388436b8
2006-10-07 19:12:35 +00:00
Stéphane Fillod, F8CFE db0d861981 cleanup
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1736 7ae35d74-ebe9-4afe-98af-79ac388436b8
2004-05-17 20:59:41 +00:00
Stéphane Fillod, F8CFE 2772b035d0 misc fixes
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1434 7ae35d74-ebe9-4afe-98af-79ac388436b8
2003-04-07 20:54:18 +00:00
Nate Bargmann, N0NB 8d53121692 2003-02-26
Added:
		doc/README.rotorez -- backend to API document
	Updated:
		Added rot_set_conf support to rotorez.c
		Added interactive support for rot_set_conf in rotctl.c
		Updated rotctl.1 for changes.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1397 7ae35d74-ebe9-4afe-98af-79ac388436b8
2003-02-27 03:47:47 +00:00
Stéphane Fillod, F8CFE e13217367d fix for 8 bits cmd IDs
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1192 7ae35d74-ebe9-4afe-98af-79ac388436b8
2002-09-24 21:45:37 +00:00
Stéphane Fillod, F8CFE c36db76150 added ability to enter long command names in interactive mode, by prefixing them with a \
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1158 7ae35d74-ebe9-4afe-98af-79ac388436b8
2002-09-06 10:43:59 +00:00
Francois Retief e4bb8bfa09 Added rot_move function
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@869 7ae35d74-ebe9-4afe-98af-79ac388436b8
2002-01-16 17:08:31 +00:00
Stéphane Fillod, F8CFE 8ee1060e33 added get_info
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@861 7ae35d74-ebe9-4afe-98af-79ac388436b8
2002-01-14 07:00:55 +00:00
Stéphane Fillod, F8CFE cb67027f8c Initial release
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@827 7ae35d74-ebe9-4afe-98af-79ac388436b8
2001-12-28 20:34:30 +00:00