Commit Graph

492 Commits

Author SHA1 Message Date
Michael Black
4b69188f67 Fix some 64bit items and add RIG_FUNC_NB2 for TS-890S 2018-12-23 17:41:10 -05:00
Michael Black
7123bb4403 Change rmode_t to uint64_t and remove unneeded casts 2018-12-22 23:56:30 -05:00
Michael Black
2b5f01fb75 64 bit mods to netrigctl.c testrig.c 2018-12-21 23:51:54 -05:00
Michael Black
160c8f015d Fixup for 64-bit in memcsv.c 2018-12-21 17:19:22 -05:00
Michael Black
64b35ccbee Add PRXll macro for 64-bit use 2018-12-21 16:46:48 -05:00
Michael Black
422b266b9b Change RIG_MODE and RIG_FUNC to 64-bit values 2018-12-21 12:39:20 -05:00
Nate Bargmann
a915f1e69e Quell clang6 warning of format string not a literal
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.
2018-11-05 20:07:34 -06: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
Nate Bargmann
ac83428f7b Merge branch 'master' of https://github.com/JeroenVreeken/Hamlib 2018-08-05 21:11:40 -05:00
Nate Bargmann
478a7a25c1 Merge branch 'new_man_pages' 2018-07-29 22:11:31 -05:00
Nate Bargmann
f9b2f27373 Correct the -l option output header text 2018-07-29 21:38:54 -05:00
Jeroen Vreeken
9108deab8b Merge branch 'master' of github.com:Hamlib/Hamlib 2018-06-30 16:11:31 +02:00
Michael Black W9MDB
cd1fdfe6ce Allow rotctld to continue operationg aftr tcp or serial rig disappears 2018-05-09 07:31:42 -05:00
Michael Black W9MDB
a91e85e9fa Allow rigctld to continue operating after tcp or serial rig disappears 2018-05-08 22:37:32 -05:00
Jeroen Vreeken
9c7ce6eacb Merge branch 'master' of github.com:Hamlib/Hamlib 2018-05-06 00:12:23 +02:00
Nate Bargmann
5f05a0491e Move utility man page files to doc/man1
Maintain manual page files in the doc directory rather than the source
directories.
2018-04-30 07:19:59 -05:00
Nate Bargmann
743f67edaa Update man pages for content and conformance
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).
2018-04-29 22:41:50 -05:00
Michael Black W9MDB
35a28884f9 Fix -Z option on rigctld 2018-04-25 17:48:14 -05:00
Michael Black W9MDB
abca0653fd Fix compile warnings for tests 2018-04-22 18:38:16 -05:00
Michael Black W9MDB
9ba1f1a972 Fix compile warning on strings in 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
Jeroen Vreeken
bfa948ebc5 Add GPIO and GPION options for DCD.
Also bump abi version since the config params struct needed resizing.
2018-03-29 23:55:25 +02:00
Michael Black W9MDB
ca85f4740c Allow rigctld to reopen after error 2018-03-27 16:13:37 -05:00
Nate Bargmann
b0485aa475 Merge branch 'lazy-rigctld' of git://git.code.sf.net/u/bsomervi/hamlib into g4wjs-lazy-rigctld 2018-03-16 13:58:46 -05:00
Michael Black W9MDB
c1c5639c00 Fix morse send of a single space 2018-03-13 09:05:03 -04:00
Bill Somerville
489564a1af Make rig_open() call in rigctld lazy and add graceful termination
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.
2018-03-12 19:47:45 +00:00
Nate Bargmann
b692fb22ef Formatted tests/ to final coding guidelines 2017-10-06 18:58:42 -05:00
c vw
d008ca6e5d Microham support. Use "uh-rig" for rig_pathname to talk to the
microHam device for CAT. If you want hardware PTT via the microham
device, use DTR method and ptt_pathname "uh-ptt".
2017-09-10 19:56:59 -05:00
Nate Bargmann
d489b8bcb5 Apply formatting to 'tests/' directory
Format per style guide.
2017-08-10 05:46:12 -05:00
c vw
4838a349a6 This enables netrigctld to trigger two different CAT commands (Mic or DATA)
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.
2017-07-07 11:52:35 +02:00
Michael Black W9MDB
cab7eb1647 Fix FT-891/991 behavior with WSJT-X
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
2017-06-27 16:48:44 +01:00
Bill Somerville
2828422e92 Stop rigctld and rotctld crashing when service threads cannot write to clients
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.
2017-05-22 21:56:41 -05:00
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