Wykres commitów

460 Commity (Hamlib-3.1)

Autor SHA1 Wiadomość Data
Michael Black 35fda10dfd Fixed buffer overflow in rigctl_parse and rotctl_parse 2016-11-01 16:02:15 -05:00
Jeroen Vreeken 1bf736d650 Add support for GPIO PTT. 2016-05-28 16:00:03 +02: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
Bill Somerville 21c346453a Implement combined split VFO frequency and mode setting.
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.
2016-03-23 17:09:26 +00:00
Nate Bargmann 4595f77f99 Touch up rigctld.c and rotctld.c with astyle
Prior reformat had only been a reindent with Emacs.  Now use astyle.
2016-02-14 18:05:55 -06:00
Nate Bargmann 9b45fce776 Reformat rigctld.c and rotctld.c
Several lines in each file benefitted from formatting so just reformat
the entire files into Linux C Style.
2016-02-12 20:46:38 -06:00
Bill Somerville e4e17ce862 Improve IPv6 portability and consistency
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.
2016-02-12 20:20:25 -06:00
Bill Somerville 04c545b9b9 Only use IPv6 features on Windows versions that support it (>=XP) 2016-02-12 15:30:41 +00:00
Nate Bargmann cc21c64662 Advise on use of int64_t cast
Advise on testing with clang compiler and using int64_t cast with PRIll
macro.

Fix GCC warning when 'make distcheck' is run.
2016-02-09 11:26:23 -06:00
Michael Black 95a99fa37d Quell clang warnings in tests directory
Remove unnecessary parentheses in memcsv.c.

Fix cfp->u.c.combostr as old check was always true since it's statically
allocated.

RRR
Mike W9MDB
2016-02-09 11:12:28 -06:00
Nate Bargmann efb7860e4d Install daemon man files to man1
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.
2016-01-12 15:53:53 -06:00
Bill Somerville aebe52a45e Add a new command line option '--no-restore-ai' ('-n') to rigctl
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.
2015-12-04 00:22:01 +00:00
Bill Somerville 6061cae8df Proper IPv6 and dual stack networking for rotator net daemon
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.
2015-11-27 19:41:04 +00:00
Bill Somerville ca7cbd89f4 Fix compiler warnings 2015-11-27 19:17:47 +00:00
Bill Somerville 181a3e9697 Proper IPv6 and dual stack networking
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.
2015-11-27 13:47:48 +00:00
Nate Bargmann 81775bc03d Add library paths for tests.
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.
2015-09-03 12:03:53 -05:00
Stephane Fillod 5b5386c711 rigctl: help "?" at set_vfo/set_split_vfo prompt 2015-02-19 23:52:13 +01:00
Bill Somerville 182a014597 Fix manpage errors. 2014-05-02 20:06:35 +01:00
Bill Somerville e939279c4c Add read commands from stdin and pause command features to rotctl.
The capability to read commands from  standard input and the new pause
command allow regression tests to be written for rotctl as well as for
rigctl.
2014-05-02 19:44:29 +01:00
Bill Somerville 68ec5b272f Corrected typos in rigctl.1 manpage. 2014-05-02 19:43:35 +01:00
Bill Somerville 6e17923dd4 Prefix action function names so as not to clash with system names.
The prefix rigctl_ is added to all parser action routine names so that
they do not clash with system names.
2014-05-02 19:16:28 +01:00
Bill Somerville 2fe2587ee5 Add a pause command to the rigctl command set.
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.
2014-05-02 18:41:50 +01:00
Bill Somerville f9ad2c21d9 Facility for rigctl to read commands from standard input.
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.
2014-04-30 03:05:34 +01: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 6ea09a138a Clean up build system, fix test programs
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.
2013-12-10 20:14:22 -06:00
Nate Bargmann f66da71719 Honor LIBUSB_LIBS when set by user
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.
2013-09-23 14:27:31 -05:00
Nate Bargmann c39b51327b Revise test for MinGW with sleep()
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.
2013-09-19 21:59:42 -05:00
Nate Bargmann 1bac099494 Remove remaining references to rpc
As rpc backends were removed some time ago, remove all remaining
documentation and other references to rpc.
2013-09-19 15:24:52 -05:00
Nate Bargmann 36f5f4cf6a Revert to previous handling of getaddrinfo()
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.
2013-09-15 19:47:49 -05:00
Remi Chateauneu 60019c9444 Monolitic libraries. 2013-09-08 14:56:28 +01:00
Nate Bargmann 1fd85febee MinGW build: Fix sleep() substitution
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.
2013-07-29 12:38:22 -05:00
Nate Bargmann ea97c7c3e9 Preserve CFLAGS & CXXFLAGS for the configure user
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.
2013-05-25 06:00:36 -05:00
Nate Bargmann b9ff04abf0 Fix W2k 'freeaddrinfo' error
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
2013-05-18 07:31:40 -05:00
Nate Bargmann 2d6361397b Link to Pthread-win32 library in MinGW
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.
2013-05-17 21:34:24 -05:00
Nate Bargmann 245ab86441 Quell compiler warnings on Cygwin
Quell mostly harmless warnings from the older GCC installed in Cygwin.
Produces a quiet compilation.
2013-05-09 22:06:39 -05:00
Nate Bargmann 69c2ceb957 Set LD_LIBRARY_PATH for test programs
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'.
2013-05-07 22:22:07 -05:00
Nate Bargmann 2f8b6c8d51 Quell compiler warnings in test programs 2013-05-07 21:35:06 -05:00
Nate Bargmann 911497ba85 man page corrections 2013-03-13 15:02:43 -05:00
Nate Bargmann 7ebe65fee8 rotctl.1: Document Readline and history additions
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.
2013-02-22 21:35: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 991d1ea24c rigctl.1: Document Readline and history additions
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.
2013-02-22 21:06:30 -06:00
Nate Bargmann 9f342cfd23 rigctl.c: Add options to save/read command history
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.
2013-02-22 21:06:30 -06:00
Nate Bargmann 978a269689 rigctl_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 17:26:32 -06:00
Nate Bargmann d54d737ba5 rigctl_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 rigctl in interactive mode.  Passing rig commands from the rigctl
command line and rigctld use the original input handling which has not
been modified.
2013-02-22 17:26:32 -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 477c9c7b28 Update rigctl/d man pages for querying certain parameters
The rigctl and rigctld programs support a so far undocumented feature of
being able to query supported modes in set_mode and set_split_mode,
Funcs in set_func and get_func, Levels in set_level and get_level, Parms
in set_parm and get_parm, as well as the vfo_op, scan, ans set_trn
functions.  The query may be used to get a list of supported tokens for
a given function by a rig backend.
2013-01-23 18:42:10 -06:00
Nate Bargmann f82184cbf5 Add RIT and XIT as rig_set/get_func() members
In response to a long standing request from Tor, N4OGW, and others, RIT
and XIT are added as members for the rig_set/get_func() members.
"RIT"/"XIT" have been added as tokens.  The dummy rig backend and
testrig.c have been updated for these new functions.

Applications should test a backend with the rig_has_set/get_func() and
test for RIG_FUNC_RIT or RIG_FUNC_XIT.  A non-zero result indicates
these functions are implemented by a given rig backend.  It will take
some time for all backends to migrate to this new implementation.  Once
implemented, RIT or XIT should be set to '0' to 'clear' the value
without deactivating the rig's RIT/XIT function.  The dummy/dummy.c file
can be used as a simple guide for backend authors implementing this
behavior.
2013-01-15 12:47:47 -06:00
Nate Bargmann e2bb0106a2 rigctl.1, rotctl.1: Document Q and q commands
Document expected behavior when the Q or q command is given.

Thanks to Jim, N2ADR, for the report.
2012-10-27 22:30:05 -05:00