Commit 20af4fbf authored by Ervin Hegedüs's avatar Ervin Hegedüs Committed by Christoph Berg

Import Debian changes 1.3.2-1

tlf (1.3.2-1) unstable; urgency=medium

  * Team upload.
  * New upstream release
  * Removed spelling-fixes.patch, all modifications had been merged
    to upstream
parents 677a348f 9a48a6b1
2018-11-10 Thomas Beierlein <tomjbe@gentoo.org>
* src/bandmap.c: Fix compiler warning from clang Calculation the difference
of two unsinged numbers gives an unsigned result. clang warns that doing an
abs() of it makes no sense. Thansk nate N0NB for reporting.
2018-11-04 Thomas Beierlein <tomjbe@gentoo.org>
* NEWS, configure.ac: update configure.ac and NEWS file
2018-11-03 zcsahok <ha5cqz@freemail.hu>
* test/functions.c: fix test: store message strings
2018-10-18 zcsahok <ha5cqz@freemail.hu>
* src/rules.c: avoid redefining _GNU_SOURCE
2018-11-01 zcsahok <ha5cqz@freemail.hu>
* src/sendqrg.c: fix SegV on missing RIGPORT
2018-10-29 Ervin Hegedus <airween@gmail.com>
* src/readcalls.c, tlf.1.in: Typo fixes
2018-10-20 Thomas Beierlein <tomjbe@gentoo.org>
* configure.ac: Check for cmocka test framework and warn if not installed
2018-10-16 Thomas Beierlein <tomjbe@gentoo.org>
* INSTALL: add build dependencies to install instructions
2018-10-13 Thomas Beierlein <tomjbe@gentoo.org>
* src/callinput.c, src/fldigixmlrpc.c, src/fldigixmlrpc.h, src/main.c: move
......
Tlf now comes with automake and autoconf.
Starting with TLF-1.0.0 you need pkg-config too.
Easiest way to install tlf is by typing:
Build Dependencies
------------------
Building TLF requires some other components to be installed before.
It depends on
* the _Hamlib_ library for controlling your radio,
* _ncurses_ and _tinfo_ for text screen handling,
* the _XMLRPC_C_ library for communication with programs like _FlDigi_ and
* _Glib-2.0_ for supporting C functions.
If you are using a distribution of the _Debian_ family make sure to install
also the needed header files with
----
sudo apt install libglib2.0-dev libhamlib-dev libncurses5-dev libtinfo-dev libxmlrpc-core-c3
----
While not a strict build dependency installing the following packages is
helpful too:
* _sox_ for audio signal handling during SSB contests and
* _xplanet_ which allows you to see the latest DX spots on the globe.
Quick Install
-------------
The easiest way to install tlf is by typing:
----
./configure
make
make install
----
If you want to compile tlf from the repo, please do a
----
autoreconf --install
----
before the above commands.
If support for Hamlib (>=1.2.8) is wanted, use
----
./configure --enable-hamlib
----
By default, tlf will install into /usr/local/bin, together with the
......@@ -31,7 +65,7 @@ will install tlf and scripts into /usr/bin, datafiles into /usr/share/tlf.
If you are doing a lot of contesting in digimodes using Fldigi there is support for reading the audio frequency via xmlrpc. Make sure to install XMLRPC-c and configure tlf with
----
./configure --enable-fldigi-xmlrpc
----
See doc/README for more details.
......@@ -196,7 +196,8 @@ CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/tlf.1.in AUTHORS COPYING ChangeLog INSTALL NEWS \
README compile config.guess config.sub install-sh missing
README compile config.guess config.sub depcomp install-sh \
missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
......@@ -250,6 +251,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_CFLAGS = @CURSES_CFLAGS@
......
tlf-1.3.2
=========
Bugfix release.
The release mainly fixes a number of bugs, which were discovered since
the release of tlf-1.3.1:
Minor corrections:
- Add build dependencies to INSTALL instructions
- check for cmocka testing framework in ./configure and warn if not
installed
- Minor syntax cleanup in code and documentation
Bug fixes:
- Fix segement violation if RIGPORT is undefined in logcfg.dat
- Fixes some test programs
- fix warnigns from clang about taking an abs() from an unsigned number
tlf-1.3.1
=========
......@@ -6,7 +26,7 @@ Maintenance and bugfix release.
Besides some fixed bugs and a lot of internal improvements it provides
some new features:
New features since tlf-1.2.3:
New features since tlf-1.3.0:
- Allow an arbitrary long string for 'RIGPORT' keyword Tnx Ed W3NR.
- Added keyword KEYER_BACKSPACE to allow use of backspace in
the keyer window.
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Tlf 1.3.1.
# Generated by GNU Autoconf 2.69 for Tlf 1.3.2.
#
# Report bugs to <tlf-devel@nongnu.org>.
#
......@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Tlf'
PACKAGE_TARNAME='tlf'
PACKAGE_VERSION='1.3.1'
PACKAGE_STRING='Tlf 1.3.1'
PACKAGE_VERSION='1.3.2'
PACKAGE_STRING='Tlf 1.3.2'
PACKAGE_BUGREPORT='tlf-devel@nongnu.org'
PACKAGE_URL='https://github.com/Tlf/tlf'
......@@ -635,6 +635,8 @@ HAMLIB_CFLAGS
PANEL_LIBS
CURSES_CFLAGS
CURSES_LIBS
CMOCKA_LIBS
CMOCKA_CFLAGS
GLIB_COMPILE_RESOURCES
GLIB_MKENUMS
GOBJECT_QUERY
......@@ -765,6 +767,8 @@ CPP
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
CMOCKA_CFLAGS
CMOCKA_LIBS
CURSES_LIBS
CURSES_CFLAGS
PANEL_LIBS
......@@ -1310,7 +1314,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Tlf 1.3.1 to adapt to many kinds of systems.
\`configure' configures Tlf 1.3.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1380,7 +1384,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Tlf 1.3.1:";;
short | recursive ) echo "Configuration of Tlf 1.3.2:";;
esac
cat <<\_ACEOF
......@@ -1419,6 +1423,9 @@ Some influential environment variables:
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
CMOCKA_CFLAGS
C compiler flags for CMOCKA, overriding pkg-config
CMOCKA_LIBS linker flags for CMOCKA, overriding pkg-config
CURSES_LIBS linker library for Curses, e.g. -lcurses
CURSES_CFLAGS
preprocessor flags for Curses, e.g. -I/usr/include/ncursesw
......@@ -1494,7 +1501,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Tlf configure 1.3.1
Tlf configure 1.3.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1917,7 +1924,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Tlf $as_me 1.3.1, which was
It was created by Tlf $as_me 1.3.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2780,7 +2787,7 @@ fi
# Define the identity of the package.
PACKAGE='tlf'
VERSION='1.3.1'
VERSION='1.3.2'
cat >>confdefs.h <<_ACEOF
......@@ -5484,6 +5491,102 @@ rm -f core conftest.err conftest.$ac_objext \
rm -f conf.glibtest
have_cmocka="yes"
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cmocka >= 1.1.0" >&5
$as_echo_n "checking for cmocka >= 1.1.0... " >&6; }
if test -n "$CMOCKA_CFLAGS"; then
pkg_cv_CMOCKA_CFLAGS="$CMOCKA_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cmocka >= 1.1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "cmocka >= 1.1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_CMOCKA_CFLAGS=`$PKG_CONFIG --cflags "cmocka >= 1.1.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$CMOCKA_LIBS"; then
pkg_cv_CMOCKA_LIBS="$CMOCKA_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cmocka >= 1.1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "cmocka >= 1.1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_CMOCKA_LIBS=`$PKG_CONFIG --libs "cmocka >= 1.1.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
CMOCKA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cmocka >= 1.1.0" 2>&1`
else
CMOCKA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cmocka >= 1.1.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$CMOCKA_PKG_ERRORS" >&5
have_cmocka="no"
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
have_cmocka="no"
else
CMOCKA_CFLAGS=$pkg_cv_CMOCKA_CFLAGS
CMOCKA_LIBS=$pkg_cv_CMOCKA_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
ac_fn_c_check_header_mongrel "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default"
if test "x$ac_cv_header_setjmp_h" = xyes; then :
fi
ac_fn_c_check_header_compile "$LINENO" "cmocka.h" "ac_cv_header_cmocka_h" "#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
"
if test "x$ac_cv_header_cmocka_h" = xyes; then :
else
have_cmocka="no"
fi
if test "${have_cmocka}" = "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: you will need cmocka for running unit tests" >&5
$as_echo "$as_me: WARNING: you will need cmocka for running unit tests" >&2;}
fi
# ncurses and panel required, if not found exit with error message.
......@@ -7972,7 +8075,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Tlf $as_me 1.3.1, which was
This file was extended by Tlf $as_me 1.3.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -8039,7 +8142,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
Tlf config.status 1.3.1
Tlf config.status 1.3.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
# Process this file with autoconf to produce a configure script.
AC_INIT([Tlf],
[1.3.1],
[1.3.2],
[tlf-devel@nongnu.org],
[tlf],
[https://github.com/Tlf/tlf])
......@@ -59,6 +59,20 @@ dnl From /usr/share/aclocal/glib-2.0.m4 on Debian 8.0.
dnl Provides compilation testing of the found glib library for suitability.
AM_PATH_GLIB_2_0
dnl check for cmocka test framework and warn if not installed
have_cmocka="yes"
PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.0],,[have_cmocka="no"])
AC_CHECK_HEADER([setjmp.h])
AC_CHECK_HEADER([cmocka.h],, [have_cmocka="no"],
[#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
])
if test "${have_cmocka}" = "no"; then
AC_MSG_WARN([you will need cmocka for running unit tests])
fi
# ncurses and panel required, if not found exit with error message.
......
tlf (1.3.2-1) unstable; urgency=medium
* Team upload.
* New upstream release
* Removed spelling-fixes.patch, all modifications had been merged
to upstream
-- Ervin Hegedus <airween@gmail.com> Thu, 13 Dec 2018 20:57:07 +0000
tlf (1.3.1-1) unstable; urgency=medium
* Team upload.
......
scripts.patch
spelling-fixes.patch
Description: Fix spelling errorsa to optional
Author: Ervin Hegedus <airween@gmail.com>
--- tlf-1.3.1.orig/src/readcalls.c
+++ tlf-1.3.1/src/readcalls.c
@@ -678,7 +678,7 @@ int synclog(char *synclogfile) {
sprintf(wgetcmd, "cat log1 log2 | sort -g -k4,4 | uniq > %s",
logfile);
if (system(wgetcmd) == 0)
- showmsg("Merging logs successfull\n");
+ showmsg("Merging logs successful\n");
else {
showmsg("Problem merging logs.\nExiting...\n");
sleep(5);
--- tlf-1.3.1.orig/tlf.1.in
+++ tlf-1.3.1/tlf.1.in
@@ -1415,7 +1415,7 @@ The rules file overrides settings from t
file!
.P
.B WARNING!
-It is your own reponsibility to try these rules well BEFORE the contest.
+It is your own responsibility to try these rules well BEFORE the contest.
The authors of @PACKAGE_NAME@ cannot possibly check all rules for all
contests :) and during the contest there is normally no time to fix it.
.
@@ -1832,7 +1832,7 @@ Some contests have a special multipliers
by excluding a predefined set. For example, the main set could be
.BR COUNTRY_MULT ,
and you need to exclude from that list just a few countries, e.g. the SAC
-contest excludes the Scandinavian contries as they are not multipliers). In
+contest excludes the Scandinavian countries as they are not multipliers). In
that case you can use this configuration:
.br
\fBCOUNTRY_MULT\fR
@@ -1968,7 +1968,7 @@ Save the
.I master.scp
file as
.I callmaster
-in the working directory. It will take precendence over the system installed
+in the working directory. It will take precedence over the system installed
.IR callmaster .
.
.P
......@@ -166,6 +166,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_CFLAGS = @CURSES_CFLAGS@
......
......@@ -226,6 +226,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_CFLAGS = @CURSES_CFLAGS@
......
......@@ -166,6 +166,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_CFLAGS = @CURSES_CFLAGS@
......
......@@ -166,6 +166,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_CFLAGS = @CURSES_CFLAGS@
......
......@@ -215,6 +215,8 @@ AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CMOCKA_CFLAGS = @CMOCKA_CFLAGS@
CMOCKA_LIBS = @CMOCKA_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURSES_CFLAGS = @CURSES_CFLAGS@
......
......@@ -45,6 +45,8 @@
#define SPOT_CALL_WIDTH SPOT_COLUMN_WIDTH-SPOT_FREQ_WIDTH-4
/* 3 space before and 1 after call */
#define DISTANCE(x, y) \
( x < y ? y - x : x -y )
pthread_mutex_t bm_mutex = PTHREAD_MUTEX_INITIALIZER;
......@@ -319,7 +321,7 @@ void bandmap_addspot(char *call, unsigned int freq, char node) {
if (found) {
((spot *)found->data)->timeout = SPOT_NEW;
((spot *)found->data)->node = node;
if (abs(((spot *)found->data)->freq - freq) > TOLERANCE) {
if (DISTANCE(((spot *)found->data)->freq, freq) > TOLERANCE) {
((spot *)found->data)->freq = freq;
allspots = g_list_sort(allspots, (GCompareFunc)cmp_freq);
}
......@@ -378,7 +380,7 @@ void bandmap_addspot(char *call, unsigned int freq, char node) {
/* check that spot is unique on freq +/- TOLERANCE Hz,
* drop other entries if needed */
if (found->prev &&
(abs(((spot *)(found->prev)->data)->freq - freq) < TOLERANCE)) {
(DISTANCE(((spot *)(found->prev)->data)->freq, freq) < TOLERANCE)) {
spot *olddata;
olddata = found->prev->data;
allspots = g_list_remove_link(allspots, found->prev);
......@@ -387,7 +389,7 @@ void bandmap_addspot(char *call, unsigned int freq, char node) {
g_free(olddata);
}
if (found->next &&
(abs(((spot *)(found->next)->data)->freq - freq) < TOLERANCE)) {
(DISTANCE(((spot *)(found->next)->data)->freq, freq) < TOLERANCE)) {
spot *olddata;
olddata = found->next->data;
allspots = g_list_remove_link(allspots, found->next);
......
......@@ -678,7 +678,7 @@ int synclog(char *synclogfile) {
sprintf(wgetcmd, "cat log1 log2 | sort -g -k4,4 | uniq > %s",
logfile);
if (system(wgetcmd) == 0)
showmsg("Merging logs successfull\n");
showmsg("Merging logs successful\n");
else {
showmsg("Problem merging logs.\nExiting...\n");
sleep(5);
......
......@@ -19,7 +19,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE // For asprintf()
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -32,6 +32,11 @@
void send_bandswitch(int trxqrg);
#ifdef HAVE_LIBHAMLIB //code for Hamlib interface
static int parse_rigconf();
static void debug_tlf_rig();
#endif
/* check if call input field contains a frequency value and switch to it.
*
*/
......@@ -66,7 +71,6 @@ int sendqrg(void) {
int init_tlf_rig(void) {
extern RIG *my_rig;
extern rig_model_t myrig_model;
extern char rigconf[];
extern int serial_rate;
extern char *rigportname;
extern int debugflag;
......@@ -79,9 +83,6 @@ int init_tlf_rig(void) {
const char *ptt_file = NULL, *dcd_file = NULL;
dcd_type_t dcd_type = RIG_DCD_NONE;
char *cnfparm, *cnfval;
int rigconf_len, i;
const struct rig_caps *caps;
/*
......@@ -92,21 +93,19 @@ int init_tlf_rig(void) {
my_rig = rig_init(myrig_model);
if (!my_rig) {
shownr("Unknown rig num %d", (int) myrig_model);
return (-1);
} else {
if (strlen(rigportname) > 1) {
rigportname[strlen(rigportname) - 1] = '\0'; // remove '\n'
strncpy(my_rig->state.rigport.pathname, rigportname,
FILPATHLEN);
} else {
showmsg("Missing rig port name!");
return (-1);
}
shownr("Unknown rig model", (int) myrig_model);
return -1;
}
if (rigportname == NULL || strlen(rigportname) == 0) {
showmsg("Missing rig port name!");
return -1;
}
rigportname[strlen(rigportname) - 1] = '\0'; // remove '\n'
strncpy(my_rig->state.rigport.pathname, rigportname,
FILPATHLEN);
caps = my_rig->caps;
/* If CAT PTT is wanted, test for CAT capability of rig backend. */
......@@ -128,40 +127,16 @@ int init_tlf_rig(void) {
my_rig->state.rigport.parm.serial.rate = serial_rate;
cnfparm = cnfval = rigconf;
rigconf_len = strlen(rigconf);
for (i = 0; i < rigconf_len; i++) {
/* FIXME: left hand value of = cannot be null */
if (rigconf[i] == '=' && cnfval == cnfparm) {
cnfval = rigconf + i + 1;
rigconf[i] = '\0';
continue;
}
if (rigconf[i] == ',' || i + 1 == rigconf_len) {
if (cnfval <= cnfparm) {
showstring("Missing parm value in RIGCONF: ", rigconf);
return (-1);
}
if (rigconf[i] == ',')
rigconf[i] = '\0';
retcode =
rig_set_conf(my_rig, rig_token_lookup(my_rig, cnfparm),
cnfval);
if (retcode != RIG_OK) {
showmsg("rig_set_conf: error ");
return (-1);
}
cnfparm = cnfval = rigconf + i + 1;
continue;
}
// parse RIGCONF parameters
if (parse_rigconf() < 0) {
return -1;
}
retcode = rig_open(my_rig);
if (retcode != RIG_OK) {
showmsg("rig_open: error ");
return (-1);
return -1;
}
rigfreq = 0.0;
......@@ -173,49 +148,14 @@ int init_tlf_rig(void) {
if (retcode != RIG_OK) {
showmsg("Problem with rig link!");
if (!debugflag)
return (-1);
return -1;
}
shownr("freq =", (int) rigfreq);
if (debugflag == 1) { // debug routines
sleep(10);
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &rigfreq);
if (retcode != RIG_OK) {
showmsg("Problem with rig get freq!");
sleep(1);
} else {
shownr("freq =", (int) rigfreq);
}
sleep(10);
const freq_t testfreq = 14000000; // test set frequency
retcode = rig_set_freq(my_rig, RIG_VFO_CURR, testfreq);
if (retcode != RIG_OK) {
showmsg("Problem with rig set freq!");
sleep(1);
} else {
showmsg("Rig set freq ok!");
}
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &rigfreq); // read qrg
if (retcode != RIG_OK) {
showmsg("Problem with rig get freq!");
sleep(1);
} else {
shownr("freq =", (int) rigfreq);
if (rigfreq != testfreq) {
showmsg("Failed to set rig freq!");
}
}
sleep(10);
} // end debug
if (debugflag) { // debug rig control
debug_tlf_rig();
}
switch (trxmode) {
case SSBMODE:
......@@ -230,7 +170,7 @@ int init_tlf_rig(void) {
}
sleep(1);
return (0);
return 0;
}
int close_tlf_rig(RIG *my_rig) {
......@@ -239,10 +179,93 @@ int close_tlf_rig(RIG *my_rig) {
rig_close(my_rig); /* close port */
rig_cleanup(my_rig); /* if you care about memory */
printf("port %s closed ok \n", rigportname);
printf("Rig port %s closed ok\n", rigportname);
return (0);
return 0;
}
#endif // end code for Hamlib interface
static int parse_rigconf() {
extern char rigconf[];
extern RIG *my_rig;
char *cnfparm, *cnfval;
const int rigconf_len = strlen(rigconf);
int i;
int retcode;
cnfparm = cnfval = rigconf;
for (i = 0; i < rigconf_len; i++) {
/* FIXME: left hand value of = cannot be null */
if (rigconf[i] == '=' && cnfval == cnfparm) {
cnfval = rigconf + i + 1;
rigconf[i] = '\0';