Merge branch 'master' into rotator-speed-control-and-status

pull/453/head
Mikael Nousiainen 2020-12-02 21:46:23 +02:00
commit bb315270bf
77 zmienionych plików z 863 dodań i 521 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ SUBDIRS = macros include lib \
tests doc
## Static list of distributed directories.
DIST_SUBDIRS = macros include lib src c++ bindings tests doc android scripts \
DIST_SUBDIRS = macros include lib src c++ bindings tests doc android scripts rotators/indi \
$(BACKEND_LIST) $(RIG_BACKEND_LIST) $(ROT_BACKEND_LIST) $(AMP_BACKEND_LIST)
# Install any third party macros into our tree for distribution

3
NEWS
Wyświetl plik

@ -7,10 +7,11 @@ Copyright (C) 2000-2020 Michael Black W9MDB, and others
Please send Hamlib bug reports to hamlib-developer@lists.sourceforge.net
Version 4.0
2020-09-??
2020-11-29
* API/ABI changes, advance ABI to 4 0 0.
* Add GPIO and GPION options for DCD. Jeroen Vreeken
* New backend: ELAD FDM DUO. Giovanni, HB9EIK.
* All channel functions now take a vfo argument
* New rotator backend: iOptron. Bob, KD8CGH
* New model: Icom IC-R8600. Ekki, DF4OR
* New utility: rigctlcom. Mike, W9MDB

Wyświetl plik

@ -460,11 +460,11 @@ typedef channel_t * const_channel_t_p;
}
void set_channel(const struct channel *chan) {
self->error_status = rig_set_channel(self->rig, chan);
self->error_status = rig_set_channel(self->rig, RIG_VFO_NONE, chan);
}
void get_channel(struct channel *chan, int read_only) {
self->error_status = rig_get_channel(self->rig, chan, read_only);
self->error_status = rig_get_channel(self->rig, RIG_VFO_NONE, chan, read_only);
/* TODO: handle ext_level's */
}
@ -473,7 +473,7 @@ typedef channel_t * const_channel_t_p;
}
void get_chan_all(struct channel *chans) {
self->error_status = rig_get_chan_all(self->rig, chans);
self->error_status = rig_get_chan_all(self->rig, RIG_VFO_NONE, chans);
/* TODO: handle ext_level's */
}
@ -495,7 +495,7 @@ typedef channel_t * const_channel_t_p;
self->error_status = -RIG_ENOMEM;
return NULL;
}
self->error_status = rig_get_channel(self->rig, chan, read_only);
self->error_status = rig_get_channel(self->rig, RIG_VFO_NONE, chan, read_only);
/* TODO: copy ext_level's */
return chan;
}
@ -613,7 +613,7 @@ struct channel *Rig_get_chan_all(Rig *self)
self->error_status = -RIG_ENOMEM;
return NULL;
}
self->error_status = rig_get_chan_all(self->rig, chans);
self->error_status = rig_get_chan_all(self->rig, RIG_VFO_NONE, chans);
/* TODO: copy ext_level's */
return chans;
}

Wyświetl plik

@ -643,14 +643,14 @@ int Rig::getMem (vfo_t vfo)
return mem;
}
void Rig::setChannel (const channel_t *chan)
void Rig::setChannel (const channel_t *chan, vfo_t vfo)
{
CHECK_RIG( rig_set_channel(theRig, chan) );
CHECK_RIG( rig_set_channel(theRig, vfo, chan) );
}
void Rig::getChannel (channel_t *chan, int readOnly)
void Rig::getChannel (channel_t *chan,vfo_t vfo, int readOnly)
{
CHECK_RIG( rig_get_channel(theRig, chan, readOnly) );
CHECK_RIG( rig_get_channel(theRig, vfo, chan, readOnly) );
}

Wyświetl plik

@ -15,10 +15,10 @@ dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
AC_INIT([Hamlib],
[4.1~git],
[hamlib-developer@lists.sourceforge.net],
[hamlib],
[http://www.hamlib.org])
[4.1~git],
[hamlib-developer@lists.sourceforge.net],
[hamlib],
[http://www.hamlib.org])
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros])
@ -195,38 +195,38 @@ hl_oldLibs=$LIBS
AC_CHECK_FUNC([connect], [hl_checkSocket=0], [hl_checkSocket=1])
AS_IF([test "$hl_checkSocket" = 1], [
AC_CHECK_LIB([socket],
[main],
[NET_LIBS="$NET_LIBS -lsocket"],
[hl_checkBoth=1],
[])
])
AC_CHECK_LIB([socket],
[main],
[NET_LIBS="$NET_LIBS -lsocket"],
[hl_checkBoth=1],
[])
])
AS_IF([test "$hl_checkBoth" = 1], [
hl2_oldLibs=$LIBS
LIBS="$LIBS -lsocket -lnsl"
AC_CHECK_FUNC([accept], [hl_checkNsl=0], [LIBS=$hl2_oldLibs])
])
hl2_oldLibs=$LIBS
LIBS="$LIBS -lsocket -lnsl"
AC_CHECK_FUNC([accept], [hl_checkNsl=0], [LIBS=$hl2_oldLibs])
])
# separate Name Service Library
AC_CHECK_FUNC([gethostbyname],
[],
[AC_CHECK_LIB([nsl],
[main],
[NET_LIBS="$NET_LIBS -lnsl"],
[],
[])
])
[],
[AC_CHECK_LIB([nsl],
[main],
[NET_LIBS="$NET_LIBS -lnsl"],
[],
[])
])
# Winsock2 32 bit
AC_CHECK_FUNC([gethostbyname],
[],
[AC_CHECK_LIB([ws2_32],
[main],
[NET_LIBS="$NET_LIBS -lws2_32"],
[],
[])
])
[],
[AC_CHECK_LIB([ws2_32],
[main],
[NET_LIBS="$NET_LIBS -lws2_32"],
[],
[])
])
LIBS="$LIBS $NET_LIBS"
@ -274,24 +274,24 @@ LT_INIT([win32-dll])
dnl The host_os variable is set by the AC_CANONICAL_HOST macro above.
AS_CASE(["$host_os"],
[freebsd*], [
AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}"
AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib"
AC_SUBST([AM_LDFLAGS])],
AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}"
AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib"
AC_SUBST([AM_LDFLAGS])],
[darwin* | rhapsody*], [
# Tell the OS X linker to allocate enough space inside the
# libhamlib.X.dylib shared object for install_name_tool(1) to
# work. This is useful when including hamlib in an app bundle.
OSXLDFLAGS="-Wl,-headerpad_max_install_names"
AC_SUBST([OSXLDFLAGS])],
# Tell the OS X linker to allocate enough space inside the
# libhamlib.X.dylib shared object for install_name_tool(1) to
# work. This is useful when including hamlib in an app bundle.
OSXLDFLAGS="-Wl,-headerpad_max_install_names"
AC_SUBST([OSXLDFLAGS])],
[mingw* | pw32* | cygwin*], [
WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias"
AC_SUBST([WINLDFLAGS])
WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias"
AC_SUBST([WINLDFLAGS])
# Enable ld's "auto import" for executables
WINEXELDFLAGS="-Wl,--enable-auto-import"
AC_SUBST([WINEXELDFLAGS])
# Enable ld's "auto import" for executables
WINEXELDFLAGS="-Wl,--enable-auto-import"
AC_SUBST([WINEXELDFLAGS])
])
@ -303,20 +303,20 @@ dnl Check if C99 struct initializers are supported
AC_MSG_CHECKING([whether C99 struct/array initializers are supported])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[struct{char a;int b;}s[8]={[3]={.b=5}};]])],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR([""
[[struct{char a;int b;}s[8]={[3]={.b=5}};]])],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR([""
"You need a C99 compliant C compiler that supports struct/array initializers."
"Have you considered GCC lately?."])
])
])
dnl Check for libusb, treat LIBUSB_LIBS and LIBUSB_CFLAGS as precious variables
AC_MSG_CHECKING([whether to build USB dependent backends])
AC_ARG_WITH([libusb],
[AS_HELP_STRING([--without-libusb],
[disable USB dependent backends @<:@default=yes@:>@])],
[cf_with_libusb=no],
[cf_with_libusb=yes]
[disable USB dependent backends @<:@default=yes@:>@])],
[cf_with_libusb=no],
[cf_with_libusb=yes]
)
AC_MSG_RESULT([$cf_with_libusb])
@ -327,16 +327,16 @@ AC_ARG_VAR([LIBUSB_LIBS], [linker flags for libusb, overriding configure check (
AS_IF([test x"${cf_with_libusb}" = "xyes"],
[AS_IF([test -z $LIBUSB_LIBS],
[AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBUSB_LIBS="-lusb-1.0"],
[AC_MSG_WARN([libusb_init was not found in libusb-1.0--USB backends will be disabled])])
], [cf_with_libusb="yes"])
[AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBUSB_LIBS="-lusb-1.0"],
[AC_MSG_WARN([libusb_init was not found in libusb-1.0--USB backends will be disabled])])
], [cf_with_libusb="yes"])
AS_IF([test x"${cf_with_libusb}" = "xyes"],
[AC_CHECK_HEADERS([libusb.h libusb-1.0/libusb.h])
AC_DEFINE([HAVE_LIBUSB],
[1],
[Define if libusb-1.0 is available])
LIBUSB="libusb-1.0"])])
[AC_CHECK_HEADERS([libusb.h libusb-1.0/libusb.h])
AC_DEFINE([HAVE_LIBUSB],
[1],
[Define if libusb-1.0 is available])
LIBUSB="libusb-1.0"])])
# Only used in hamlib.pc.in
AC_SUBST([LIBUSB])
@ -346,9 +346,9 @@ dnl Check if readline support in rigctl/rotctl is wanted
AC_MSG_CHECKING([whether to use readline in rigctl/rotctl])
AC_ARG_WITH([readline],
[AS_HELP_STRING([--without-readline],
[disable readline in rigctl/rotctl @<:@default=yes@:>@])],
[cf_with_readline_support=no],
[cf_with_readline_support=yes]
[disable readline in rigctl/rotctl @<:@default=yes@:>@])],
[cf_with_readline_support=no],
[cf_with_readline_support=yes]
)
AC_MSG_RESULT([$cf_with_readline_support])
@ -367,16 +367,16 @@ dnl Check if INDI support in rigctl/rotctl is wanted
AC_MSG_CHECKING([whether to use INDI in rigctl/rotctl])
AC_ARG_WITH([indi],
[AS_HELP_STRING([--without-indi],
[disable INDI in rigctl/rotctl @<:@default=yes@:>@])],
[cf_with_indi_support=no],
[cf_with_indi_support=yes]
[disable INDI in rigctl/rotctl @<:@default=yes@:>@])],
[cf_with_indi_support=no],
[cf_with_indi_support=yes]
)
AS_IF([test x"$cf_with_indi_support" != "xno"], [
# INDI support needs a C++ compiler, tested for presence above.
AS_IF([test x"${cf_with_cxx}" != "xyes"], [
AC_MSG_WARN([INDI support needs a C++ compiler.])
cf_with_indi_support=no
AC_MSG_WARN([INDI support needs a C++ compiler.])
cf_with_indi_support=no
])
])
@ -385,22 +385,22 @@ AS_IF([test x"$cf_with_indi_support" != "xno"], [
AX_LIB_NOVA
AS_IF([test x"$ax_cv_lib_nova" = "xno"], [
AC_MSG_WARN([libnova support not found, required by INDI.])
cf_with_indi_support=no
])
AC_MSG_WARN([libnova support not found, required by INDI.])
cf_with_indi_support=no
])
AS_IF([test x"$ax_cv_lib_nova" != "xno"], [
# macros/ax_lib_indi.m4
AX_LIB_INDI
# macros/ax_lib_indi.m4
AX_LIB_INDI
AS_IF([test x"$ax_cv_lib_indi" = "xno"], [
AC_MSG_WARN([INDI support not found.])
cf_with_indi_support=no
])
AS_IF([test x"$ax_cv_lib_indi" = "xno"], [
AC_MSG_WARN([INDI support not found.])
cf_with_indi_support=no
])
AS_IF([test x"$cf_with_indi_support" != "xno"], [
ROT_BACKEND_LIST="$ROT_BACKEND_LIST rotators/indi"
])
AS_IF([test x"$cf_with_indi_support" != "xno"], [
ROT_BACKEND_LIST="$ROT_BACKEND_LIST rotators/indi"
])
])
])
@ -408,22 +408,22 @@ dnl Check if libgd-dev is installed, so we can enable rigmatrix
AC_MSG_CHECKING([whether to build HTML rig feature matrix])
AC_ARG_ENABLE([html-matrix],
[AS_HELP_STRING([--disable-html-matrix],
[do not generate HTML rig feature matrix (requires libgd-dev) @<:@default=check@:>@])],
[cf_enable_html_matrix=no],
[cf_enable_html_matrix=check]
[do not generate HTML rig feature matrix (requires libgd-dev) @<:@default=check@:>@])],
[cf_enable_html_matrix=no],
[cf_enable_html_matrix=check]
)
AC_MSG_RESULT([$cf_enable_html_matrix])
AS_IF([test x"$cf_enable_html_matrix" != "xno"],
[AC_CHECK_HEADERS([gd.h],
[AC_CHECK_LIB([gd],
[gdImageCreate],
[cf_enable_html_matrix=yes],
[cf_enable_html_matrix=no],
[-lz])],
[cf_enable_html_matrix=no]
)
[AC_CHECK_LIB([gd],
[gdImageCreate],
[cf_enable_html_matrix=yes],
[cf_enable_html_matrix=no],
[-lz])],
[cf_enable_html_matrix=no]
)
])
AM_CONDITIONAL([HTML_MATRIX], [test x"${cf_enable_html_matrix}" = "xyes"])
@ -439,10 +439,10 @@ dnl Test for pkg-config only when these features are enabled.
# libxml2 required rigmem xml support, make it user optional
AC_MSG_CHECKING([whether to build rigmem XML support])
AC_ARG_WITH([xml-support],
[AS_HELP_STRING([--with-xml-support],
[build rigmem with XML support @<:@default=no@:>@])],
[cf_with_xml_support=$withval],
[cf_with_xml_support=no])
[AS_HELP_STRING([--with-xml-support],
[build rigmem with XML support @<:@default=no@:>@])],
[cf_with_xml_support=$withval],
[cf_with_xml_support=no])
AC_MSG_RESULT([$cf_with_xml_support])
@ -450,10 +450,10 @@ AC_MSG_RESULT([$cf_with_xml_support])
AS_IF([test x"${cf_with_cxx}" = "xyes"], [
AC_MSG_CHECKING([whether to build USRP backend])
AC_ARG_ENABLE([usrp],
[AS_HELP_STRING([--enable-usrp],
[build USRP backend @<:@default=no@:>@])],
[cf_with_usrp=$enableval],
[cf_with_usrp="no"])
[AS_HELP_STRING([--enable-usrp],
[build USRP backend @<:@default=no@:>@])],
[cf_with_usrp=$enableval],
[cf_with_usrp="no"])
AC_MSG_RESULT([$cf_with_usrp])
])
@ -466,28 +466,28 @@ dnl http://lists.gnu.org/archive/html/automake/2011-03/msg00008.html
dnl
dnl Check for pkg-config program, used for configuring some libraries.
m4_define_default([PKG_PROG_PKG_CONFIG],
[AC_MSG_CHECKING([pkg-config])
AC_MSG_RESULT([no])])
[AC_MSG_CHECKING([pkg-config])
AC_MSG_RESULT([no])])
PKG_PROG_PKG_CONFIG
dnl If the pkg-config autoconf support isn't installed, define its
dnl autoconf macro to disable any packages depending on it.
m4_define_default([PKG_CHECK_MODULES],
[AC_MSG_CHECKING([$1])
AC_MSG_RESULT([no])
$4])
[AC_MSG_CHECKING([$1])
AC_MSG_RESULT([no])
$4])
])
AS_IF([test x"${cf_with_xml_support}" = "xyes"], [
PKG_CHECK_MODULES([LIBXML2],
[libxml-2.0],
[AC_DEFINE([HAVE_XML2],
[1],
[Define if libxml2 is available])],
[AC_MSG_WARN([libxml-2.0 pkg-config not found, XML support will be disabled])
])
[libxml-2.0],
[AC_DEFINE([HAVE_XML2],
[1],
[Define if libxml2 is available])],
[AC_MSG_WARN([libxml-2.0 pkg-config not found, XML support will be disabled])
])
])
AC_SUBST([LIBXML2_LIBS])
@ -515,10 +515,10 @@ dnl Check if cxx-binding not wanted, default is to build it
# C++ binding
AC_MSG_CHECKING([whether to build C++ binding])
AC_ARG_WITH([cxx-binding],
[AS_HELP_STRING([--without-cxx-binding],
[do not build C++ binding @<:@default=yes@:>@])],
[cf_with_cxx_binding=$withval],
[cf_with_cxx_binding=$cf_with_cxx])
[AS_HELP_STRING([--without-cxx-binding],
[do not build C++ binding @<:@default=yes@:>@])],
[cf_with_cxx_binding=$withval],
[cf_with_cxx_binding=$cf_with_cxx])
AC_MSG_RESULT([$cf_with_cxx_binding])
AS_IF([test x"${cf_with_cxx_binding}" = "xyes"],
@ -530,10 +530,10 @@ dnl Check if perl-binding is wanted, default is to not build it
# Perl binding
AC_MSG_CHECKING([whether to build perl binding])
AC_ARG_WITH([perl-binding],
[AS_HELP_STRING([--with-perl-binding],
[build perl binding @<:@default=no@:>@])],
[cf_with_perl_binding=$withval],
[cf_with_perl_binding=no])
[AS_HELP_STRING([--with-perl-binding],
[build perl binding @<:@default=no@:>@])],
[cf_with_perl_binding=$withval],
[cf_with_perl_binding=no])
AC_MSG_RESULT([$cf_with_perl_binding])
dnl SC_PATH_PERLINC from macros/perl.m4
@ -557,14 +557,14 @@ dnl Check for python availability, so we can enable HamlibPy
AC_MSG_CHECKING([whether to build python binding])
AC_ARG_WITH([python-binding],
[AS_HELP_STRING([--with-python-binding],
[build python binding @<:@default=no@:>@])],
[build python binding @<:@default=no@:>@])],
[cf_with_python_binding=$withval],
[cf_with_python_binding=no])
AC_MSG_RESULT([$cf_with_python_binding])
dnl AX_PYTHON_DEVEL from macros/ax_python_devel.m4
AS_IF([test x"${cf_with_python_binding}" = "xyes"],[
dnl Order matters! AX_PYTHON_DEVEL must be first for PYTHON_VERSION to be honored.
dnl Order matters! AX_PYTHON_DEVEL must be first for PYTHON_VERSION to be honored.
AX_PYTHON_DEVEL([">='2.1'"])
AM_PATH_PYTHON([2.1],, [:])
@ -593,7 +593,7 @@ AS_IF([test x"${pyver_3_8}" = "xyes"],[
AC_MSG_CHECKING([Whether to build Tcl bindings])
AC_ARG_WITH([tcl-binding],
[AS_HELP_STRING([--with-tcl-binding],
[build Tcl binding @<:@default=no@:>@])],
[build Tcl binding @<:@default=no@:>@])],
[build_tcl=$withval],
[build_tcl=no])
AC_MSG_RESULT([$build_tcl])
@ -607,8 +607,8 @@ AS_IF([test x"${build_tcl}" = "xyes"],[
tcl_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC"
AC_CHECK_HEADERS([tcl.h],
[],
[AC_MSG_ERROR([Unable to find Tcl headers])])
[],
[AC_MSG_ERROR([Unable to find Tcl headers])])
CPPFLAGS=$tcl_save_CPPFLAGS
BINDING_LIST="${BINDING_LIST} tcl"
@ -633,7 +633,7 @@ dnl Check for lua availability, so we can enable HamlibLua
AC_MSG_CHECKING([whether to build lua binding])
AC_ARG_WITH([lua-binding],
[AS_HELP_STRING([--with-lua-binding],
[build lua binding @<:@default=no@:>@])],
[build lua binding @<:@default=no@:>@])],
[cf_with_lua_binding=$withval],
[cf_with_lua_binding=no])
AC_MSG_RESULT([$cf_with_lua_binding])
@ -661,10 +661,10 @@ dnl Only search for Swig if one or more bindings are enabled.
AS_IF([test "x${BINDING_ALL}" != "x"],
[# macros/ax_pkg_swig.m4
AX_PKG_SWIG([3.0.12],
[BINDINGS="${BINDINGS} bindings"
cf_with_bindings="yes"],
[AC_MSG_ERROR([SWIG is required to build bindings...])
])],
[BINDINGS="${BINDINGS} bindings"
cf_with_bindings="yes"],
[AC_MSG_ERROR([SWIG is required to build bindings...])
])],
[cf_with_bindings="no"])
AC_MSG_CHECKING([whether to build bindings])
@ -689,10 +689,10 @@ AC_SUBST([BINDING_LIB_TARGETS])
dnl Winradio only under Linux (until someone ports it on other os)
AC_MSG_CHECKING([whether to build winradio backend])
AC_ARG_ENABLE([winradio],
[AS_HELP_STRING([--disable-winradio],
[do not build winradio backend @<:@default=yes@:>@])],
[cf_with_winradio="no"],
[cf_with_winradio="yes" AC_DEFINE([HAVE_WINRADIO],[1],[Define if winradio backend is built])])
[AS_HELP_STRING([--disable-winradio],
[do not build winradio backend @<:@default=yes@:>@])],
[cf_with_winradio="no"],
[cf_with_winradio="yes" AC_DEFINE([HAVE_WINRADIO],[1],[Define if winradio backend is built])])
AC_MSG_RESULT([$cf_with_winradio])
DL_LIBS=""
@ -701,7 +701,7 @@ AS_IF([test x"${cf_with_winradio}" = "xyes"],
[RIGS_BACKEND_LIST="$RIGS_BACKEND_LIST rigs/winradio"
dnl Check for libdl and set DL_LIBS if found--used for linradio WR-G313 backend.
AC_CHECK_LIB([dl], [dlopen], [DL_LIBS="-ldl"],
[AC_MSG_WARN([dlopen was not found in libdl--linradio backend will be disabled])])
[AC_MSG_WARN([dlopen was not found in libdl--linradio backend will be disabled])])
])
# Still need -ldl if we have it
@ -709,29 +709,29 @@ AS_IF([test x"${cf_with_winradio}" = "xno"],
[RIGS_BACKEND_LIST="$RIGS_BACKEND_LIST"
dnl Check for libdl and set DL_LIBS if found--used for linradio WR-G313 backend.
AC_CHECK_LIB([dl], [dlopen], [DL_LIBS="-ldl"],
[AC_MSG_WARN([dlopen was not found in libdl--linradio backend will be disabled])])
[AC_MSG_WARN([dlopen was not found in libdl--linradio backend will be disabled])])
])
dnl Set conditional compilation for G-313.
AS_CASE(["$host_os"],
[mingw* | pw32* | cygwin ], [
AM_CONDITIONAL(G313_LINUX_GNU, false)
AM_CONDITIONAL(G313_WINDOWS, true)
],
[mingw* | pw32* | cygwin ], [
AM_CONDITIONAL(G313_LINUX_GNU, false)
AM_CONDITIONAL(G313_WINDOWS, true)
],
dnl As g313-posix.c has a hard dependency on linux/types.h
dnl via linradio/wrg313api.h, disable compilation on other POSIX.
dnl (Certain systems have extra characters following "-gnu" such as
dnl the Raspberry Pi which is "linux-gnueabihf"; presume that "linux-gnu"
dnl is a sufficient test.)
[ *linux-gnu* ], [
AM_CONDITIONAL(G313_LINUX_GNU, true)
AM_CONDITIONAL(G313_WINDOWS, false)
],
[
AM_CONDITIONAL(G313_LINUX_GNU, false)
AM_CONDITIONAL(G313_WINDOWS, false)
AC_DEFINE([OTHER_POSIX], [1], [Compilation on POSIX other than Linux])
])
[ *linux-gnu* ], [
AM_CONDITIONAL(G313_LINUX_GNU, true)
AM_CONDITIONAL(G313_WINDOWS, false)
],
[
AM_CONDITIONAL(G313_LINUX_GNU, false)
AM_CONDITIONAL(G313_WINDOWS, false)
AC_DEFINE([OTHER_POSIX], [1], [Compilation on POSIX other than Linux])
])
dnl If libdl is present, check for its header file.
AS_IF([test x"${DL_LIBS}" = "x-ldl"],
@ -743,9 +743,9 @@ AC_SUBST([DL_LIBS])
dnl stuff that requires C++ support
AS_IF([test x"${cf_with_usrp}" = "xyes"],[
PKG_CHECK_MODULES([USRP],
[usrp >= 0.8],
[AC_DEFINE([HAVE_USRP],[1],[Define if usrp is available])
])
[usrp >= 0.8],
[AC_DEFINE([HAVE_USRP],[1],[Define if usrp is available])
])
])
AM_CONDITIONAL([HAVE_USRP], [test x"${cf_with_usrp}" = "xyes"])
@ -767,8 +767,8 @@ dnl otherwise parallel 'make -jn' will fail
## ---------------------------------- ##
for be in ${RIG_BACKEND_LIST} ; do
RIGDIR=$(echo $be | awk -F "/" '{print $2}')
RIG_BACKENDEPS="${RIG_BACKENDEPS} \$(top_builddir)/rigs/${RIGDIR}/libhamlib-${RIGDIR}.la"
RIGDIR=$(echo $be | awk -F "/" '{print $2}')
RIG_BACKENDEPS="${RIG_BACKENDEPS} \$(top_builddir)/rigs/${RIGDIR}/libhamlib-${RIGDIR}.la"
done
AC_SUBST([RIG_BACKEND_LIST])
@ -782,8 +782,8 @@ AC_SUBST([RIG_BACKENDEPS])
# otherwise parallel 'make -jn' will fail
for be in ${ROT_BACKEND_LIST} ; do
ROTDIR=$(echo $be | awk -F "/" '{print $2}')
ROT_BACKENDEPS="${ROT_BACKENDEPS} \$(top_builddir)/rotators/${ROTDIR}/libhamlib-${ROTDIR}.la"
ROTDIR=$(echo $be | awk -F "/" '{print $2}')
ROT_BACKENDEPS="${ROT_BACKENDEPS} \$(top_builddir)/rotators/${ROTDIR}/libhamlib-${ROTDIR}.la"
done
AC_SUBST([ROT_BACKEND_LIST])
@ -796,8 +796,8 @@ AC_SUBST([ROT_BACKENDEPS])
# otherwise parallel 'make -jn' will fail
for be in ${AMP_BACKEND_LIST} ; do
AMPDIR=$(echo $be | awk -F "/" '{print $2}')
AMP_BACKENDEPS="${AMP_BACKENDEPS} \$(top_builddir)/amplifiers/${AMPDIR}/libhamlib-${AMPDIR}.la"
AMPDIR=$(echo $be | awk -F "/" '{print $2}')
AMP_BACKENDEPS="${AMP_BACKENDEPS} \$(top_builddir)/amplifiers/${AMPDIR}/libhamlib-${AMPDIR}.la"
done
AC_SUBST([AMP_BACKEND_LIST])
@ -885,26 +885,26 @@ echo \
${PACKAGE_NAME} Version ${PACKAGE_VERSION} configuration:
Prefix ${prefix}
Preprocessor ${CPP} ${CPPFLAGS}
C Compiler ${CC} ${CFLAGS}
C++ Compiler ${CXX} ${CXXFLAGS}
Prefix ${prefix}
Preprocessor ${CPP} ${CPPFLAGS}
C Compiler ${CC} ${CFLAGS}
C++ Compiler ${CXX} ${CXXFLAGS}
Package features:
With C++ binding ${cf_with_cxx_binding}
With Perl binding ${cf_with_perl_binding}
With Python binding ${cf_with_python_binding}
With TCL binding ${build_tcl}
With Lua binding ${cf_with_lua_binding}
With rigmem XML support ${cf_with_xml_support}
With Readline support ${cf_with_readline_support}
With INDI support ${cf_with_indi_support}
With C++ binding ${cf_with_cxx_binding}
With Perl binding ${cf_with_perl_binding}
With Python binding ${cf_with_python_binding}
With TCL binding ${build_tcl}
With Lua binding ${cf_with_lua_binding}
With rigmem XML support ${cf_with_xml_support}
With Readline support ${cf_with_readline_support}
With INDI support ${cf_with_indi_support}
Enable HTML rig feature matrix ${cf_enable_html_matrix}
Enable WinRadio ${cf_with_winradio}
Enable USRP ${cf_with_usrp}
Enable USB backends ${cf_with_libusb}
Enable shared libs ${enable_shared}
Enable static libs ${enable_static}
Enable WinRadio ${cf_with_winradio}
Enable USRP ${cf_with_usrp}
Enable USB backends ${cf_with_libusb}
Enable shared libs ${enable_shared}
Enable static libs ${enable_static}
-----------------------------------------------------------------------"

Wyświetl plik

@ -468,7 +468,7 @@ Mode is a token: \(oqUSB\(cq, \(oqLSB\(cq, \(oqCW\(cq, \(oqCWR\(cq,
\(oqECSSLSB\(cq, \(oqFA\(cq, \(oqSAM\(cq, \(oqSAL\(cq, \(oqSAH\(cq,
\(oqDSB\(cq.
.IP
Passband is in Hz as an integer, or \(oq0\(cq for the radio backend default.
Passband is in Hz as an integer, -1 for no change, or \(oq0\(cq for the radio backend default.
.IP
.BR Note :
Passing a \(oq?\(cq (query) as the first argument instead of a Mode token will

Wyświetl plik

@ -384,8 +384,8 @@ are returned as double precision floating point values.
Move the rotator in a specific direction at the given rate.
.IP
.RI \(aq Direction \(aq
is an integer defined as \(oq2\(cq = Up, \(oq4\(cq = Down, \(oq8\(cq = Left,
and \(oq16\(cq = Right.
is an integer or keyword defined as \(oq2\(cq = UP, \(oq4\(cq = DOWN, \(oq8\(cq = LEFT or CCW
and \(oq16\(cq = RIGHT or CW
.IP
.RI \(aq Speed \(aq
is an integer between 1 and 100. Use -1 for no change to current speed.

Wyświetl plik

@ -1813,13 +1813,13 @@ struct rig_caps {
int (*decode_event)(RIG *rig);
int (*set_channel)(RIG *rig, const channel_t *chan);
int (*get_channel)(RIG *rig, channel_t *chan, int read_only);
int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan);
int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
const char * (*get_info)(RIG *rig);
int (*set_chan_all_cb)(RIG *rig, chan_cb_t chan_cb, rig_ptr_t);
int (*get_chan_all_cb)(RIG *rig, chan_cb_t chan_cb, rig_ptr_t);
int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
int (*set_mem_all_cb)(RIG *rig,
chan_cb_t chan_cb,
@ -1901,6 +1901,7 @@ typedef struct hamlib_port {
int value; /*!< Toggle PTT ON or OFF */
} gpio; /*!< GPIO attributes */
} parm; /*!< Port parameter union */
int flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
} hamlib_port_t;
//! @endcond
@ -2560,46 +2561,56 @@ rig_has_scan HAMLIB_PARAMS((RIG *rig,
scan_t scan));
extern HAMLIB_EXPORT(int)
rig_set_channel HAMLIB_PARAMS((RIG *rig,
rig_set_channel HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
const channel_t *chan)); /* mem */
extern HAMLIB_EXPORT(int)
rig_get_channel HAMLIB_PARAMS((RIG *rig,
rig_get_channel HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
channel_t *chan, int read_only));
extern HAMLIB_EXPORT(int)
rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
const channel_t chans[]));
extern HAMLIB_EXPORT(int)
rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
channel_t chans[]));
extern HAMLIB_EXPORT(int)
rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
const channel_t *chan,
const struct confparams *,
const value_t *));
extern HAMLIB_EXPORT(int)
rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
channel_t *chan,
const struct confparams *,
value_t *));

Wyświetl plik

@ -126,8 +126,8 @@ public:
void setMem(int ch, vfo_t vfo = RIG_VFO_CURR);
int getMem(vfo_t vfo = RIG_VFO_CURR);
void setChannel(const channel_t *chan);
void getChannel(channel_t *chan, int readOnly);
void setChannel(const channel_t *chan, vfo_t vfo);
void getChannel(channel_t *chan, vfo_t vfo, int readOnly);
void setPowerStat(powerstat_t status);
powerstat_t getPowerStat(void);

Wyświetl plik

@ -325,6 +325,8 @@
#define ROT_BACKEND_M2 "m2"
//! @endcond
#define ROT_MODEL_RC2800 ROT_MAKE_MODEL(ROT_M2, 1)
#define ROT_MODEL_RC2800_EARLY_AZ ROT_MAKE_MODEL(ROT_M2, 2)
#define ROT_MODEL_RC2800_EARLY_AZEL ROT_MAKE_MODEL(ROT_M2, 3)
/**

Wyświetl plik

@ -1488,7 +1488,7 @@ int adat_get_single_cmd_result(RIG *pRig)
pcPos = acBuf;
if ((nRC == RIG_OK))
if (nRC == RIG_OK)
{
int nBufLength = 0;

Wyświetl plik

@ -1029,7 +1029,7 @@ int aor_set_bank(RIG *rig, vfo_t vfo, int bank)
}
int aor_set_channel(RIG *rig, const channel_t *chan)
int aor_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
char aorcmd[BUFSZ];
@ -1240,7 +1240,7 @@ static int parse_chan_line(RIG *rig, channel_t *chan, char *basep,
}
int aor_get_channel(RIG *rig, channel_t *chan, int read_only)
int aor_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
char aorcmd[BUFSZ];
@ -1346,7 +1346,7 @@ int aor_get_channel(RIG *rig, channel_t *chan, int read_only)
#define LINES_PER_MA 10
int aor_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int aor_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
{
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
int i, j, retval;

Wyświetl plik

@ -60,9 +60,9 @@ int aor_set_mem(RIG *rig, vfo_t vfo, int ch);
int aor_get_mem(RIG *rig, vfo_t vfo, int *ch);
int aor_set_bank(RIG *rig, vfo_t vfo, int bank);
int aor_get_channel(RIG *rig, channel_t *chan, int read_only);
int aor_set_channel(RIG *rig, const channel_t *chan);
int aor_get_chan_all_cb (RIG * rig, chan_cb_t chan_cb, rig_ptr_t);
int aor_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int aor_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
int aor_get_chan_all_cb (RIG * rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
extern const struct rig_caps ar2700_caps;
extern const struct rig_caps ar8200_caps;

Wyświetl plik

@ -45,7 +45,8 @@ static int ar3030_set_mem(RIG *rig, vfo_t vfo, int ch);
static int ar3030_get_mem(RIG *rig, vfo_t vfo, int *ch);
static int ar3030_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int ar3030_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only);
static int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int ar3030_init(RIG *rig);
static int ar3030_cleanup(RIG *rig);
static int ar3030_close(RIG *rig);
@ -721,7 +722,7 @@ int ar3030_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return RIG_OK;
}
int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only)
int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct ar3030_priv_data *priv = (struct ar3030_priv_data *)rig->state.priv;
char cmdbuf[BUFSZ], infobuf[BUFSZ];

Wyświetl plik

@ -1630,7 +1630,7 @@ static int ar7030p_decode_event(RIG *rig)
return (-RIG_ENIMPL);
}
static int ar7030p_set_channel(RIG *rig, const channel_t *chan)
static int ar7030p_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
assert(NULL != rig);
assert(NULL != chan);
@ -1638,7 +1638,8 @@ static int ar7030p_set_channel(RIG *rig, const channel_t *chan)
return (-RIG_ENIMPL);
}
static int ar7030p_get_channel(RIG *rig, channel_t *chan, int read_only)
static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only)
{
int rc = RIG_OK;
unsigned char v;

Wyświetl plik

@ -615,7 +615,7 @@ int drake_get_mem(RIG *rig, vfo_t vfo, int *ch)
* drake_set_chan
* Assumes rig!=NULL
*/
int drake_set_chan(RIG *rig, const channel_t *chan)
int drake_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct drake_priv_data *priv = rig->state.priv;
vfo_t old_vfo;
@ -671,7 +671,7 @@ int drake_set_chan(RIG *rig, const channel_t *chan)
* drake_get_chan
* Assumes rig!=NULL
*/
int drake_get_chan(RIG *rig, channel_t *chan, int read_only)
int drake_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct drake_priv_data *priv = rig->state.priv;
vfo_t old_vfo;

Wyświetl plik

@ -42,8 +42,8 @@ int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
int drake_set_mem(RIG *rig, vfo_t vfo, int ch);
int drake_get_mem(RIG *rig, vfo_t vfo, int *ch);
int drake_set_chan(RIG *rig, const channel_t *chan);
int drake_get_chan(RIG *rig, channel_t *chan, int read_only);
int drake_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan);
int drake_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int drake_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int drake_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int drake_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);

Wyświetl plik

@ -1803,7 +1803,7 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
return RIG_OK;
}
static int dummy_set_channel(RIG *rig, const channel_t *chan)
static int dummy_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
@ -1848,7 +1848,8 @@ static int dummy_set_channel(RIG *rig, const channel_t *chan)
}
static int dummy_get_channel(RIG *rig, channel_t *chan, int read_only)
static int dummy_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
@ -2038,7 +2039,7 @@ struct rig_caps dummy_caps =
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
.targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT,
.targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_NONE,
@ -2203,7 +2204,7 @@ struct rig_caps dummy_no_vfo_caps =
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
.targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT,
.targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_NONE,

Wyświetl plik

@ -2100,13 +2100,14 @@ static int netrigctl_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
}
}
static int netrigctl_set_channel(RIG *rig, const channel_t *chan)
static int netrigctl_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
return -RIG_ENIMPL;
}
static int netrigctl_get_channel(RIG *rig, channel_t *chan, int read_only)
static int netrigctl_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only)
{
return -RIG_ENIMPL;
}

Wyświetl plik

@ -383,7 +383,7 @@ int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[],
* TODO: be more exhaustive
* assumes rig!=NULL
*/
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
unsigned char icmode;
@ -391,6 +391,19 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
icmode_ext = -1;
if (width == RIG_PASSBAND_NOCHANGE) // then we read width so we can reuse it
{
rmode_t tmode;
int ret = rig_get_mode(rig, vfo, &tmode, &width);
if (ret != RIG_OK)
{
rig_debug(RIG_DEBUG_WARN,
"%s: Failed to get width for passband nochange err=%s\n", __func__,
rigerror(ret));
}
}
switch (mode)
{
case RIG_MODE_AM: icmode = S_AM; break;

Wyświetl plik

@ -32,7 +32,7 @@ int make_cmd_frame(char frame[], char re_id, char ctrl_id, char cmd, int subcmd,
int icom_transaction (RIG *rig, int cmd, int subcmd, const unsigned char *payload, int payload_len, unsigned char *data, int *data_len);
int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[], int rxbuffer_len);
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width, unsigned char *md, signed char *pd);
int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, unsigned char *md, signed char *pd);
void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t *width);
#endif /* _FRAME_H */

Wyświetl plik

@ -138,12 +138,12 @@ struct cmdparams ic7000_extcmds[] =
/*
* This function does the special bandwidth coding for IC-7000
*/
static int ic7000_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int ic7000_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err != RIG_OK)
{

Wyświetl plik

@ -38,12 +38,12 @@
* and IC-706MKIIG
* (0 - wide, 1 - normal, 2 - narrow)
*/
static int ic706_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int ic706_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err != RIG_OK)
{

Wyświetl plik

@ -703,7 +703,7 @@ const struct rig_caps ic705_caps =
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,

Wyświetl plik

@ -153,8 +153,9 @@ typedef channel_str_t band_stack_reg_t;
static int ic746_set_parm(RIG *rig, setting_t parm, value_t val);
static int ic746_get_parm(RIG *rig, setting_t parm, value_t *val);
static int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only);
static int ic746pro_set_channel(RIG *rig, const channel_t *chan);
static int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int ic746pro_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val);
static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val);
@ -905,7 +906,7 @@ int ic746_get_parm(RIG *rig, setting_t parm, value_t *val)
*
* If memory is empty it will return RIG_OK,but every thing will be null. Where do we boundary check?
*/
int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only)
int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct icom_priv_data *priv;
struct rig_state *rs;
@ -1071,7 +1072,7 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only)
* ic746pro_set_channel
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
*/
int ic746pro_set_channel(RIG *rig, const channel_t *chan)
int ic746pro_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
@ -1103,7 +1104,7 @@ int ic746pro_set_channel(RIG *rig, const channel_t *chan)
// RX
to_bcd(membuf.rx.freq, chan->freq, freq_len * 2);
retval = rig2icom_mode(rig, chan->mode, chan->width,
retval = rig2icom_mode(rig, vfo, chan->mode, chan->width,
&membuf.rx.mode, &membuf.rx.pb);
if (retval != RIG_OK)
@ -1150,7 +1151,7 @@ int ic746pro_set_channel(RIG *rig, const channel_t *chan)
// TX
to_bcd(membuf.tx.freq, chan->tx_freq, freq_len * 2);
retval = rig2icom_mode(rig, chan->tx_mode, chan->tx_width,
retval = rig2icom_mode(rig, vfo, chan->tx_mode, chan->tx_width,
&membuf.tx.mode, &membuf.tx.pb);
if (retval != RIG_OK)

Wyświetl plik

@ -97,12 +97,12 @@ int ic756_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
* This function deals with the older type radios with only 2 filter widths
* (0 - normal, 1 - narrow)
*/
static int r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err != RIG_OK)
{

Wyświetl plik

@ -329,12 +329,12 @@ static int ic910_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
* This function does the special bandwidth coding for IC-910
* (1 - normal, 2 - narrow)
*/
static int ic910_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int ic910_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (*pd == PD_NARROW_3)
{

Wyświetl plik

@ -1631,7 +1631,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode,
{
unsigned char mode_icom; // not used as it will map to USB/LSB
signed char width_icom;
rig2icom_mode(rig, mode, width, &mode_icom, &width_icom);
rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom);
// since width_icom is 0-2 for rigs that need this here we have to make it 1-3
datamode[1] = datamode[0] ? width_icom : 0;
retval =
@ -1688,11 +1688,11 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (priv_caps->r2i_mode != NULL) /* call priv code if defined */
{
err = priv_caps->r2i_mode(rig, mode, width, &icmode, &icmode_ext);
err = priv_caps->r2i_mode(rig, vfo, mode, width, &icmode, &icmode_ext);
}
else /* else call default */
{
err = rig2icom_mode(rig, mode, width, &icmode, &icmode_ext);
err = rig2icom_mode(rig, vfo, mode, width, &icmode, &icmode_ext);
}
if (err < 0)

Wyświetl plik

@ -161,7 +161,7 @@ struct icom_priv_caps
// the 4 elements above are mandatory
// everything below here is optional in the backends
int settle_time; /*!< Receiver settle time, in ms */
int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width,
int (*r2i_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd); /*< backend specific code
to convert bandwidth and
mode to cmd tokens */

Wyświetl plik

@ -85,12 +85,12 @@ struct cmdparams icr30_extcmds[] =
* (1 - normal, 2 - narrow)
*/
static int icr30_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int icr30_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (*pd == PD_NARROW_3)
{

Wyświetl plik

@ -91,8 +91,9 @@
.flags = 1, \
}
static int icr75_set_channel(RIG *rig, const channel_t *chan);
static int icr75_get_channel(RIG *rig, channel_t *chan, int read_only);
static int icr75_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int icr75_set_parm(RIG *rig, setting_t parm, value_t val);
static int icr75_get_parm(RIG *rig, setting_t parm, value_t *val);
@ -251,7 +252,7 @@ const struct rig_caps icr75_caps =
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
* TODO: still a WIP --SF
*/
int icr75_set_channel(RIG *rig, const channel_t *chan)
int icr75_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
@ -276,7 +277,7 @@ int icr75_set_channel(RIG *rig, const channel_t *chan)
chan_len = 2 + freq_len + 1;
err = rig2icom_mode(rig, chan->mode, chan->width,
err = rig2icom_mode(rig, vfo, chan->mode, chan->width,
&icmode, &icmode_ext);
if (err != RIG_OK)
@ -320,7 +321,7 @@ int icr75_set_channel(RIG *rig, const channel_t *chan)
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
* TODO: still a WIP --SF
*/
int icr75_get_channel(RIG *rig, channel_t *chan, int read_only)
int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct icom_priv_data *priv;
struct rig_state *rs;

Wyświetl plik

@ -54,7 +54,7 @@ const struct confparams opto_ext_parms[] =
};
static int optoscan_get_status_block(RIG *rig, struct optostat *status_block);
static int optoscan_send_freq(RIG *rig, pltstate_t *state);
static int optoscan_send_freq(RIG *rig, vfo_t vfo, pltstate_t *state);
static int optoscan_RTS_toggle(RIG *rig);
static int optoscan_start_timer(RIG *rig, pltstate_t *state);
static int optoscan_wait_timer(RIG *rig, pltstate_t *state);
@ -643,7 +643,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
}
/* Step 1 is implicit, since hamlib does this when it opens the device */
optoscan_send_freq(rig, state); /*Step 2*/
optoscan_send_freq(rig, vfo, state); /*Step 2*/
}
rc = 0;
@ -662,7 +662,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
if (rc != RIG_SCAN_STOP)
{
optoscan_send_freq(rig, state); /*Step 4*/
optoscan_send_freq(rig, vfo, state); /*Step 4*/
}
optoscan_wait_timer(rig, state); /*Step 5*/
@ -768,7 +768,7 @@ static int optoscan_get_status_block(RIG *rig, struct optostat *status_block)
}
static int optoscan_send_freq(RIG *rig, pltstate_t *state)
static int optoscan_send_freq(RIG *rig, vfo_t vfo, pltstate_t *state)
{
unsigned char buff[OPTO_BUFF_SIZE];
char md, pd;
@ -782,7 +782,7 @@ static int optoscan_send_freq(RIG *rig, pltstate_t *state)
to_bcd(buff, freq, 5 * 2); /* to_bcd requires nibble len */
rig2icom_mode(rig, mode, 0, (unsigned char *) &md, (signed char *) &pd);
rig2icom_mode(rig, vfo, mode, 0, (unsigned char *) &md, (signed char *) &pd);
buff[5] = md;
/* read echo'd chars only...there will be no ACK from this command

Wyświetl plik

@ -58,7 +58,7 @@
} }
static int perseus_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int perseus_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd);
static void perseus_i2r_mode(RIG *rig, unsigned char md, int pd,
rmode_t *mode, pbwidth_t *width);
@ -184,12 +184,12 @@ const struct rig_caps perseus_caps =
*
* NB: the filter width will be ignored.
*/
static int perseus_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int perseus_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err == 0 && mode == RIG_MODE_SAM)
{

Wyświetl plik

@ -1401,7 +1401,7 @@ int jrc_get_mem(RIG *rig, vfo_t vfo, int *ch)
* jrc_set_chan
* Assumes rig!=NULL
*/
int jrc_set_chan(RIG *rig, const channel_t *chan)
int jrc_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct jrc_priv_caps *priv = (struct jrc_priv_caps *)rig->caps->priv;
char cmdbuf[BUFSZ];
@ -1413,7 +1413,7 @@ int jrc_set_chan(RIG *rig, const channel_t *chan)
/* read first to get current values */
current.channel_num = chan->channel_num;
if ((retval = jrc_get_chan(rig, &current, 1)) != RIG_OK) { return retval; }
if ((retval = jrc_get_chan(rig, vfo, &current, 1)) != RIG_OK) { return retval; }
sprintf(cmdbuf, "K%03d000", chan->channel_num);
@ -1465,7 +1465,7 @@ int jrc_set_chan(RIG *rig, const channel_t *chan)
* jrc_get_chan
* Assumes rig!=NULL
*/
int jrc_get_chan(RIG *rig, channel_t *chan, int read_only)
int jrc_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct jrc_priv_caps *priv = (struct jrc_priv_caps *)rig->caps->priv;
char membuf[BUFSZ], cmdbuf[BUFSZ];

Wyświetl plik

@ -54,8 +54,8 @@ int jrc_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
int jrc_set_trn(RIG *rig, int trn);
int jrc_set_mem(RIG *rig, vfo_t vfo, int ch);
int jrc_get_mem(RIG *rig, vfo_t vfo, int *ch);
int jrc_set_chan(RIG *rig, const channel_t *chan);
int jrc_get_chan(RIG *rig, channel_t *chan, int read_only);
int jrc_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan);
int jrc_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int jrc_set_powerstat(RIG *rig, powerstat_t status);
int jrc_get_powerstat(RIG *rig, powerstat_t *status);
int jrc_reset(RIG *rig, reset_t reset);

Wyświetl plik

@ -634,7 +634,7 @@ int ic10_set_mem(RIG *rig, vfo_t vfo, int ch)
}
int ic10_get_channel(RIG *rig, channel_t *chan, int read_only)
int ic10_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char membuf[16], infobuf[32];
int retval, info_len, len;
@ -731,7 +731,7 @@ int ic10_get_channel(RIG *rig, channel_t *chan, int read_only)
}
int ic10_set_channel(RIG *rig, const channel_t *chan)
int ic10_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char membuf[64];
int retval, len, md;

Wyświetl plik

@ -46,8 +46,8 @@ int ic10_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int ic10_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int ic10_set_mem(RIG *rig, vfo_t vfo, int ch);
int ic10_get_mem(RIG *rig, vfo_t vfo, int *ch);
int ic10_set_channel(RIG *rig, const channel_t *chan);
int ic10_get_channel(RIG *rig, channel_t *chan, int read_only);
int ic10_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
int ic10_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int ic10_set_powerstat(RIG *rig, powerstat_t status);
int ic10_get_powerstat(RIG *rig, powerstat_t *status);
int ic10_set_trn(RIG *rig, int trn);

Wyświetl plik

@ -791,6 +791,7 @@ int kenwood_open(RIG *rig)
if (RIG_OK != err)
{
rig_debug(RIG_DEBUG_ERR, "%s: cannot get f/w version\n", __func__);
rig->state.rigport.retry = retry_save;
return err;
}
@ -806,6 +807,7 @@ int kenwood_open(RIG *rig)
else
{
rig_debug(RIG_DEBUG_ERR, "%s: cannot get f/w version\n", __func__);
rig->state.rigport.retry = retry_save;
return -RIG_EPROTO;
}
@ -849,6 +851,7 @@ int kenwood_open(RIG *rig)
if (strlen(id) < 5)
{
rig_debug(RIG_DEBUG_ERR, "%s: unknown id type (%s)\n", __func__, id);
rig->state.rigport.retry = retry_save;
return -RIG_EPROTO;
}
@ -917,6 +920,7 @@ int kenwood_open(RIG *rig)
rig_strvfo(priv->tx_vfo));
}
rig->state.rigport.retry = retry_save;
return RIG_OK;
}
@ -4238,7 +4242,7 @@ int kenwood_get_mem_if(RIG *rig, vfo_t vfo, int *ch)
return RIG_OK;
}
int kenwood_get_channel(RIG *rig, channel_t *chan, int read_only)
int kenwood_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int err;
char buf[26];
@ -4360,7 +4364,7 @@ int kenwood_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int kenwood_set_channel(RIG *rig, const channel_t *chan)
int kenwood_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char buf[128];
char mode, tx_mode = 0;

Wyświetl plik

@ -27,7 +27,7 @@
#include <string.h>
#include "token.h"
#define BACKEND_VER "20201026"
#define BACKEND_VER "20201126"
#define EOM_KEN ';'
#define EOM_TH '\r'
@ -201,8 +201,8 @@ int kenwood_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int kenwood_set_mem(RIG *rig, vfo_t vfo, int ch);
int kenwood_get_mem(RIG *rig, vfo_t vfo, int *ch);
int kenwood_get_mem_if(RIG *rig, vfo_t vfo, int *ch);
int kenwood_get_channel(RIG *rig, channel_t *chan, int read_only);
int kenwood_set_channel(RIG *rig, const channel_t *chan);
int kenwood_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int kenwood_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
int kenwood_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
const char *kenwood_get_info(RIG *rig);
int kenwood_get_id(RIG *rig, char *buf);

Wyświetl plik

@ -64,8 +64,9 @@ static int pihpsdr_open(RIG *rig);
static int pihpsdr_get_level(RIG *rig, vfo_t vfo, setting_t level,
value_t *val);
static int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only);
static int pihspdr_set_channel(RIG *rig, const channel_t *chan);
static int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int pihspdr_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static struct kenwood_priv_caps ts2000_priv_caps =
@ -342,7 +343,7 @@ const struct rig_caps pihpsdr_caps =
*/
int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only)
int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int err;
int tmp;
@ -580,7 +581,7 @@ int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int pihspdr_set_channel(RIG *rig, const channel_t *chan)
int pihspdr_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char sqltype;
char shift;

Wyświetl plik

@ -1895,7 +1895,7 @@ int th_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
/* get and set channel tested on thg71&thf7e */
/* must work on other th and tm kenwood rigs */
/* --------------------------------------------------------------------- */
int th_get_channel(RIG *rig, channel_t *chan, int read_only)
int th_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char membuf[64], ackbuf[ACKBUF_LEN];
int retval;
@ -1904,7 +1904,7 @@ int th_get_channel(RIG *rig, channel_t *chan, int read_only)
int step, shift, rev, tone, ctcss, tonefq, ctcssfq, dcs, dcscode, mode, lockout;
const char *mr_extra;
int channel_num;
vfo_t vfo;
vfo_t vfotmp;
const struct kenwood_priv_caps *priv = (const struct kenwood_priv_caps *)
rig->caps->priv;
const chan_t *chan_caps;
@ -1926,10 +1926,10 @@ int th_get_channel(RIG *rig, channel_t *chan, int read_only)
}
channel_num = chan->channel_num;
vfo = chan->vfo;
vfotmp = chan->vfo;
memset(chan, 0, sizeof(channel_t));
chan->channel_num = channel_num;
chan->vfo = vfo;
chan->vfo = vfotmp;
if (rig->caps->rig_model == RIG_MODEL_THF7E ||
rig->caps->rig_model == RIG_MODEL_THF6A)
@ -2215,7 +2215,7 @@ static int find_tone_index(const tone_t *tone_list, tone_t tone)
}
/* --------------------------------------------------------------------- */
int th_set_channel(RIG *rig, const channel_t *chan)
int th_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char membuf[256];
int retval;

Wyświetl plik

@ -60,8 +60,8 @@ extern int th_get_mem(RIG *rig, vfo_t vfo, int *ch);
extern int th_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
extern int th_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
extern int th_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
extern int th_get_channel(RIG *rig, channel_t *chan, int read_only);
extern int th_set_channel(RIG *rig, const channel_t *chan);
extern int th_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
extern int th_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
extern int th_set_ant (RIG * rig, vfo_t vfo, ant_t ant, value_t option);
extern int th_get_ant (RIG * rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t * ant_curr, ant_t *ant_tx, ant_t *ant_rx);
extern int th_reset(RIG *rig, reset_t reset);

Wyświetl plik

@ -1271,7 +1271,7 @@ static int thd72_get_mem(RIG *rig, vfo_t vfo, int *ch)
return RIG_OK;
}
static int thd72_set_channel(RIG *rig, const channel_t *chan)
static int thd72_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1358,7 +1358,8 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan)
return RIG_OK;
}
static int thd72_get_channel(RIG *rig, channel_t *chan, int read_only)
static int thd72_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only)
{
int retval;
char buf[72];

Wyświetl plik

@ -1188,7 +1188,7 @@ static int thd74_get_mem(RIG *rig, vfo_t vfo, int *ch)
return RIG_OK;
}
static int thd74_set_channel(RIG *rig, const channel_t *chan)
static int thd74_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1275,7 +1275,8 @@ static int thd74_parse_channel(int kind, const char *buf, channel_t *chan)
return RIG_OK;
}
static int thd74_get_channel(RIG *rig, channel_t *chan, int read_only)
static int thd74_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only)
{
int retval;
char buf[72];

Wyświetl plik

@ -70,8 +70,9 @@ static int tmd710_get_mem(RIG *rig, vfo_t vfo, int *ch);
static int tmd710_set_mem(RIG *rig, vfo_t vfo, int ch);
static int tmd710_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
static int tmd710_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code);
static int tmd710_set_channel(RIG *rig, const channel_t *chan);
static int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only);
static int tmd710_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int tmd710_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int tmd710_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
static int tmd710_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
@ -1833,7 +1834,7 @@ int tmd710_set_mem(RIG *rig, vfo_t vfo, int ch)
return kenwood_safe_transaction(rig, cmd, membuf, sizeof(membuf), 8);
}
int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only)
int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int retval;
tmd710_me me_struct;
@ -1946,7 +1947,7 @@ int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int tmd710_set_channel(RIG *rig, const channel_t *chan)
int tmd710_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
int retval;
tmd710_me me_struct;

Wyświetl plik

@ -87,8 +87,9 @@ static int tmv7_decode_event(RIG *rig);
static int tmv7_set_vfo(RIG *rig, vfo_t vfo);
static int tmv7_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
static int tmv7_get_powerstat(RIG *rig, powerstat_t *status);
static int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only);
static int tmv7_set_channel(RIG *rig, const channel_t *chan);
static int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
/*
* tm-v7 rig capabilities.
@ -496,7 +497,7 @@ int tmv7_get_powerstat(RIG *rig, powerstat_t *status)
/* --------------------------------------------------------------------- */
int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only)
int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char membuf[64], ackbuf[ACKBUF_LEN];
int retval;
@ -662,7 +663,7 @@ int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
/* --------------------------------------------------------------------- */
int tmv7_set_channel(RIG *rig, const channel_t *chan)
int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char membuf[ACKBUF_LEN];
int retval;

Wyświetl plik

@ -58,8 +58,9 @@
/* prototypes */
static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only);
static int ts2000_set_channel(RIG *rig, const channel_t *chan);
static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
int read_only);
static int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
/*
* 38 CTCSS sub-audible tones + 1750 tone
@ -369,7 +370,7 @@ const struct rig_caps ts2000_caps =
*/
int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only)
int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int err;
int tmp;
@ -607,7 +608,7 @@ int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int ts2000_set_channel(RIG *rig, const channel_t *chan)
int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char sqltype = '0';
char buf[128];

Wyświetl plik

@ -688,7 +688,7 @@ int ts570_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
.ctcss_tone=1 \
}
int ts570_set_channel(RIG *rig, const channel_t *chan)
int ts570_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char cmdbuf[30];
int retval, cmd_len;

Wyświetl plik

@ -73,7 +73,7 @@ static struct kenwood_priv_caps ts850_priv_caps =
static int ts850_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
static int ts850_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
static int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int ts850_set_channel(RIG *rig, const channel_t *chan);
static int ts850_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static const struct confparams ts850_ext_parms[] =
{
@ -513,7 +513,7 @@ int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return retval; // Never gets here.
}
int ts850_set_channel(RIG *rig, const channel_t *chan)
int ts850_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char cmdbuf[30];
int retval;

Wyświetl plik

@ -201,7 +201,7 @@ int prm80_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
memset(&chan, 0, sizeof(chan));
chan.vfo = RIG_VFO_CURR;
ret = prm80_get_channel(rig, &chan, 0);
ret = prm80_get_channel(rig, vfo, &chan, 0);
if (ret != RIG_OK)
{
@ -246,7 +246,7 @@ int prm80_get_mem(RIG *rig, vfo_t vfo, int *ch)
memset(&chan, 0, sizeof(chan));
chan.vfo = RIG_VFO_CURR;
ret = prm80_get_channel(rig, &chan, 0);
ret = prm80_get_channel(rig, vfo, &chan, 0);
if (ret != RIG_OK)
{
@ -276,7 +276,7 @@ static int hhtoi(const char *p)
* prm80_get_channel
* Assumes rig!=NULL
*/
int prm80_get_channel(RIG *rig, channel_t *chan, int read_only)
int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char statebuf[BUFSZ];
int statebuf_len = BUFSZ;
@ -347,7 +347,7 @@ int prm80_get_channel(RIG *rig, channel_t *chan, int read_only)
* prm80_set_channel
* Assumes rig!=NULL
*/
int prm80_set_channel(RIG *rig, const channel_t *chan)
int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char statebuf[BUFSZ];
int statebuf_len = BUFSZ;
@ -432,7 +432,7 @@ int prm80_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
memset(&chan, 0, sizeof(chan));
chan.vfo = RIG_VFO_CURR;
ret = prm80_get_channel(rig, &chan, 1);
ret = prm80_get_channel(rig, vfo, &chan, 1);
if (ret != RIG_OK)
{

Wyświetl plik

@ -42,8 +42,8 @@ int prm80_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int prm80_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int prm80_set_mem (RIG *rig, vfo_t vfo, int ch);
int prm80_get_mem (RIG *rig, vfo_t vfo, int *ch);
int prm80_set_channel(RIG * rig, const channel_t * chan);
int prm80_get_channel(RIG * rig, channel_t * chan, int read_only);
int prm80_set_channel(RIG * rig, vfo_t vfo, const channel_t * chan);
int prm80_get_channel(RIG * rig, vfo_t vfo, channel_t * chan, int read_only);
const char* prm80_get_info(RIG *rig);

Wyświetl plik

@ -590,7 +590,7 @@ int uniden_get_mem(RIG *rig, vfo_t vfo, int *ch)
* uniden_get_channel
* Assumes rig!=NULL
*/
int uniden_get_channel(RIG *rig, channel_t *chan, int read_only)
int uniden_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char cmdbuf[BUFSZ], membuf[BUFSZ];
size_t cmd_len = BUFSZ, mem_len = BUFSZ;
@ -689,7 +689,7 @@ int uniden_get_channel(RIG *rig, channel_t *chan, int read_only)
*
* Only freq can be set?
*/
int uniden_set_channel(RIG *rig, const channel_t *chan)
int uniden_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char cmdbuf[BUFSZ], membuf[BUFSZ];
size_t cmd_len = BUFSZ, mem_len = BUFSZ;

Wyświetl plik

@ -66,8 +66,8 @@ int uniden_get_mem(RIG *rig, vfo_t vfo, int *ch);
int uniden_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
int uniden_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int uniden_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int uniden_get_channel(RIG *rig, channel_t *chan, int read_only);
int uniden_set_channel(RIG *rig, const channel_t *chan);
int uniden_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int uniden_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
const char* uniden_get_info(RIG *rig);
extern const struct rig_caps bc895_caps;

Wyświetl plik

@ -2666,7 +2666,7 @@ int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch)
* -------------------------------------------------------------------------
* Returns RIG_OK on success or an error code on failure
*/
int ft1000d_set_channel(RIG *rig, const channel_t *chan)
int ft1000d_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -2698,7 +2698,7 @@ int ft1000d_set_channel(RIG *rig, const channel_t *chan)
* Status for split operation, active rig functions and tuning steps
* are only relevant for currVFO
*/
int ft1000d_get_channel(RIG *rig, channel_t *chan, int read_only)
int ft1000d_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct ft1000d_priv_data *priv;
ft1000d_op_data_t *p;

Wyświetl plik

@ -193,8 +193,8 @@ int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value);
int ft1000d_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int ft1000d_set_mem(RIG *rig, vfo_t vfo, int ch);
int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch);
int ft1000d_set_channel (RIG *rig, const channel_t *chan);
int ft1000d_get_channel (RIG *rig, channel_t *chan, int read_only);
int ft1000d_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
int ft1000d_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
/*

Wyświetl plik

@ -42,16 +42,16 @@ const struct newcat_priv_caps ftdx1200_priv_caps =
{
.roofing_filter_count = 7,
.roofing_filters =
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
}
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
}
};
const struct confparams ftdx1200_ext_levels[] =
@ -63,11 +63,15 @@ const struct confparams ftdx1200_ext_levels[] =
"Roofing filter",
NULL,
RIG_CONF_COMBO,
{ .c = { .combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz",
NULL }
} }
{
.c = {
.combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz",
NULL
}
}
}
},
{ RIG_CONF_END, NULL, }
};

Wyświetl plik

@ -44,16 +44,16 @@ const struct newcat_priv_caps ft2000_priv_caps =
{
.roofing_filter_count = 7,
.roofing_filters =
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
}
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
}
};
const struct confparams ft2000_ext_levels[] =
@ -65,11 +65,15 @@ const struct confparams ft2000_ext_levels[] =
"Roofing filter",
NULL,
RIG_CONF_COMBO,
{ .c = { .combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz",
NULL }
} }
{
.c = {
.combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz",
NULL
}
}
}
},
{ RIG_CONF_END, NULL, }
};

Wyświetl plik

@ -40,20 +40,20 @@ const struct newcat_priv_caps ftdx3000_priv_caps =
{
.roofing_filter_count = 11,
.roofing_filters =
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 },
{ .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
{ .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 },
{ .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 },
}
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 },
{ .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
{ .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 },
{ .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 },
}
};
const struct confparams ftdx3000_ext_levels[] =
@ -65,11 +65,15 @@ const struct confparams ftdx3000_ext_levels[] =
"Roofing filter",
NULL,
RIG_CONF_COMBO,
{ .c = { .combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz", "300 Hz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz", "AUTO - 300 Hz",
NULL }
} }
{
.c = {
.combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz", "300 Hz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz", "AUTO - 300 Hz",
NULL
}
}
}
},
{ RIG_CONF_END, NULL, }
};

Wyświetl plik

@ -40,20 +40,20 @@ const struct newcat_priv_caps ftdx5000_priv_caps =
{
.roofing_filter_count = 11,
.roofing_filters =
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 },
{ .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
{ .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 },
{ .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 },
}
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 },
{ .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
{ .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 },
{ .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 },
}
};
const struct confparams ftdx5000_ext_levels[] =
@ -65,11 +65,15 @@ const struct confparams ftdx5000_ext_levels[] =
"Roofing filter",
NULL,
RIG_CONF_COMBO,
{ .c = { .combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz (Main)", "300 Hz (Main)",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz (Main)", "AUTO - 300 Hz (Main)",
NULL }
} }
{
.c = {
.combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz (Main)", "300 Hz (Main)",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz (Main)", "AUTO - 300 Hz (Main)",
NULL
}
}
}
},
{ RIG_CONF_END, NULL, }
};

Wyświetl plik

@ -191,7 +191,7 @@ const struct rig_caps ft897_caps =
RIG_MODEL(RIG_MODEL_FT897),
.model_name = "FT-897",
.mfg_name = "Yaesu",
.version = "20200903.0",
.version = "20201130.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -303,8 +303,10 @@ const struct rig_caps ft897_caps =
.rig_cleanup = ft897_cleanup,
.rig_open = ft897_open,
.rig_close = ft897_close,
.get_vfo = ft857_get_vfo,
.set_vfo = ft857_set_vfo,
// .get_vfo = ft857_get_vfo,
// set_vfo not working on serial# 5n660296
// .set_vfo = ft857_set_vfo,
.set_vfo = NULL,
.set_freq = ft897_set_freq,
.get_freq = ft897_get_freq,
.set_mode = ft897_set_mode,

Wyświetl plik

@ -42,16 +42,16 @@ const struct newcat_priv_caps ft950_priv_caps =
{
.roofing_filter_count = 7,
.roofing_filters =
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
}
{
// The index must match ext level combo index
{ .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 },
{ .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 },
{ .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 },
{ .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 },
{ .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 },
{ .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 },
{ .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
}
};
const struct confparams ft950_ext_levels[] =
@ -63,11 +63,15 @@ const struct confparams ft950_ext_levels[] =
"Roofing filter",
NULL,
RIG_CONF_COMBO,
{ .c = { .combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz",
NULL }
} }
{
.c = {
.combostr = {
"AUTO", "15 kHz", "6 kHz", "3 kHz",
"AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz",
NULL
}
}
}
},
{ RIG_CONF_END, NULL, }
};

Wyświetl plik

@ -2615,7 +2615,7 @@ int ft990_get_mem(RIG *rig, vfo_t vfo, int *ch)
* -------------------------------------------------------------------------
* Returns RIG_OK on success or an error code on failure
*/
int ft990_set_channel(RIG *rig, const channel_t *chan)
int ft990_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -2647,7 +2647,7 @@ int ft990_set_channel(RIG *rig, const channel_t *chan)
* Status for split operation, active rig functions and tuning steps
* are only relevant for currVFO
*/
int ft990_get_channel(RIG *rig, channel_t *chan, int read_only)
int ft990_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct ft990_priv_data *priv;
ft990_op_data_t *p;

Wyświetl plik

@ -175,8 +175,8 @@ int ft990_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int ft990_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int ft990_set_mem(RIG *rig, vfo_t vfo, int ch);
int ft990_get_mem(RIG *rig, vfo_t vfo, int *ch);
int ft990_set_channel (RIG *rig, const channel_t *chan);
int ft990_get_channel (RIG *rig, channel_t *chan, int read_only);
int ft990_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
int ft990_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
/*

Wyświetl plik

@ -1498,6 +1498,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band
if (err < 0)
{
return err;
@ -1510,7 +1511,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 100 kHz
offs /= 100000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs,
cat_term);
}
else if (is_ft2000)
{
@ -1531,7 +1533,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else if (is_ft950)
{
@ -1552,7 +1555,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else if (is_ft891)
{
@ -1573,7 +1577,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else if (is_ft991)
{
@ -1602,7 +1607,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else if (is_ftdx1200)
{
@ -1623,7 +1629,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else if (is_ftdx3000)
{
@ -1644,7 +1651,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else if (is_ftdx5000)
{
@ -1665,7 +1673,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else if (is_ftdx101)
{
@ -1686,7 +1695,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
// Step size is 1 kHz
offs /= 1000;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
cat_term);
}
else
{
@ -1709,6 +1719,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band
if (err < 0)
{
return err;
@ -1895,6 +1906,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs)
}
err = newcat_get_cmd(rig);
if (err != RIG_OK)
{
return err;
@ -3188,6 +3200,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
priv->cmd_str[2] = main_sub_vfo;
}
break;
case RIG_LEVEL_IF:
@ -3217,7 +3230,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
}
else if (is_ft891)
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS0%d%+.4d%c", val.i == 0 ? 0 : 1,
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS0%d%+.4d%c",
val.i == 0 ? 0 : 1,
val.i, cat_term);
}
else
@ -3235,8 +3249,10 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
priv->question_mark_response_means_rejected = 1;
break;
case RIG_LEVEL_CWPITCH: {
case RIG_LEVEL_CWPITCH:
{
int kp;
if (!newcat_valid_command(rig, "KP"))
{
return -RIG_ENAVAIL;
@ -3526,7 +3542,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PL%03d%c", fpf, cat_term);
break;
case RIG_LEVEL_BKINDL: {
case RIG_LEVEL_BKINDL:
{
int millis;
value_t keyspd;
@ -3537,6 +3554,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
// Convert 10/ths of dots to milliseconds using the current key speed
err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd);
if (err != RIG_OK)
{
return err;
@ -3556,7 +3574,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
else
{
// This covers 300-2900 06-32
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((millis - 300) / 100));
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;",
6 + ((millis - 300) / 100));
}
}
else if (is_ftdx5000)
@ -3565,6 +3584,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
millis = 20;
}
if (millis > 5000)
{
millis = 5000;
@ -3572,12 +3592,14 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term);
}
else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000)
else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200
|| is_ftdx3000)
{
if (millis < 30)
{
millis = 30;
}
if (millis > 3000)
{
millis = 3000;
@ -3591,6 +3613,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
millis = 0;
}
if (millis > 5000)
{
millis = 5000;
@ -3604,6 +3627,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
millis = 1;
}
if (millis > 5000)
{
millis = 5000;
@ -3787,6 +3811,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
val.i = 320;
}
}
if (is_ft950 || is_ftdx9000)
{
if (val.i > 300)
@ -3838,6 +3863,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML1%03d%c", fpf, cat_term);
}
break;
default:
@ -3939,6 +3965,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
priv->cmd_str[2] = main_sub_vfo;
}
break;
case RIG_LEVEL_CWPITCH:
@ -4206,6 +4233,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML1%c", cat_term);
}
break;
default:
@ -4416,7 +4444,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->f = (float)atoi(retlvl) / scale;
break;
case RIG_LEVEL_BKINDL: {
case RIG_LEVEL_BKINDL:
{
int raw_value = atoi(retlvl);
int millis;
value_t keyspd;
@ -4426,12 +4455,19 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
switch (raw_value)
{
case 0: millis = 30; break;
case 1: millis = 50; break;
case 2: millis = 100; break;
case 3: millis = 150; break;
case 4: millis = 200; break;
case 5: millis = 250; break;
case 6: millis = 300; break;
default:
millis = (raw_value - 6) * 100 + 300;
}
@ -4444,6 +4480,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
// Convert milliseconds to 10/ths of dots using the current key speed
err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd);
if (err != RIG_OK)
{
return err;
@ -4452,6 +4489,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->i = millis_to_dot10ths(millis, keyspd.i);
break;
}
case RIG_LEVEL_STRENGTH:
if (rig->caps->str_cal.size > 0)
{
@ -4551,7 +4589,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
break;
case RIG_LEVEL_PREAMP: {
case RIG_LEVEL_PREAMP:
{
int preamp;
if (retlvl[0] < '0' || retlvl[0] > '9')
@ -4574,10 +4613,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
}
}
break;
}
case RIG_LEVEL_ATT: {
case RIG_LEVEL_ATT:
{
int att;
if (retlvl[0] < '0' || retlvl[0] > '9')
@ -4600,6 +4641,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
}
}
break;
}
@ -4609,15 +4651,19 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case '0':
val->i = RIG_AGC_OFF;
break;
case '1':
val->i = RIG_AGC_FAST;
break;
case '2':
val->i = RIG_AGC_MEDIUM;
break;
case '3':
val->i = RIG_AGC_SLOW;
break;
case '4':
case '5':
case '6':
@ -4639,6 +4685,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
// Most Yaesu rigs seem to use range of 0-75 to represent pitch of 300..1050 Hz in 10 Hz steps
val->i = (atoi(retlvl) * 10) + 300;
}
break;
case RIG_LEVEL_METER:
@ -4777,7 +4824,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
return -RIG_ENAVAIL;
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0 , cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0,
cat_term);
if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE)
{
@ -4859,11 +4907,13 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
if (is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000 || is_ftdx101)
{
// There seems to be an error in the manuals for some of these rigs stating that values should be 1 = OFF and 2 = ON, but they are 0 = OFF and 1 = ON instead
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%d%c", status ? 1 : 0, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%d%c", status ? 1 : 0,
cat_term);
}
else
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0, cat_term);
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0,
cat_term);
}
break;
@ -5336,7 +5386,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch)
/* Test for valid usable channel, skip if empty */
memset(&valid_chan, 0, sizeof(channel_t));
valid_chan.channel_num = ch;
err = newcat_get_channel(rig, &valid_chan, 1);
err = newcat_get_channel(rig, vfo, &valid_chan, 1);
if (err < 0)
{
@ -5620,7 +5670,7 @@ int newcat_decode_event(RIG *rig)
}
int newcat_set_channel(RIG *rig, const channel_t *chan)
int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct rig_state *state = &rig->state;
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
@ -5778,7 +5828,7 @@ int newcat_set_channel(RIG *rig, const channel_t *chan)
}
int newcat_get_channel(RIG *rig, channel_t *chan, int read_only)
int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
char *retval;
@ -6013,7 +6063,7 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command)
is_ftdx101 = newcat_is_rig(rig, RIG_MODEL_FTDX101D);
if (!is_ft450 && !is_ft950 && !is_ft891 && !is_ft991 && !is_ft2000
&& !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101)
&& !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101)
{
rig_debug(RIG_DEBUG_ERR, "%s: '%s' is unknown\n", __func__, caps->model_name);
return FALSE;
@ -6513,6 +6563,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_CWR:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6530,12 +6581,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 1700) { w = 11; }
else if (width <= 2000) { w = 12; }
else { w = 13; } // 2400 Hz
break;
case RIG_MODE_LSB:
case RIG_MODE_USB:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6562,6 +6615,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2800) { w = 18; }
else if (width <= 2900) { w = 19; }
else { w = 20; } // 3000 Hz
break;
case RIG_MODE_AM:
@ -6593,6 +6647,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
case RIG_MODE_FMN:
@ -6611,6 +6666,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_CWR:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6634,12 +6690,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2000) { w = 15; }
else if (width <= 2400) { w = 16; }
else { w = 17; } // 3000 Hz
break;
case RIG_MODE_LSB:
case RIG_MODE_USB:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6667,6 +6725,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2900) { w = 19; }
else if (width <= 3000) { w = 20; }
else { w = 21; } // 3000 Hz
break;
case RIG_MODE_AM:
@ -6680,6 +6739,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
case RIG_MODE_FMN:
@ -6701,6 +6761,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_CWR:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6724,12 +6785,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2000) { w = 15; }
else if (width <= 2400) { w = 16; }
else { w = 17; } // 3000 Hz
break;
case RIG_MODE_LSB:
case RIG_MODE_USB:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6757,6 +6820,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2900) { w = 19; }
else if (width <= 3000) { w = 20; }
else { w = 21; } // 3200 Hz
break;
case RIG_MODE_AM: // Only 1 passband each for AM or AMN
@ -6764,6 +6828,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
case RIG_MODE_AMN:
@ -6771,6 +6836,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, TRUE);
}
return err;
case RIG_MODE_FM: // Only 1 passband each for FM or FMN
@ -6778,6 +6844,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
case RIG_MODE_FMN:
@ -6785,6 +6852,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, TRUE);
}
return err;
case RIG_MODE_C4FM:
@ -6800,6 +6868,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
return -RIG_EINVAL;
}
return err;
case RIG_MODE_PKTFM:
@ -6811,6 +6880,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
default:
@ -6830,6 +6900,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_CWR:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6852,12 +6923,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 1700) { w = 14; }
else if (width <= 2000) { w = 15; }
else { w = 16; } // 2400 Hz
break;
case RIG_MODE_LSB:
case RIG_MODE_USB:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6889,6 +6962,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 3600) { w = 23; }
else if (width <= 3800) { w = 24; }
else { w = 25; } // 4000 Hz
break;
case RIG_MODE_AM:
@ -6923,6 +6997,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
}
} // end is_ftdx1200 and is_ftdx3000
@ -6938,6 +7013,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_CWR:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6960,12 +7036,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 1700) { w = 14; }
else if (width <= 2000) { w = 15; }
else { w = 16; } // 2400 Hz
break;
case RIG_MODE_LSB:
case RIG_MODE_USB:
// Narrow mode must be chosen correctly before filter width
err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE);
if (err != RIG_OK)
{
return err;
@ -6996,6 +7074,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 3600) { w = 23; }
else if (width <= 3800) { w = 24; }
else { w = 25; } // 4000 Hz
break;
case RIG_MODE_AM:
@ -7030,6 +7109,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
}
} // end is_ftdx5000
@ -7062,6 +7142,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 2000) { w = 16; }
else if (width <= 2400) { w = 17; }
else { w = 18; }
break;
case RIG_MODE_LSB:
@ -7090,6 +7171,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else if (width <= 3200) { w = 21; }
else if (width <= 3500) { w = 22; }
else { w = 23; } // 4000Hz
break;
case RIG_MODE_AM:
@ -7122,6 +7204,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
case RIG_MODE_AMN:
@ -7144,6 +7227,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (width <= 500) { w = 6; }
else if (width <= 1800) { w = 16; }
else { w = 24; }
break;
case RIG_MODE_LSB:
@ -7151,6 +7235,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (width <= 1800) { w = 8; }
else if (width <= 2400) { w = 16; }
else { w = 25; } // 3000
break;
case RIG_MODE_AM:
@ -7164,6 +7249,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
err = newcat_set_narrow(rig, vfo, FALSE);
}
return err;
case RIG_MODE_FMN:
@ -7407,6 +7493,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
cat_term);
err = newcat_get_cmd(rig);
if (err != RIG_OK)
{
return err;
@ -7547,6 +7634,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
default:
return -RIG_EINVAL;
}
break;
case RIG_MODE_AM:
@ -7593,6 +7681,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
{
*width = narrow ? 300 : 500;
}
break;
case 1: *width = 50; break;
@ -7732,6 +7821,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
{
*width = narrow ? 300 : 500;
}
break;
case 1: *width = 50; break;
@ -8308,6 +8398,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
{
*width = rig_passband_normal(rig, mode);
}
break;
case RIG_MODE_AM:
@ -8644,7 +8735,8 @@ int newcat_get_cmd(RIG *rig)
{
rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n",
__func__, priv->ret_data);
rc = -RIG_BUSBUSY; /* don't write command again */
// we were using BUSBUSY but microham devices need retries
//rc = -RIG_BUSBUSY; /* don't write command again */
/* we could decrement retry_count
here but there is a danger of
infinite looping so we just use up
@ -8717,7 +8809,9 @@ int newcat_get_cmd(RIG *rig)
*/
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply %.2s for command %.2s\n",
__func__, priv->ret_data, priv->cmd_str);
rc = -RIG_BUSBUSY; /* retry read only */
// we were using BUSBUSY but microham devices need retries
// this should be OK under all other circumstances too
//rc = -RIG_BUSBUSY; /* retry read only */
}
}
@ -8820,6 +8914,7 @@ int newcat_set_cmd(RIG *rig)
break; /* retry */
case '?':
/* The ? response is ambiguous and undocumented by Yaesu. For set commands it seems to indicate:
* 1) either that the rig is busy and the command needs to be retried
* 2) or that the rig rejected the command because the state of the rig is not valid for the command

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
#define NEWCAT_VER "20201111"
#define NEWCAT_VER "20201121"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
@ -211,8 +211,8 @@ int newcat_set_ts(RIG * rig, vfo_t vfo, shortfreq_t ts);
int newcat_get_ts(RIG * rig, vfo_t vfo, shortfreq_t * ts);
int newcat_set_trn(RIG * rig, int trn);
int newcat_get_trn(RIG * rig, int *trn);
int newcat_set_channel(RIG * rig, const channel_t * chan);
int newcat_get_channel(RIG * rig, channel_t * chan, int read_only);
int newcat_set_channel(RIG * rig, vfo_t vfo, const channel_t * chan);
int newcat_get_channel(RIG * rig, vfo_t vfo, channel_t * chan, int read_only);
rmode_t newcat_rmode(char mode);
char newcat_modechar(rmode_t rmode);
rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width);

Wyświetl plik

@ -42,7 +42,7 @@
#include "gs232a.h"
#define EOM "\r"
#define REPLY_EOM "\r\n"
#define REPLY_EOM "\n"
#define BUFSZ 64
@ -103,6 +103,15 @@ transaction_write:
retval = read_string(&rs->rotport, data, data_len, REPLY_EOM,
strlen(REPLY_EOM));
if (strncmp(data, "\r\n", 2) == 0
|| strchr(data, '>'))
{
rig_debug(RIG_DEBUG_ERR, "%s: wrong response nbytes=%d\n", __func__,
(int)strlen(data));
dump_hex((unsigned char *)data, strlen(data));
retval = -1; // force retry
}
if (retval < 0)
{
if (retry_read++ < rot->state.rotport.retry)
@ -303,7 +312,7 @@ const struct rot_caps gs23_rot_caps =
ROT_MODEL(ROT_MODEL_GS23),
.model_name = "GS-23",
.mfg_name = "Yaesu/Kenpro",
.version = "20200617.0",
.version = "20201202.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
@ -315,7 +324,7 @@ const struct rot_caps gs23_rot_caps =
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.post_write_delay = 50,
.timeout = 400,
.retry = 3,
@ -339,7 +348,7 @@ const struct rot_caps gs232_rot_caps =
ROT_MODEL(ROT_MODEL_GS232),
.model_name = "GS-232",
.mfg_name = "Yaesu/Kenpro",
.version = "20200605.0",
.version = "20201202.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
@ -351,7 +360,7 @@ const struct rot_caps gs232_rot_caps =
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.post_write_delay = 50,
.timeout = 400,
.retry = 3,
@ -375,7 +384,7 @@ const struct rot_caps gs232a_rot_caps =
ROT_MODEL(ROT_MODEL_GS232A),
.model_name = "GS-232A",
.mfg_name = "Yaesu",
.version = "20200505.0",
.version = "20201205.0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rot_type = ROT_TYPE_OTHER,
@ -387,7 +396,7 @@ const struct rot_caps gs232a_rot_caps =
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.post_write_delay = 50,
.timeout = 400,
.retry = 3,

Wyświetl plik

@ -43,7 +43,7 @@
#include "gs232a.h"
#define EOM "\r"
#define REPLY_EOM "\r\n"
#define REPLY_EOM "\n"
#define BUFSZ 64
@ -110,6 +110,16 @@ transaction_write:
retval = read_string(&rs->rotport, data, data_len, REPLY_EOM,
strlen(REPLY_EOM));
if (strncmp(data, "\r\n", 2) == 0
|| strchr(data, '>'))
{
rig_debug(RIG_DEBUG_ERR, "%s: wrong response nbytes=%d\n", __func__,
(int)strlen(data));
dump_hex((unsigned char *)data, strlen(data));
retval = -1; // force retry
}
if (retval < 0)
{
if (retry_read++ < rot->state.rotport.retry)
@ -340,7 +350,7 @@ const struct rot_caps gs232b_rot_caps =
ROT_MODEL(ROT_MODEL_GS232B),
.model_name = "GS-232B",
.mfg_name = "Yaesu",
.version = "20200617.0",
.version = "20201202.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@ -352,7 +362,7 @@ const struct rot_caps gs232b_rot_caps =
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.post_write_delay = 50,
.timeout = 400,
.retry = 3,

Wyświetl plik

@ -202,9 +202,10 @@ transaction_write:
data_len = BUFSZ;
}
#if 0 // manual says no echos
/* first reply is an echo */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, LF, strlen(LF));
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
if (retval < 0)
{
@ -216,9 +217,11 @@ transaction_write:
goto transaction_quit;
}
#endif
/* then comes the answer */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, LF, strlen(LF));
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
if (retval < 0)
{
@ -240,17 +243,46 @@ static int
rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
{
char cmdstr[64];
int retval1, retval2;
int retval1, retval2 = RIG_OK;
rig_debug(RIG_DEBUG_TRACE, "%s called: %f %f\n", __func__, az, el);
num_sprintf(cmdstr, "A%3.1f"CR, az);
if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZ)
{
// we only do azimuth and this is the old protocol
// we have to switch modes and then send azimuth
// an extra CR gives us a response to expect
num_sprintf(cmdstr, "A\r%.0f\r\r", az);
}
else
{
// does the new protocol use decimal points?
// we'll assume no for now
num_sprintf(cmdstr, "A%0f"CR, az);
}
retval1 = rc2800_transaction(rot, cmdstr, NULL, 0);
if (rot->caps->rot_type == ROT_TYPE_AZIMUTH)
{
return retval1;
}
/* do not overwhelm the MCU? */
hl_usleep(200 * 1000);
num_sprintf(cmdstr, "E%3.1f"CR, el);
if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZEL)
{
// this is the old protocol
// we have to switch modes and then send azimuth
// an extra CR gives us a response to expect
num_sprintf(cmdstr, "E\r%.0f\r\r", el);
}
else
{
num_sprintf(cmdstr, "E%.0f"CR, el);
}
retval2 = rc2800_transaction(rot, cmdstr, NULL, 0);
if (retval1 == retval2)
@ -271,6 +303,8 @@ rc2800_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
*el = 0;
retval = rc2800_transaction(rot, "A" CR, posbuf, sizeof(posbuf));
if (retval != RIG_OK || strlen(posbuf) < 5)
@ -290,27 +324,36 @@ rc2800_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
}
}
retval = rc2800_transaction(rot, "E" CR, posbuf, sizeof(posbuf));
if (retval != RIG_OK || strlen(posbuf) < 5)
if (rot->caps->rot_model == ROT_MODEL_RC2800)
{
return retval < 0 ? retval : -RIG_EPROTO;
retval = rc2800_transaction(rot, "E" CR, posbuf, sizeof(posbuf));
if (retval != RIG_OK || strlen(posbuf) < 5)
{
return retval < 0 ? retval : -RIG_EPROTO;
}
if (rc2800_parse(posbuf, &device, &value) == RIG_OK)
{
if (device == 'E')
{
*el = (elevation_t) value;
}
else
{
return -RIG_EPROTO;
}
}
rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n",
__func__, *az, *el);
}
else
{
rig_debug(RIG_DEBUG_TRACE, "%s: (az) = (%.1f)\n",
__func__, *az);
}
if (rc2800_parse(posbuf, &device, &value) == RIG_OK)
{
if (device == 'E')
{
*el = (elevation_t) value;
}
else
{
return -RIG_EPROTO;
}
}
rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n",
__func__, *az, *el);
return RIG_OK;
}
@ -333,6 +376,11 @@ rc2800_rot_stop(ROT *rot)
if (retval != RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: az S command failed?\n", __func__); }
if (rot->caps->rot_type == ROT_TYPE_AZIMUTH)
{
return retval;
}
/* do not overwhelm the MCU? */
hl_usleep(200 * 1000);
@ -365,7 +413,7 @@ const struct rot_caps rc2800_rot_caps =
ROT_MODEL(ROT_MODEL_RC2800),
.model_name = "RC2800",
.mfg_name = "M2",
.version = "20200107.0",
.version = "20201130",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rot_type = ROT_TYPE_AZEL,
@ -391,6 +439,69 @@ const struct rot_caps rc2800_rot_caps =
.stop = rc2800_rot_stop,
};
// below tested on RC2800P-A
const struct rot_caps rc2800az_rot_caps =
{
ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZ),
.model_name = "RC2800_EARLY_AZ",
.mfg_name = "M2",
.version = "20201130",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZIMUTH,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 9600,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.min_az = 0.0,
.max_az = 360.0,
.min_el = 0.0,
.max_el = 180.0,
.get_position = rc2800_rot_get_position,
.set_position = rc2800_rot_set_position,
.stop = rc2800_rot_stop,
};
const struct rot_caps rc2800azel_rot_caps =
{
ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZEL),
.model_name = "RC2800_EARLY_AZEL",
.mfg_name = "M2",
.version = "20201130",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 9600,
.serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
.retry = 3,
.min_az = 0.0,
.max_az = 360.0,
.min_el = 0.0,
.max_el = 180.0,
.get_position = rc2800_rot_get_position,
.set_position = rc2800_rot_set_position,
.stop = rc2800_rot_stop,
};
/* ************************************************************************* */
DECLARE_INITROT_BACKEND(m2)
@ -398,6 +509,8 @@ DECLARE_INITROT_BACKEND(m2)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rot_register(&rc2800_rot_caps);
rot_register(&rc2800az_rot_caps);
rot_register(&rc2800azel_rot_caps);
return RIG_OK;
}

Wyświetl plik

@ -143,6 +143,11 @@ static const struct confparams frontend_cfg_params[] =
"True enables ptt port to be shared with other apps",
"0", RIG_CONF_CHECKBUTTON, { }
},
{
TOK_FLUSHX, "flushx", "Flush with read instead of TCFLUSH",
"True enables flushing serial port with read instead of TCFLUSH -- MicroHam",
"0", RIG_CONF_CHECKBUTTON, { }
},
{ RIG_CONF_END, NULL, }
};
@ -594,6 +599,14 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
rs->ptt_share = val_i ? 1 : 0;
break;
case TOK_FLUSHX:
if (1 != sscanf(val, "%d", &val_i))
{
return -RIG_EINVAL; //value format error
}
rs->rigport.flushx = val_i ? 1 : 0;
break;
default:
return -RIG_EINVAL;

101
src/mem.c
Wyświetl plik

@ -685,12 +685,12 @@ static int generic_restore_channel(RIG *rig, const channel_t *chan)
*
* \sa rig_get_channel()
*/
int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
int HAMLIB_API rig_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct rig_caps *rc;
int curr_chan_num, get_mem_status = RIG_OK;
vfo_t curr_vfo;
vfo_t vfo; /* requested vfo */
vfo_t vfotmp; /* requested vfo */
int retcode;
int can_emulate_by_vfo_mem, can_emulate_by_vfo_op;
@ -709,7 +709,7 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
if (rc->set_channel)
{
return rc->set_channel(rig, chan);
return rc->set_channel(rig, vfo, chan);
}
/*
@ -717,15 +717,15 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
* Optional: get_vfo, set_vfo,
*/
vfo = chan->vfo;
vfotmp = chan->vfo;
if (vfo == RIG_VFO_CURR)
if (vfotmp == RIG_VFO_CURR)
{
return generic_restore_channel(rig, chan);
}
/* any emulation requires set_mem() */
if (vfo == RIG_VFO_MEM && !rc->set_mem)
if (vfotmp == RIG_VFO_MEM && !rc->set_mem)
{
return -RIG_ENAVAIL;
}
@ -743,14 +743,14 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
curr_vfo = rig->state.current_vfo;
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
get_mem_status = rig_get_mem(rig, RIG_VFO_CURR, &curr_chan_num);
}
if (can_emulate_by_vfo_mem && curr_vfo != vfo)
if (can_emulate_by_vfo_mem && curr_vfo != vfotmp)
{
retcode = rig_set_vfo(rig, vfo);
retcode = rig_set_vfo(rig, vfotmp);
if (retcode != RIG_OK)
{
@ -758,7 +758,7 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
}
}
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
rig_set_mem(rig, RIG_VFO_CURR, chan->channel_num);
}
@ -776,7 +776,7 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
}
/* restore current memory number */
if (vfo == RIG_VFO_MEM && get_mem_status == RIG_OK)
if (vfotmp == RIG_VFO_MEM && get_mem_status == RIG_OK)
{
rig_set_mem(rig, RIG_VFO_CURR, curr_chan_num);
}
@ -829,12 +829,13 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
*
* \sa rig_set_channel()
*/
int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan,
int read_only)
{
struct rig_caps *rc;
int curr_chan_num, get_mem_status = RIG_OK;
vfo_t curr_vfo;
vfo_t vfo; /* requested vfo */
vfo_t vfotmp = RIG_VFO_NONE; /* requested vfo */
int retcode = RIG_OK;
int can_emulate_by_vfo_mem, can_emulate_by_vfo_op;
@ -853,7 +854,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
if (rc->get_channel)
{
return rc->get_channel(rig, chan, read_only);
return rc->get_channel(rig, vfotmp, chan, read_only);
}
/*
@ -861,15 +862,15 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
* Optional: get_vfo, set_vfo
* TODO: check return codes
*/
vfo = chan->vfo;
vfotmp = chan->vfo;
if (vfo == RIG_VFO_CURR)
if (vfotmp == RIG_VFO_CURR)
{
return generic_save_channel(rig, chan);
}
/* any emulation requires set_mem() */
if (vfo == RIG_VFO_MEM && !rc->set_mem)
if (vfotmp == RIG_VFO_MEM && !rc->set_mem)
{
return -RIG_ENAVAIL;
}
@ -887,16 +888,16 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
curr_vfo = rig->state.current_vfo;
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
get_mem_status = rig_get_mem(rig, RIG_VFO_CURR, &curr_chan_num);
}
if (!read_only)
{
if (can_emulate_by_vfo_mem && curr_vfo != vfo)
if (can_emulate_by_vfo_mem && curr_vfo != vfotmp)
{
retcode = rig_set_vfo(rig, vfo);
retcode = rig_set_vfo(rig, vfotmp);
if (retcode != RIG_OK)
{
@ -904,7 +905,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
}
}
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
rig_set_mem(rig, RIG_VFO_CURR, chan->channel_num);
}
@ -922,7 +923,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
retcode = generic_save_channel(rig, chan);
/* restore current memory number */
if (vfo == RIG_VFO_MEM && get_mem_status == RIG_OK)
if (vfotmp == RIG_VFO_MEM && get_mem_status == RIG_OK)
{
rig_set_mem(rig, RIG_VFO_CURR, curr_chan_num);
}
@ -939,7 +940,8 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
#ifndef DOC_HIDDEN
int get_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb,
rig_ptr_t arg)
{
int i, j;
chan_t *chan_list = rig->state.chan_list;
@ -977,7 +979,7 @@ int get_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
/*
* TODO: if doesn't have rc->get_channel, special generic
*/
retval = rig_get_channel(rig, chan, 1);
retval = rig_get_channel(rig, vfo, chan, 1);
if (retval == -RIG_ENAVAIL)
{
@ -1004,7 +1006,8 @@ int get_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
}
int set_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int set_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb,
rig_ptr_t arg)
{
int i, j, retval;
chan_t *chan_list = rig->state.chan_list;
@ -1019,7 +1022,7 @@ int set_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
chan_cb(rig, &chan, j, chan_list, arg);
chan->vfo = RIG_VFO_MEM;
retval = rig_set_channel(rig, chan);
retval = rig_set_channel(rig, vfo, chan);
if (retval != RIG_OK)
{
@ -1076,7 +1079,8 @@ static int map_chan(RIG *rig,
*
* \sa rig_set_chan_all(), rig_get_chan_all_cb()
*/
int HAMLIB_API rig_set_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb,
rig_ptr_t arg)
{
struct rig_caps *rc;
int retval;
@ -1092,11 +1096,11 @@ int HAMLIB_API rig_set_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
if (rc->set_chan_all_cb)
{
return rc->set_chan_all_cb(rig, chan_cb, arg);
return rc->set_chan_all_cb(rig, vfo, chan_cb, arg);
}
/* if not available, emulate it */
retval = set_chan_all_cb_generic(rig, chan_cb, arg);
retval = set_chan_all_cb_generic(rig, vfo, chan_cb, arg);
return retval;
}
@ -1122,7 +1126,8 @@ int HAMLIB_API rig_set_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
*
* \sa rig_get_chan_all(), rig_set_chan_all_cb()
*/
int HAMLIB_API rig_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int HAMLIB_API rig_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb,
rig_ptr_t arg)
{
struct rig_caps *rc;
int retval;
@ -1138,12 +1143,12 @@ int HAMLIB_API rig_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
if (rc->get_chan_all_cb)
{
return rc->get_chan_all_cb(rig, chan_cb, arg);
return rc->get_chan_all_cb(rig, vfo, chan_cb, arg);
}
/* if not available, emulate it */
retval = get_chan_all_cb_generic(rig, chan_cb, arg);
retval = get_chan_all_cb_generic(rig, vfo, chan_cb, arg);
return retval;
}
@ -1162,7 +1167,7 @@ int HAMLIB_API rig_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
*
* \sa rig_set_chan_all_cb(), rig_get_chan_all()
*/
int HAMLIB_API rig_set_chan_all(RIG *rig, const channel_t chans[])
int HAMLIB_API rig_set_chan_all(RIG *rig, vfo_t vfo, const channel_t chans[])
{
struct rig_caps *rc;
struct map_all_s map_arg;
@ -1180,12 +1185,12 @@ int HAMLIB_API rig_set_chan_all(RIG *rig, const channel_t chans[])
if (rc->set_chan_all_cb)
{
return rc->set_chan_all_cb(rig, map_chan, (rig_ptr_t)&map_arg);
return rc->set_chan_all_cb(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
}
/* if not available, emulate it */
retval = set_chan_all_cb_generic(rig, map_chan, (rig_ptr_t)&map_arg);
retval = set_chan_all_cb_generic(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
return retval;
}
@ -1204,7 +1209,7 @@ int HAMLIB_API rig_set_chan_all(RIG *rig, const channel_t chans[])
*
* \sa rig_get_chan_all_cb(), rig_set_chan_all()
*/
int HAMLIB_API rig_get_chan_all(RIG *rig, channel_t chans[])
int HAMLIB_API rig_get_chan_all(RIG *rig, vfo_t vfo, channel_t chans[])
{
struct rig_caps *rc;
struct map_all_s map_arg;
@ -1222,7 +1227,7 @@ int HAMLIB_API rig_get_chan_all(RIG *rig, channel_t chans[])
if (rc->get_chan_all_cb)
{
return rc->get_chan_all_cb(rig, map_chan, (rig_ptr_t)&map_arg);
return rc->get_chan_all_cb(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
}
/*
@ -1230,7 +1235,7 @@ int HAMLIB_API rig_get_chan_all(RIG *rig, channel_t chans[])
*
* TODO: save_current_state, restore_current_state
*/
retval = get_chan_all_cb_generic(rig, map_chan, (rig_ptr_t)&map_arg);
retval = get_chan_all_cb_generic(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
return retval;
}
@ -1283,14 +1288,16 @@ static int map_parm(RIG *rig, const struct confparams *cfgps, value_t *value,
}
int get_parm_all_cb_generic(RIG *rig, confval_cb_t parm_cb, rig_ptr_t cfgps,
int get_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb,
rig_ptr_t cfgps,
rig_ptr_t vals)
{
return -RIG_ENIMPL;
}
int set_parm_all_cb_generic(RIG *rig, confval_cb_t parm_cb, rig_ptr_t cfgps,
int set_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb,
rig_ptr_t cfgps,
rig_ptr_t vals)
{
return -RIG_ENIMPL;
@ -1318,6 +1325,7 @@ int set_parm_all_cb_generic(RIG *rig, confval_cb_t parm_cb, rig_ptr_t cfgps,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_set_mem_all_cb(RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t arg)
@ -1341,7 +1349,7 @@ int HAMLIB_API rig_set_mem_all_cb(RIG *rig,
/* if not available, emulate it */
retval = rig_set_chan_all_cb(rig, chan_cb, arg);
retval = rig_set_chan_all_cb(rig, vfo, chan_cb, arg);
if (retval != RIG_OK)
{
@ -1385,6 +1393,7 @@ int HAMLIB_API rig_set_mem_all_cb(RIG *rig,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_get_mem_all_cb(RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t arg)
@ -1407,7 +1416,7 @@ int HAMLIB_API rig_get_mem_all_cb(RIG *rig,
}
/* if not available, emulate it */
retval = rig_get_chan_all_cb(rig, chan_cb, arg);
retval = rig_get_chan_all_cb(rig, vfo, chan_cb, arg);
if (retval != RIG_OK)
{
@ -1450,6 +1459,7 @@ int HAMLIB_API rig_get_mem_all_cb(RIG *rig,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_set_mem_all(RIG *rig,
vfo_t vfo,
const channel_t chans[],
const struct confparams cfgps[],
const value_t vals[])
@ -1475,7 +1485,7 @@ int HAMLIB_API rig_set_mem_all(RIG *rig,
(rig_ptr_t)&mem_all_arg);
/* if not available, emulate it */
retval = rig_set_chan_all(rig, chans);
retval = rig_set_chan_all(rig, vfo, chans);
if (retval != RIG_OK)
{
@ -1517,6 +1527,7 @@ int HAMLIB_API rig_set_mem_all(RIG *rig,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_get_mem_all(RIG *rig,
vfo_t vfo,
channel_t chans[],
const struct confparams cfgps[],
value_t vals[])
@ -1546,14 +1557,14 @@ int HAMLIB_API rig_get_mem_all(RIG *rig,
*
* TODO: save_current_state, restore_current_state
*/
retval = rig_get_chan_all(rig, chans);
retval = rig_get_chan_all(rig, vfo, chans);
if (retval != RIG_OK)
{
return retval;
}
retval = get_parm_all_cb_generic(rig, map_parm,
retval = get_parm_all_cb_generic(rig, vfo, map_parm,
(rig_ptr_t)cfgps,
(rig_ptr_t)vals);

Wyświetl plik

@ -195,6 +195,24 @@ int HAMLIB_API serial_open(hamlib_port_t *rp)
* export uh_radio_fd to iofunc.c because in the case of sockets,
* read() must be used also in the WIN32 case.
* This is why uh_radio_fd is declared globally in microham.h.
* Notes from Joe Subich about microham behavior
* Microham debug tags
* A-RX ; Asynchronous data received (data not responsive to any
* poll from host or Router) - Set AI0;
* H2-RX; Data received in response to poll from Host 2 poll (2nd CAT port).
* H2-TX; Data poll/command from Host 2 (2nd CAT Port)
* R-RX; Data received in response to poll by microHAM USB Device Router
* R-TX; Router poll
* Note: R-TX; and R-RX; data is not passed to Host ports.
* 1) Router only polls when it has not seen a poll for FA; FB; and IF;
* (or equivalent for other manufacturers) within its timeout period.
* 2) The results of router's polling are not passed to the Host/apps.
* 3) Router only polls when there is no activity from the applications.
* 4) Router is designed to be transparent as far as the applications
* are concerned. The only exception is when the user chooses to
* run two applications (CAT and 2nd CAT) at the same time and has
* "auto-information" or CI-V enabled. In that case asynchronous data
* from the transceiver will be returned to both applications.
*/
uh_radio_fd = fd;
return RIG_OK;
@ -354,10 +372,10 @@ int HAMLIB_API serial_setup(hamlib_port_t *rp)
/* TODO */
rig_debug(RIG_DEBUG_TRACE, "%s: cfsetispeed=%d,0x%04x\n", __func__,
rp->parm.serial.rate, speed);
(int)rp->parm.serial.rate, (int)speed);
cfsetispeed(&options, speed);
rig_debug(RIG_DEBUG_TRACE, "%s: cfsetospeed=%d,0x%04x\n", __func__,
rp->parm.serial.rate, speed);
(int)rp->parm.serial.rate, (int)speed);
cfsetospeed(&options, speed);
/*
@ -607,7 +625,7 @@ int HAMLIB_API serial_flush(hamlib_port_t *p)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (p->fd == uh_ptt_fd || p->fd == uh_radio_fd)
if (p->fd == uh_ptt_fd || p->fd == uh_radio_fd || p->flushx)
{
unsigned char buf[32];
/*
@ -615,12 +633,13 @@ int HAMLIB_API serial_flush(hamlib_port_t *p)
* if fd corresponds to a microHam device drain the line
* (which is a socket) by reading until it is empty.
*/
int n;
int n, nbytes = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: flushing: ", __func__);
rig_debug(RIG_DEBUG_TRACE, "%s: flushing\n", __func__);
while ((n = read(p->fd, buf, 32)) > 0)
{
nbytes += n;
//int i;
//for (i = 0; i < n; ++i) { printf("0x%02x(%c) ", buf[i], isprint(buf[i]) ? buf[i] : '~'); }
@ -628,11 +647,13 @@ int HAMLIB_API serial_flush(hamlib_port_t *p)
/* do nothing */
}
rig_debug(RIG_DEBUG_TRACE, "read flushed %d bytes\n", nbytes);
return RIG_OK;
}
rig_debug(RIG_DEBUG_VERBOSE, "%s: tcflush\n", __func__);
rig_debug(RIG_DEBUG_VERBOSE, "tcflush%s\n", "");
tcflush(p->fd, TCIFLUSH);
return RIG_OK;
}

Wyświetl plik

@ -89,6 +89,8 @@
#define TOK_PTT_BITNUM TOKEN_FRONTEND(34)
/** \brief PTT share with other applications */
#define TOK_PTT_SHARE TOKEN_FRONTEND(35)
/** \brief PTT share with other applications */
#define TOK_FLUSHX TOKEN_FRONTEND(36)
/*
* rig specific tokens
*/

Wyświetl plik

@ -165,7 +165,7 @@ int dump_chan(RIG *rig, int chan_num)
chan.vfo = RIG_VFO_MEM;
chan.channel_num = chan_num;
status = rig_get_channel(rig, &chan, 1);
status = rig_get_channel(rig, RIG_VFO_NONE, &chan, 1);
if (status != RIG_OK)
{

Wyświetl plik

@ -97,7 +97,7 @@ int csv_save(RIG *rig, const char *outfilename)
rig->caps->clone_combo_get);
}
status = rig_get_chan_all_cb(rig, dump_csv_chan, f);
status = rig_get_chan_all_cb(rig, RIG_VFO_NONE, dump_csv_chan, f);
fclose(f);
@ -175,7 +175,7 @@ int csv_load(RIG *rig, const char *infilename)
set_channel_data(rig, &chan, key_list, value_list);
/* Write a rig memory */
status = rig_set_channel(rig, &chan);
status = rig_set_channel(rig, RIG_VFO_NONE, &chan);
if (status != RIG_OK)
{

Wyświetl plik

@ -3659,7 +3659,7 @@ declare_proto_rig(set_channel)
#endif
status = rig_set_channel(rig, &chan);
status = rig_set_channel(rig, vfo, &chan);
return status;
}
@ -3687,7 +3687,7 @@ declare_proto_rig(get_channel)
CHKSCN1ARG(sscanf(arg2, "%d", &read_only));
status = rig_get_channel(rig, &chan, read_only);
status = rig_get_channel(rig, RIG_VFO_NONE, &chan, read_only);
if (status != RIG_OK)
{

Wyświetl plik

@ -509,7 +509,7 @@ int clear_chans(RIG *rig, const char *infilename)
{
chan.channel_num = j;
ret = rig_set_channel(rig, &chan);
ret = rig_set_channel(rig, RIG_VFO_NONE, &chan);
if (ret != RIG_OK)
{

Wyświetl plik

@ -1461,6 +1461,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
/* only for rotctld */
if (interactive && !prompt)
{
rot_debug(RIG_DEBUG_TRACE, "%s: NETROTCTL_RET %d\n", __func__, retcode);
fprintf(fout, NETROTCTL_RET "%d\n", retcode);
// ext_resp = 0; // not used ?
resp_sep = '\n';
@ -1481,12 +1482,14 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
/* netrotctl RIG_OK */
if (!(cmd_entry->flags & ARG_OUT) && !ext_resp)
{
rot_debug(RIG_DEBUG_TRACE, "%s: NETROTCTL_RET 0\n", __func__);
fprintf(fout, NETROTCTL_RET "0\n");
}
/* Extended Response protocol */
else if (ext_resp && cmd != 0xf0)
{
rot_debug(RIG_DEBUG_TRACE, "%s: NETROTCTL_RET 0\n", __func__);
fprintf(fout, NETROTCTL_RET "0\n");
resp_sep = '\n';
}