kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit
2f40735ed7
37
Android.mk
37
Android.mk
|
@ -4,40 +4,47 @@ include $(TOP_PATH)/src/Android.mk
|
|||
|
||||
include $(TOP_PATH)/rigs/adat/Android.mk
|
||||
include $(TOP_PATH)/rigs/alinco/Android.mk
|
||||
include $(TOP_PATH)/rigs/amsat/Android.mk
|
||||
include $(TOP_PATH)/rigs/aor/Android.mk
|
||||
include $(TOP_PATH)/rigs/ars/Android.mk
|
||||
include $(TOP_PATH)/rigs/celestron/Android.mk
|
||||
include $(TOP_PATH)/rigs/barrett/Android.mk
|
||||
include $(TOP_PATH)/rigs/dorji/Android.mk
|
||||
include $(TOP_PATH)/rigs/drake/Android.mk
|
||||
include $(TOP_PATH)/rigs/dummy/Android.mk
|
||||
include $(TOP_PATH)/rigs/easycomm/Android.mk
|
||||
include $(TOP_PATH)/rigs/ether6/Android.mk
|
||||
include $(TOP_PATH)/rigs/elad/Android.mk
|
||||
include $(TOP_PATH)/rigs/flexradio/Android.mk
|
||||
include $(TOP_PATH)/rigs/fodtrack/Android.mk
|
||||
include $(TOP_PATH)/rigs/gs232a/Android.mk
|
||||
include $(TOP_PATH)/rigs/heathkit/Android.mk
|
||||
include $(TOP_PATH)/rigs/icmarine/Android.mk
|
||||
include $(TOP_PATH)/rigs/icom/Android.mk
|
||||
include $(TOP_PATH)/rigs/jrc/Android.mk
|
||||
include $(TOP_PATH)/rigs/kachina/Android.mk
|
||||
include $(TOP_PATH)/rigs/kenwood/Android.mk
|
||||
include $(TOP_PATH)/rigs/kit/Android.mk
|
||||
include $(TOP_PATH)/rigs/lowe/Android.mk
|
||||
include $(TOP_PATH)/rigs/m2/Android.mk
|
||||
include $(TOP_PATH)/rigs/meade/Android.mk
|
||||
include $(TOP_PATH)/rigs/pcr/Android.mk
|
||||
include $(TOP_PATH)/rigs/prm80/Android.mk
|
||||
include $(TOP_PATH)/rigs/racal/Android.mk
|
||||
include $(TOP_PATH)/rigs/rft/Android.mk
|
||||
include $(TOP_PATH)/rigs/rotorez/Android.mk
|
||||
include $(TOP_PATH)/rigs/rs/Android.mk
|
||||
include $(TOP_PATH)/rigs/sartek/Android.mk
|
||||
include $(TOP_PATH)/rigs/skanti/Android.mk
|
||||
include $(TOP_PATH)/rigs/spid/Android.mk
|
||||
include $(TOP_PATH)/rigs/tapr/Android.mk
|
||||
include $(TOP_PATH)/rigs/tentec/Android.mk
|
||||
include $(TOP_PATH)/rigs/ts7400/Android.mk
|
||||
include $(TOP_PATH)/rigs/tuner/Android.mk
|
||||
include $(TOP_PATH)/rigs/uniden/Android.mk
|
||||
include $(TOP_PATH)/rigs/winradio/Android.mk
|
||||
include $(TOP_PATH)/rigs/wj/Android.mk
|
||||
include $(TOP_PATH)/rigs/yaesu/Android.mk
|
||||
include $(TOP_PATH)/rotators/amsat/Android.mk
|
||||
include $(TOP_PATH)/rotators/ars/Android.mk
|
||||
include $(TOP_PATH)/rotators/celestron/Android.mk
|
||||
include $(TOP_PATH)/rotators/cnctrk/Android.mk
|
||||
include $(TOP_PATH)/rotators/easycomm/Android.mk
|
||||
include $(TOP_PATH)/rotators/ether6/Android.mk
|
||||
include $(TOP_PATH)/rotators/fodtrack/Android.mk
|
||||
include $(TOP_PATH)/rotators/gs232a/Android.mk
|
||||
include $(TOP_PATH)/rotators/heathkit/Android.mk
|
||||
include $(TOP_PATH)/rotators/ioptron/Android.mk
|
||||
include $(TOP_PATH)/rotators/m2/Android.mk
|
||||
include $(TOP_PATH)/rotators/meade/Android.mk
|
||||
include $(TOP_PATH)/rotators/prosistel/Android.mk
|
||||
include $(TOP_PATH)/rotators/rotorez/Android.mk
|
||||
include $(TOP_PATH)/rotators/sartek/Android.mk
|
||||
include $(TOP_PATH)/rotators/satel/Android.mk
|
||||
include $(TOP_PATH)/rotators/spid/Android.mk
|
||||
include $(TOP_PATH)/rotators/ts7400/Android.mk
|
||||
|
|
File diff suppressed because one or more lines are too long
13
NEWS
13
NEWS
|
@ -7,8 +7,17 @@ Copyright (C) 2000-2021 Michael Black W9MDB, and others
|
|||
Please send Hamlib bug reports to hamlib-developer@lists.sourceforge.net
|
||||
|
||||
Version 4.2
|
||||
2021-??-??
|
||||
* Major rework for PRM80
|
||||
* 2021-03-?? -- anticipated release date
|
||||
* Frequency and PTT are now validated -- may solve some random problems
|
||||
** where freq and ptt get stuck or not changed
|
||||
* Major rework for PRM80
|
||||
* Add twiddle_timeout and twiddle_rit --set-conf options
|
||||
rigctld --set-conf=twiddle_timeout=5,twiddle_rit=1
|
||||
This will set the twiddle timeout to 5 seconds and turn on twiddle_rit
|
||||
For twiddle timeout VFOB will not be polled for 5 seconds after VFO twiddling is detected
|
||||
rigctld --twiddle is deprecated and will be removed in 5.0 along with get_twiddle and set_twiddle
|
||||
|
||||
Version 4.2
|
||||
|
||||
Version 4.1
|
||||
2021-01-31
|
||||
|
|
|
@ -13,6 +13,8 @@ Notes:
|
|||
** But NET rigctl works fine
|
||||
* Backends are named libhamlib-vendor.so, I don't know how to include libraries without lib prefix into APK
|
||||
* Check the location of libusb.h and define the corresponding macro accordingly in config.h.
|
||||
* Had to build without libusb as ndk did not contain it
|
||||
** comment out HAVE_LIBUSB_H in android/config.h if you get libusb errors
|
||||
|
||||
Happy hacking
|
||||
73 Lada, OK1ZIA
|
||||
|
|
|
@ -223,10 +223,10 @@
|
|||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <libusb.h> header file. */
|
||||
#define HAVE_LIBUSB_H 1
|
||||
//#define HAVE_LIBUSB_H 1
|
||||
|
||||
/* Define to 1 if you have the <libusb-1.0/libusb.h> header file. */
|
||||
/* #undef HAVE_LIBUSB_1_0_LIBUSB_H 1
|
||||
//#define HAVE_LIBUSB_1_0_LIBUSB_H 1
|
||||
|
||||
/* Define to 1 if you have the `usleep' function. */
|
||||
#define HAVE_USLEEP 1
|
||||
|
|
|
@ -15,7 +15,7 @@ if [ "$1" = "clean" ]; then
|
|||
fi
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
ndk-build NDK_PROJECT_PATH=$HAMLIB APP_BUILD_SCRIPT=$HAMLIB/Android.mk $1
|
||||
ndk-build --trace NDK_PROJECT_PATH=$HAMLIB APP_BUILD_SCRIPT=$HAMLIB/Android.mk PP_ALLOW_MISSING_DEPS=true $1
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
# more information on swig at http://www.swig.org
|
||||
#
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/bindings $(PYTHON_CPPFLAGS) \
|
||||
$(TCL_INCLUDE_SPEC)
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/include -I$(top_srcdir)/bindings \
|
||||
$(TCL_INCLUDE_SPEC) $(PYTHON_CPPFLAGS)
|
||||
|
||||
AM_CFLAGS = -fno-strict-aliasing
|
||||
AM_CXXFLAGS = -O2
|
||||
|
@ -121,7 +121,7 @@ check-py: all-py
|
|||
Hamlib.py: hamlibpy_wrap.c
|
||||
|
||||
hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
|
||||
$(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) -I$(top_srcdir)/bindings \
|
||||
$(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
|
||||
-o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
|
||||
|
||||
install-py:
|
||||
|
|
|
@ -194,6 +194,7 @@
|
|||
%ignore rig_passband_normal;
|
||||
%ignore rig_passband_narrow;
|
||||
%ignore rig_passband_wide;
|
||||
%ignore rig_get_vfo_info;
|
||||
|
||||
%ignore rot_open;
|
||||
%ignore rot_close;
|
||||
|
|
|
@ -39,7 +39,7 @@ def StartUp():
|
|||
print("freq:\t\t\t%s" % my_rig.get_freq())
|
||||
|
||||
my_rig.set_freq(Hamlib.RIG_VFO_A, 145550000)
|
||||
(mode, width) = my_rig.get_mode()
|
||||
(mode, width) = my_rig.get_mode(Hamlib.RIG_VFO_A)
|
||||
|
||||
print("mode:\t\t\t%s\nbandwidth:\t\t%s" % (Hamlib.rig_strrmode(mode), width))
|
||||
|
||||
|
@ -83,6 +83,9 @@ def StartUp():
|
|||
print("get_channel status:\t%s" % my_rig.error_status)
|
||||
print("VFO:\t\t\t%s, %s" % (Hamlib.rig_strvfo(chan.vfo), chan.freq))
|
||||
print("Attenuators:\t\t%s" % my_rig.caps.attenuator)
|
||||
# Can't seem to get get_vfo_info to work
|
||||
#(freq, width, mode, split) = my_rig.get_vfo_info(Hamlib.RIG_VFO_A,freq,width,mode,split)
|
||||
#print("Rig vfo_info:\t\tfreq=%s, mode=%s, width=%s, split=%s" % (freq, mode, width, split))
|
||||
print("\nSending Morse, '73'")
|
||||
|
||||
my_rig.send_morse(Hamlib.RIG_VFO_A, "73")
|
||||
|
|
|
@ -70,6 +70,10 @@ typedef channel_t * const_channel_t_p;
|
|||
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1); }
|
||||
#define METHOD3_INIT(f, t1, t2, t3, i3) void f (t1 _##t1##_1, t2 _##t2##_2, t3 _##t3##_3 = i3 _VFO_DECL) \
|
||||
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1##_1, _##t2##_2, _##t3##_3); }
|
||||
#define METHOD4(f, t1) void f ( vfo_t vfo, t1 _##t1) \
|
||||
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1); }
|
||||
#define METHOD4_INIT(f, t1, t2, t3, t4, i4) void f (t1 _##t1##_1, t2 _##t2##_2, t3 _##t3##_3, ##t4##_4 = i4 _VFO_DECL) \
|
||||
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1##_1, _##t2##_2, _##t3##_3 _##t4##_4); }
|
||||
/*
|
||||
* declare wrapper method with one output argument besides RIG* (no target vfo)
|
||||
*/
|
||||
|
@ -445,6 +449,7 @@ typedef channel_t * const_channel_t_p;
|
|||
METHOD1VGET(get_xit, shortfreq_t)
|
||||
METHOD1VGET(get_ts, shortfreq_t)
|
||||
extern void get_ant(ant_t *ant_rx, ant_t *ant_tx, ant_t *ant_curr, value_t * OUTPUT, ant_t ant, vfo_t vfo = RIG_VFO_CURR);
|
||||
extern void get_vfo_info (split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo = RIG_VFO_CURR);
|
||||
METHOD1VGET(get_mem, int)
|
||||
METHOD1GET(get_powerstat, powerstat_t)
|
||||
METHOD1GET(get_trn, int)
|
||||
|
@ -600,6 +605,11 @@ void Rig_get_ant(Rig *self, ant_t *ant_rx, ant_t *ant_tx, ant_t *ant_curr, value
|
|||
{
|
||||
self->error_status = rig_get_ant(self->rig, vfo, ant, option, ant_curr, ant_tx, ant_rx);
|
||||
}
|
||||
void Rig_get_vfo_info (Rig *self, split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo)
|
||||
{
|
||||
self->error_status = rig_get_vfo_info(self->rig, vfo, freq, mode, width, split);
|
||||
}
|
||||
|
||||
|
||||
struct channel *Rig_get_chan_all(Rig *self)
|
||||
{
|
||||
|
@ -618,4 +628,5 @@ struct channel *Rig_get_chan_all(Rig *self)
|
|||
return chans;
|
||||
}
|
||||
|
||||
|
||||
%}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
lib_LTLIBRARIES = libhamlib++.la
|
||||
libhamlib___la_SOURCES = rigclass.cc rotclass.cc
|
||||
libhamlib___la_SOURCES = rigclass.cc rotclass.cc ampclass.cc
|
||||
libhamlib___la_LDFLAGS = -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE) $(LDFLAGS)
|
||||
libhamlib___la_LIBADD = $(top_builddir)/src/libhamlib.la
|
||||
AM_CXXFLAGS=$(CXXFLAGS)
|
||||
|
|
|
@ -673,7 +673,7 @@ rmode_t Rig::RngRxModes (freq_t freq)
|
|||
unsigned modes = RIG_MODE_NONE;
|
||||
int i;
|
||||
|
||||
for (i=0; i<FRQRANGESIZ; i++) {
|
||||
for (i=0; i<HAMLIB_FRQRANGESIZ; i++) {
|
||||
freq_range_t *rng = &theRig->state.rx_range_list[i];
|
||||
if (RIG_IS_FRNG_END(*rng)) {
|
||||
return (rmode_t)modes;
|
||||
|
@ -690,7 +690,7 @@ rmode_t Rig::RngTxModes (freq_t freq)
|
|||
unsigned modes = RIG_MODE_NONE;
|
||||
int i;
|
||||
|
||||
for (i=0; i<FRQRANGESIZ; i++) {
|
||||
for (i=0; i<HAMLIB_FRQRANGESIZ; i++) {
|
||||
freq_range_t *rng = &theRig->state.tx_range_list[i];
|
||||
if (RIG_IS_FRNG_END(*rng)) {
|
||||
return (rmode_t)modes;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
dnl Autoconf 2.67 is in Debian Squeeze--is an older version needed
|
||||
dnl for some other distribution?
|
||||
## FIXME: Is this too new? ##
|
||||
AC_PREREQ([2.67])
|
||||
AC_PREREQ([2.69])
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
|
@ -14,11 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
|
|||
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.2~git],
|
||||
[hamlib-developer@lists.sourceforge.net],
|
||||
[hamlib],
|
||||
[http://www.hamlib.org])
|
||||
AC_INIT([Hamlib],[4.2~git],[hamlib-developer@lists.sourceforge.net],[hamlib],[http://www.hamlib.org])
|
||||
|
||||
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
|
||||
AC_CONFIG_MACRO_DIR([macros])
|
||||
|
@ -155,7 +151,6 @@ AC_SYS_POSIX_TERMIOS()
|
|||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
AC_CHECK_TYPES([siginfo_t],[],[],[[#include <signal.h>]])
|
||||
AC_CHECK_TYPES([sig_atomic_t],[],[],[[#include <signal.h>]])
|
||||
|
||||
|
|
|
@ -106,5 +106,6 @@ Windows 32 bit on Debian GNU/Linux.
|
|||
* \defgroup rotator Rotator API
|
||||
* \defgroup rot_internal Rotator Internal API
|
||||
* \defgroup amplifier Amplifier API
|
||||
* \defgroup amp_internal Amplifier Internal API
|
||||
* \defgroup utilities Utility Routines API
|
||||
*/
|
||||
|
|
|
@ -52,15 +52,15 @@ type
|
|||
//typedef struct rig RIG;
|
||||
|
||||
const
|
||||
RIGNAMSIZ = 30;
|
||||
RIGVERSIZ = 8;
|
||||
FILPATHLEN = 512;
|
||||
FRQRANGESIZ = 30;
|
||||
MAXCHANDESC = 30; {* describe channel eg: "WWV 5Mhz" *}
|
||||
TSLSTSIZ = 20; {* max tuning step list size, zero ended *}
|
||||
FLTLSTSIZ = 16; {* max mode/filter list size, zero ended *}
|
||||
MAXDBLSTSIZ = 8; {* max preamp/att levels supported, zero ended *}
|
||||
CHANLSTSIZ = 16; {* max mem_list size, zero ended *}
|
||||
HAMLIB_RIGNAMSIZ = 30;
|
||||
HAMLIB_RIGVERSIZ = 8;
|
||||
HAMLIB_FILPATHLEN = 512;
|
||||
HAMLIB_FRQRANGESIZ = 30;
|
||||
HAMLIB_MAXCHANDESC = 30; {* describe channel eg: "WWV 5Mhz" *}
|
||||
HAMLIB_TSLSTSIZ = 20; {* max tuning step list size, zero ended *}
|
||||
HAMLIB_FLTLSTSIZ = 16; {* max mode/filter list size, zero ended *}
|
||||
HAMLIB_MAXDBLSTSIZ = 8; {* max preamp/att levels supported, zero ended *}
|
||||
HAMLIB_CHANLSTSIZ = 16; {* max mem_list size, zero ended *}
|
||||
|
||||
type
|
||||
{*
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
|
||||
virtual ~Amplifier();
|
||||
|
||||
Amplifier(const Amplifier&) = default;
|
||||
Amplifier(Amplifier&&) = default;
|
||||
Amplifier& operator=(const Amplifier&) = default;
|
||||
Amplifier& operator=(Amplifier&&) = default;
|
||||
|
||||
const struct amp_caps *caps;
|
||||
|
||||
// This method opens the communication port to the amp
|
||||
|
|
|
@ -253,8 +253,8 @@ struct amp_caps
|
|||
setting_t levels;
|
||||
unsigned ext_levels;
|
||||
//! @endcond
|
||||
const struct confparams *extlevels; /*!< Extension levels structure. */
|
||||
const struct confparams *extparms; /*!< Extension parameters structure. */
|
||||
const struct confparams *extlevels; /*!< Extension levels list. \sa extamp.c */
|
||||
const struct confparams *extparms; /*!< Extension parameters list. \sa extamp.c */
|
||||
|
||||
const char *macro_name; /*!< Amplifier model macro name. */
|
||||
};
|
||||
|
|
|
@ -46,37 +46,42 @@
|
|||
* distinguish between the different hardware drivers. The exact model
|
||||
* numbers can be acquired using the macros in this file. To obtain a list of
|
||||
* supported amplifier branches, one can use the statically defined
|
||||
* AMP_BACKEND_LIST macro. To obtain a full list of supported amplifiers
|
||||
* (including each model in every branch), the foreach_opened_amp() API
|
||||
* function can be used.
|
||||
* AMP_BACKEND_LIST macro (defined in configure.ac). To obtain a full list of
|
||||
* supported amplifiers (including each model in every branch), the
|
||||
* foreach_opened_amp() API function can be used.
|
||||
*
|
||||
* The model number, or ID, is used to tell Hamlib which amplifier the client
|
||||
* wishes to use. It is done with the amp_init() API call.
|
||||
* wishes to use which is done with the amp_init() API call.
|
||||
*/
|
||||
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#define AMP_MODEL_NONE 0
|
||||
//! @endcond
|
||||
|
||||
/*
|
||||
* Hamlib
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief A macro that returns the model number for the dummy backend.
|
||||
* \brief A macro that returns the model number for an unknown model.
|
||||
*
|
||||
* \def AMP_MODEL_NONE
|
||||
*
|
||||
* The none backend, as the name suggests, does nothing. It is mainly for
|
||||
* internal use.
|
||||
*/
|
||||
#define AMP_MODEL_NONE 0
|
||||
|
||||
|
||||
/**
|
||||
* \brief A macro that returns the model number for the DUMMY backend.
|
||||
*
|
||||
* \def AMP_MODEL_DUMMY
|
||||
*
|
||||
* The dummy backend, as the name suggests, is a backend which performs no
|
||||
* hardware operations and always behaves as one would expect. It can be
|
||||
* The DUMMY backend, as the name suggests, is a backend which performs no
|
||||
* hardware operations and always behaves as one would expect. It can be
|
||||
* thought of as a hardware simulator and is very useful for testing client
|
||||
* applications.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number for the NETAMPCTL backend.
|
||||
*
|
||||
* \def AMP_MODEL_NETAMPCTL
|
||||
* \brief A macro that returns the model number for the netampctl backend.
|
||||
*
|
||||
* This backend allows use of the ampctld daemon through the normal
|
||||
* The NETAMPCTL backend allows use of the `ampctld` daemon through the normal
|
||||
* Hamlib API.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
|
@ -87,16 +92,12 @@
|
|||
#define AMP_MODEL_NETAMPCTL AMP_MAKE_MODEL(AMP_DUMMY, 2)
|
||||
|
||||
|
||||
/*
|
||||
* Elecraft
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief A macro that returns the model number of the kpa1500 backend.
|
||||
* \brief A macro that returns the model number of the KPA1500 backend.
|
||||
*
|
||||
* \def AMP_MODEL_ELECRAFT_KPA1500
|
||||
*
|
||||
* The kpa1500 backend can be used with amplifiers that support the Elecraft
|
||||
* The KPA1500 backend can be used with amplifiers that support the Elecraft
|
||||
* KPA-1500 protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
|
@ -107,7 +108,7 @@
|
|||
//#define AMP_MODEL_ELECRAFT_KPA500 AMP_MAKE_MODEL(AMP_ELECRAFT, 2)
|
||||
|
||||
/**
|
||||
* \brief Convenience type definition for amplifier model.
|
||||
* \brief Convenience type definition for an amplifier model.
|
||||
*
|
||||
* \typedef typedef int amp_model_t
|
||||
*/
|
||||
|
|
|
@ -176,16 +176,21 @@ struct rig_state;
|
|||
typedef struct s_rig RIG;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#define RIGNAMSIZ 30
|
||||
#define RIGVERSIZ 8
|
||||
#define FILPATHLEN 512
|
||||
#define FRQRANGESIZ 30
|
||||
#define MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */
|
||||
#define TSLSTSIZ 20 /* max tuning step list size, zero ended */
|
||||
#define FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
|
||||
#define MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
|
||||
#define CHANLSTSIZ 16 /* max mem_list size, zero ended */
|
||||
#define MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
|
||||
#define HAMLIB_RIGNAMSIZ 30
|
||||
#define HAMLIB_RIGVERSIZ 8
|
||||
#define HAMLIB_FILPATHLEN 512
|
||||
#define HAMLIB_FRQRANGESIZ 30
|
||||
#define HAMLIB_MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */
|
||||
#define HAMLIB_TSLSTSIZ 20 /* max tuning step list size, zero ended */
|
||||
#define HAMLIB_FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
|
||||
#define HAMLIB_MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
|
||||
#define HAMLIB_CHANLSTSIZ 16 /* max mem_list size, zero ended */
|
||||
#define HAMLIB_MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
|
||||
#define HAMLIB_MAX_MODES 63
|
||||
#define HAMLIB_MAX_VFOS 31
|
||||
#define HAMLIB_MAX_ROTORS 63
|
||||
#define HAMLIB_MAX_VFO_OPS 31
|
||||
#define HAMLIB_MAX_RSCANS 31
|
||||
//! @endcond
|
||||
|
||||
|
||||
|
@ -463,7 +468,6 @@ typedef unsigned int vfo_t;
|
|||
|
||||
/*
|
||||
* targetable bitfields, for internal use.
|
||||
* RIG_TARGETABLE_PURE means a pure targetable radio on every command
|
||||
* In rig.c lack of a flag will case a VFO change if needed
|
||||
* So setting this flag will mean the backend handles any VFO needs
|
||||
* For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping
|
||||
|
@ -472,7 +476,7 @@ typedef unsigned int vfo_t;
|
|||
#define RIG_TARGETABLE_NONE 0
|
||||
#define RIG_TARGETABLE_FREQ (1<<0)
|
||||
#define RIG_TARGETABLE_MODE (1<<1)
|
||||
#define RIG_TARGETABLE_PURE (1<<2)
|
||||
#define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it
|
||||
#define RIG_TARGETABLE_TONE (1<<3)
|
||||
#define RIG_TARGETABLE_FUNC (1<<4)
|
||||
#define RIG_TARGETABLE_LEVEL (1<<5)
|
||||
|
@ -1053,7 +1057,7 @@ typedef uint64_t setting_t;
|
|||
#define RIG_FUNC_DIVERSITY CONSTANT_64BIT_FLAG (38) /*!< \c DIVERSITY -- Diversity receive */
|
||||
#define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39) /*!< \c DSQL -- Digital modes squelch */
|
||||
#define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40) /*!< \c SCEN -- scrambler/encryption */
|
||||
#define RIG_FUNC_BIT41 CONSTANT_64BIT_FLAG (41) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41) /*!< \c Rig slice selection -- Flex */
|
||||
#define RIG_FUNC_BIT42 CONSTANT_64BIT_FLAG (42) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_BIT43 CONSTANT_64BIT_FLAG (43) /*!< \c available for future RIG_FUNC items */
|
||||
#define RIG_FUNC_BIT44 CONSTANT_64BIT_FLAG (44) /*!< \c available for future RIG_FUNC items */
|
||||
|
@ -1358,7 +1362,7 @@ struct channel {
|
|||
tone_t dcs_sql; /*!< DCS squelch code */
|
||||
int scan_group; /*!< Scan group */
|
||||
unsigned int flags; /*!< Channel flags, see RIG_CHFLAG's */
|
||||
char channel_desc[MAXCHANDESC]; /*!< Name */
|
||||
char channel_desc[HAMLIB_MAXCHANDESC]; /*!< Name */
|
||||
struct ext_list
|
||||
*ext_levels; /*!< Extension level value list, NULL ended. ext_levels can be NULL */
|
||||
};
|
||||
|
@ -1500,7 +1504,7 @@ struct cal_table {
|
|||
struct {
|
||||
int raw; /*!< raw (A/D) value, as returned by \a RIG_LEVEL_RAWSTR */
|
||||
int val; /*!< associated value, basically the measured dB value */
|
||||
} table[MAX_CAL_LENGTH]; /*!< table of plots */
|
||||
} table[HAMLIB_MAX_CAL_LENGTH]; /*!< table of plots */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1530,7 +1534,7 @@ struct cal_table_float {
|
|||
struct {
|
||||
int raw; /*!< raw (A/D) value */
|
||||
float val; /*!< associated value */
|
||||
} table[MAX_CAL_LENGTH]; /*!< table of plots */
|
||||
} table[HAMLIB_MAX_CAL_LENGTH]; /*!< table of plots */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1622,8 +1626,8 @@ struct rig_caps {
|
|||
const tone_t *ctcss_list; /*!< CTCSS tones list, zero ended */
|
||||
const tone_t *dcs_list; /*!< DCS code list, zero ended */
|
||||
|
||||
int preamp[MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
shortfreq_t max_rit; /*!< max absolute RIT */
|
||||
shortfreq_t max_xit; /*!< max absolute XIT */
|
||||
shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */
|
||||
|
@ -1638,25 +1642,25 @@ struct rig_caps {
|
|||
int bank_qty; /*!< Number of banks */
|
||||
int chan_desc_sz; /*!< Max length of memory channel name */
|
||||
|
||||
chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
|
||||
// As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
|
||||
// So we currently have 5 ranges we need to deal with
|
||||
// The backend for the model should fill in the label field to explain what model it is
|
||||
// The the IC-9700 in ic7300.c for an example
|
||||
freq_range_t rx_range_list1[FRQRANGESIZ]; /*!< Receive frequency range list #1 */
|
||||
freq_range_t tx_range_list1[FRQRANGESIZ]; /*!< Transmit frequency range list #1 */
|
||||
freq_range_t rx_range_list2[FRQRANGESIZ]; /*!< Receive frequency range list #2 */
|
||||
freq_range_t tx_range_list2[FRQRANGESIZ]; /*!< Transmit frequency range list #2 */
|
||||
freq_range_t rx_range_list3[FRQRANGESIZ]; /*!< Receive frequency range list #3 */
|
||||
freq_range_t tx_range_list3[FRQRANGESIZ]; /*!< Transmit frequency range list #3 */
|
||||
freq_range_t rx_range_list4[FRQRANGESIZ]; /*!< Receive frequency range list #4 */
|
||||
freq_range_t tx_range_list4[FRQRANGESIZ]; /*!< Transmit frequency range list #4 */
|
||||
freq_range_t rx_range_list5[FRQRANGESIZ]; /*!< Receive frequency range list #5 */
|
||||
freq_range_t tx_range_list5[FRQRANGESIZ]; /*!< Transmit frequency range list #5 */
|
||||
freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #1 */
|
||||
freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #1 */
|
||||
freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #2 */
|
||||
freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #2 */
|
||||
freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #3 */
|
||||
freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #3 */
|
||||
freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #4 */
|
||||
freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #4 */
|
||||
freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #5 */
|
||||
freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #5 */
|
||||
|
||||
struct tuning_step_list tuning_steps[TSLSTSIZ]; /*!< Tuning step list */
|
||||
struct filter_list filters[FLTLSTSIZ]; /*!< mode/filter table, at -6dB */
|
||||
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */
|
||||
struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< mode/filter table, at -6dB */
|
||||
|
||||
cal_table_t str_cal; /*!< S-meter calibration table */
|
||||
cal_table_float_t swr_cal; /*!< SWR meter calibration table */
|
||||
|
@ -1838,6 +1842,12 @@ struct rig_caps {
|
|||
rig_ptr_t);
|
||||
|
||||
int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device
|
||||
int (*rig_get_vfo_info) (RIG *rig,
|
||||
vfo_t vfo,
|
||||
freq_t *freq,
|
||||
rmode_t *mode,
|
||||
pbwidth_t *width,
|
||||
split_t *split);
|
||||
|
||||
const char *clone_combo_set; /*!< String describing key combination to enter load cloning mode */
|
||||
const char *clone_combo_get; /*!< String describing key combination to enter save cloning mode */
|
||||
|
@ -1968,10 +1978,10 @@ enum rig_caps_cptr_e {
|
|||
|
||||
/**
|
||||
* \brief Function to return int value from rig->caps
|
||||
*
|
||||
* Does not support > 32-bit rig_caps values
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
extern long rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps);
|
||||
extern long long rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps);
|
||||
|
||||
/**
|
||||
* \brief Function to return char pointer value from rig->caps
|
||||
|
@ -2007,7 +2017,7 @@ typedef struct hamlib_port {
|
|||
short retry; /*!< Maximum number of retries, 0 to disable */
|
||||
short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
|
||||
|
||||
char pathname[FILPATHLEN]; /*!< Port pathname */
|
||||
char pathname[HAMLIB_FILPATHLEN]; /*!< Port pathname */
|
||||
|
||||
union {
|
||||
struct {
|
||||
|
@ -2093,6 +2103,7 @@ struct rig_cache {
|
|||
#endif
|
||||
rmode_t mode;
|
||||
pbwidth_t width;
|
||||
pbwidth_t widthB; // if non-zero then rig has separate width for VFOB
|
||||
ptt_t ptt;
|
||||
split_t split;
|
||||
vfo_t split_vfo; // split caches two values
|
||||
|
@ -2113,6 +2124,7 @@ struct rig_cache {
|
|||
vfo_t vfo_freq; // last vfo cached
|
||||
vfo_t vfo_mode; // last vfo cached
|
||||
int satmode; // if rig is in satellite mode
|
||||
rmode_t modeB;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2122,8 +2134,9 @@ struct rig_cache {
|
|||
* This struct contains live data, as well as a copy of capability fields
|
||||
* that may be updated (ie. customized)
|
||||
*
|
||||
* It is fine to move fields around, as this kind of struct should
|
||||
* not be initialized like caps are.
|
||||
* It is NOT fine to move fields around as it can break share library offset
|
||||
* As of 2021-03-03 vfo_list is the last known item being reference externally
|
||||
* So any additions or changes to this structure must be after vfo_list.
|
||||
*/
|
||||
struct rig_state {
|
||||
/*
|
||||
|
@ -2136,16 +2149,16 @@ struct rig_state {
|
|||
double vfo_comp; /*!< VFO compensation in PPM, 0.0 to disable */
|
||||
|
||||
int deprecated_itu_region; /*!< ITU region to select among freq_range_t */
|
||||
freq_range_t rx_range_list[FRQRANGESIZ]; /*!< Receive frequency range list */
|
||||
freq_range_t tx_range_list[FRQRANGESIZ]; /*!< Transmit frequency range list */
|
||||
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list */
|
||||
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list */
|
||||
|
||||
struct tuning_step_list tuning_steps[TSLSTSIZ]; /*!< Tuning step list */
|
||||
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */
|
||||
|
||||
struct filter_list filters[FLTLSTSIZ]; /*!< Mode/filter table, at -6dB */
|
||||
struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< Mode/filter table, at -6dB */
|
||||
|
||||
cal_table_t str_cal; /*!< S-meter calibration table */
|
||||
|
||||
chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
|
||||
shortfreq_t max_rit; /*!< max absolute RIT */
|
||||
shortfreq_t max_xit; /*!< max absolute XIT */
|
||||
|
@ -2153,8 +2166,8 @@ struct rig_state {
|
|||
|
||||
ann_t announces; /*!< Announces bit field list */
|
||||
|
||||
int preamp[MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
|
||||
setting_t has_get_func; /*!< List of get functions */
|
||||
setting_t has_set_func; /*!< List of set functions */
|
||||
|
@ -2182,9 +2195,12 @@ struct rig_state {
|
|||
int poll_interval; /*!< Event notification polling period in milliseconds */
|
||||
freq_t current_freq; /*!< Frequency currently set */
|
||||
rmode_t current_mode; /*!< Mode currently set */
|
||||
//rmode_t current_modeB; /*!< Mode currently set VFOB */
|
||||
pbwidth_t current_width; /*!< Passband width currently set */
|
||||
vfo_t tx_vfo; /*!< Tx VFO currently set */
|
||||
rmode_t mode_list; /*!< Complete list of modes for this rig */
|
||||
// mode_list is used by some
|
||||
// so anything added to this structure must be below here
|
||||
int transmit; /*!< rig should be transmitting i.e. hard
|
||||
wired PTT asserted - used by rigs that
|
||||
don't do CAT while in Tx */
|
||||
|
@ -2195,7 +2211,9 @@ struct rig_state {
|
|||
int uplink; /*!< uplink=1 will not read Sub, uplink=2 will not read Main */
|
||||
struct rig_cache cache;
|
||||
int vfo_opt; /*!< Is -o switch turned on? */
|
||||
int auto_power_on; /*!< Allow Hamlib to power rig
|
||||
int auto_power_on; /*!< Allow Hamlib to power on rig
|
||||
automatically if supported */
|
||||
int auto_power_off; /*!< Allow Hamlib to power off rig
|
||||
automatically if supported */
|
||||
int auto_disable_screensaver; /*!< Allow Hamlib to disable the
|
||||
rig's screen saver automatically if
|
||||
|
@ -2322,10 +2340,10 @@ rig_get_vfo HAMLIB_PARAMS((RIG *rig,
|
|||
|
||||
extern HAMLIB_EXPORT(int)
|
||||
rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
|
||||
vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width));
|
||||
vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split));
|
||||
|
||||
extern HAMLIB_EXPORT(const char *)
|
||||
rig_get_vfo_list HAMLIB_PARAMS((RIG *rig));
|
||||
extern HAMLIB_EXPORT(int)
|
||||
rig_get_vfo_list HAMLIB_PARAMS((RIG *rig, char *buf, int buflen));
|
||||
|
||||
extern HAMLIB_EXPORT(int)
|
||||
netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
|
||||
|
@ -2802,11 +2820,6 @@ rig_set_vfo_callback HAMLIB_PARAMS((RIG *,
|
|||
vfo_cb_t,
|
||||
rig_ptr_t));
|
||||
|
||||
extern HAMLIB_EXPORT(int)
|
||||
rig_get_vfo_info_callback HAMLIB_PARAMS((RIG *,
|
||||
vfo_cb_t,
|
||||
rig_ptr_t));
|
||||
|
||||
extern HAMLIB_EXPORT(int)
|
||||
rig_set_ptt_callback HAMLIB_PARAMS((RIG *,
|
||||
ptt_cb_t,
|
||||
|
@ -2883,11 +2896,11 @@ rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
|
|||
#define DEBUGMSGSAVE_SIZE 24000
|
||||
extern HAMLIB_EXPORT_VAR(char) debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug msg
|
||||
extern HAMLIB_EXPORT_VAR(char) debugmsgsave2[DEBUGMSGSAVE_SIZE]; // last-1 debug msg
|
||||
extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debug msg
|
||||
#ifndef __cplusplus
|
||||
#ifdef __GNUC__
|
||||
// doing the debug macro with a dummy sprintf allows gcc to check the format string
|
||||
//#define rig_debug(debug_level,fmt,...) { char xxxbuf[16384]="";snprintf(xxxbuf,sizeof(xxxbuf),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
|
||||
#define rig_debug(debug_level,fmt,...) { strcpy(debugmsgsave2, debugmsgsave);snprintf(debugmsgsave,sizeof(debugmsgsave),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
|
||||
#define rig_debug(debug_level,fmt,...) do { strncpy(debugmsgsave3, debugmsgsave2,sizeof(debugmsgsave3));strncpy(debugmsgsave2, debugmsgsave, sizeof(debugmsgsave2));snprintf(debugmsgsave,sizeof(debugmsgsave),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); } while(0);
|
||||
#endif
|
||||
#endif
|
||||
extern HAMLIB_EXPORT(void)
|
||||
|
@ -2968,7 +2981,7 @@ extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t sele
|
|||
extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
|
||||
|
||||
extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
|
||||
extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width);
|
||||
extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split);
|
||||
|
||||
|
||||
typedef unsigned long rig_useconds_t;
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT
|
||||
# define HAMLIB_IMPEXP HAMLIB_DLL_EXPORT
|
||||
# else
|
||||
# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT
|
||||
# define BACKEND_IMPEXP HAMLIB_DLL_IMPORT
|
||||
# define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT
|
||||
# endif
|
||||
# else
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
|
||||
virtual ~Rig();
|
||||
|
||||
Rig(const Rig&) = default;
|
||||
Rig(Rig&&) = default;
|
||||
Rig& operator=(const Rig&) = default;
|
||||
Rig& operator=(Rig&&) = default;
|
||||
|
||||
const struct rig_caps *caps;
|
||||
|
||||
// This method opens the communication port to the rig
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
#define RIG_MODEL_FT818 RIG_MAKE_MODEL(RIG_YAESU, 41)
|
||||
#define RIG_MODEL_FTDX10 RIG_MAKE_MODEL(RIG_YAESU, 42)
|
||||
#define RIG_MODEL_FT897D RIG_MAKE_MODEL(RIG_YAESU, 43)
|
||||
#define RIG_MODEL_FTDX101MP RIG_MAKE_MODEL(RIG_YAESU, 44)
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -383,9 +383,9 @@ struct rot_caps {
|
|||
gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity (i.e. steps). */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity (i.e. steps). */
|
||||
|
||||
const struct confparams *extparms; /*!< Extension parameter list, \sa ext.c. */
|
||||
const struct confparams *extlevels; /*!< Extension level list, \sa ext.c. */
|
||||
const struct confparams *extfuncs; /*!< Extension func list, \sa ext.c. */
|
||||
const struct confparams *extparms; /*!< Extension parameters list, \sa rot_ext.c. */
|
||||
const struct confparams *extlevels; /*!< Extension levels list, \sa rot_ext.c. */
|
||||
const struct confparams *extfuncs; /*!< Extension functions list, \sa rot_ext.c. */
|
||||
int *ext_tokens; /*!< Extension token list. */
|
||||
|
||||
/*
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
|
||||
virtual ~Rotator();
|
||||
|
||||
Rotator(const Rotator&) = default;
|
||||
Rotator(Rotator&&) = default;
|
||||
Rotator& operator=(const Rotator&) = default;
|
||||
Rotator& operator=(Rotator&&) = default;
|
||||
|
||||
const struct rot_caps *caps;
|
||||
|
||||
// This method opens the communication port to the rot
|
||||
|
|
|
@ -35,46 +35,50 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file rotlist.h
|
||||
* \brief Hamlib rotator model definitions.
|
||||
* \file rotlist.h
|
||||
* \brief Hamlib rotator model definitions.
|
||||
*
|
||||
* This file contains rotator model definitions for the Hamlib rotator API.
|
||||
* Each distinct rotator type has a unique model number (ID) and is used by
|
||||
* hamlib to identify and distinguish between the different hardware drivers.
|
||||
* The exact model numbers can be acquired using the macros in this file. To
|
||||
* obtain a list of supported rotator branches, one can use the statically
|
||||
* defined ROT_BACKEND_LIST macro. To obtain a full list of supported
|
||||
* rotators (including each model in every branch), the foreach_opened_rot()
|
||||
* API function can be used.
|
||||
* This file contains rotator model definitions for the Hamlib rotator
|
||||
* Application Programming Interface (API). Each distinct rotator type has a
|
||||
* unique model number (ID) and is used by Hamlib to identify and distinguish
|
||||
* between the different hardware drivers. The exact model numbers can be
|
||||
* acquired using the macros in this file. To obtain a list of supported
|
||||
* rotator branches, one can use the statically defined ROT_BACKEND_LIST macro
|
||||
* (defined in configure.ac). To obtain a full list of supported rotators
|
||||
* (including each model in every branch), the foreach_opened_rot() API
|
||||
* function can be used.
|
||||
*
|
||||
* The model number, or ID, is used to tell Hamlib which rotator the client
|
||||
* whishes to use. It is done with the rot_init() API call.
|
||||
* The model number, or ID, is used to tell Hamlib which rotator the client
|
||||
* wishes to use which is done with the rot_init() API call.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_NONE
|
||||
* \brief A macro that returns the model number for an unknown model.
|
||||
* \def ROT_MODEL_NONE
|
||||
* \brief A macro that returns the model number for an unknown model.
|
||||
*
|
||||
* The none backend, as the name suggests, does nothing...mainly for internal use
|
||||
* The none backend, as the name suggests, does nothing. It is mainly for
|
||||
* internal use.
|
||||
*/
|
||||
#define ROT_MODEL_NONE 0
|
||||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_DUMMY
|
||||
* \brief A macro that returns the model number for the dummy backend.
|
||||
* \brief A macro that returns the model number for the DUMMY backend.
|
||||
*
|
||||
* The dummy backend, as the name suggests, is a backend which performs
|
||||
* no hardware operations and always behaves as one would expect. It can
|
||||
* be thought of as a hardware simulator and is very useful for testing
|
||||
* client applications.
|
||||
* \def ROT_MODEL_DUMMY
|
||||
*
|
||||
* The DUMMY backend, as the name suggests, is a backend which performs
|
||||
* no hardware operations and always behaves as one would expect. It can
|
||||
* be thought of as a hardware simulator and is very useful for testing
|
||||
* client applications.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_NETROTCTL
|
||||
* \brief A macro that returns the model number for the Network backend.
|
||||
* \brief A macro that returns the model number for the NETROTCTL backend.
|
||||
*
|
||||
* This backend allows use of the rotctld daemon through the normal
|
||||
* Hamlib API.
|
||||
* \def ROT_MODEL_NETROTCTL
|
||||
*
|
||||
* The NETROTCTL backend allows use of the `rotctld` daemon through the normal
|
||||
* Hamlib API.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_DUMMY 0
|
||||
|
@ -84,30 +88,29 @@
|
|||
#define ROT_MODEL_NETROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 2)
|
||||
|
||||
|
||||
/*
|
||||
* Easycomm
|
||||
*/
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_EASYCOMM1
|
||||
* \brief A macro that returns the model number of the EasyComm 1 backend.
|
||||
* \brief A macro that returns the model number of the EASYCOMM 1 backend.
|
||||
*
|
||||
* The EasyComm 1 backend can be used with rotators that support the
|
||||
* EASYCOMM I Standard.
|
||||
* \def ROT_MODEL_EASYCOMM1
|
||||
*
|
||||
* The EASYCOMM1 backend can be used with rotators that support the EASYCOMM
|
||||
* I Standard.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_EASYCOMM2
|
||||
* \brief A macro that returns the model number of the EasyComm 2 backend.
|
||||
* \brief A macro that returns the model number of the EASYCOMM 2 backend.
|
||||
*
|
||||
* The EasyComm 2 backend can be used with rotators that support the
|
||||
* EASYCOMM II Standard.
|
||||
* \def ROT_MODEL_EASYCOMM2
|
||||
*
|
||||
* The EASYCOMM2 backend can be used with rotators that support the EASYCOMM
|
||||
* II Standard.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_EASYCOMM3
|
||||
* \brief A macro that returns the model number of the EasyComm 3 backend.
|
||||
* \brief A macro that returns the model number of the EASYCOMM 3 backend.
|
||||
*
|
||||
* The EasyComm 3 backend can be used with rotators that support the
|
||||
* EASYCOMM III Standard.
|
||||
* \def ROT_MODEL_EASYCOMM3
|
||||
*
|
||||
* The EASYCOMM3 backend can be used with rotators that support the EASYCOMM
|
||||
* III Standard.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_EASYCOMM 2
|
||||
|
@ -119,11 +122,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_FODTRACK
|
||||
* \brief A macro that returns the model number of the Fodtrack backend.
|
||||
* \brief A macro that returns the model number of the FODTRACK backend.
|
||||
*
|
||||
* The Fodtrack backend can be used with rotators that support the
|
||||
* FODTRACK Standard.
|
||||
* \def ROT_MODEL_FODTRACK
|
||||
*
|
||||
* The FODTRACK backend can be used with rotators that support the FODTRACK
|
||||
* Standard.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_FODTRACK 3
|
||||
|
@ -133,39 +137,44 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_ROTOREZ
|
||||
* \brief A macro that returns the model number of the Rotor-EZ backend.
|
||||
* \brief A macro that returns the model number of the ROTOREZ backend.
|
||||
*
|
||||
* The Rotor-EZ backend can be used with Hy-Gain rotators that support
|
||||
* the extended DCU command set by Idiom Press Rotor-EZ board.
|
||||
* \def ROT_MODEL_ROTOREZ
|
||||
*
|
||||
* The ROTOREZ backend can be used with Hy-Gain rotators that support the
|
||||
* extended DCU command set by the Idiom Press Rotor-EZ board.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_ROTORCARD
|
||||
* \brief A macro that returns the model number of the Rotor Card backend.
|
||||
* \brief A macro that returns the model number of the ROTORCARD backend.
|
||||
*
|
||||
* The Rotor-EZ backend can be used with Yaesu rotators that support the
|
||||
* extended DCU command set by Idiom Press Rotor Card board.
|
||||
* \def ROT_MODEL_ROTORCARD
|
||||
*
|
||||
* The ROTORCARD backend can be used with Yaesu rotators that support the
|
||||
* extended DCU command set by the Idiom Press Rotor Card board.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_DCU
|
||||
* \brief A macro that returns the model number of the DCU backend.
|
||||
* \brief A macro that returns the model number of the DCU backend.
|
||||
*
|
||||
* The Rotor-EZ backend can be used with rotators that support the DCU
|
||||
* command set by Hy-Gain (currently the DCU-1).
|
||||
* \def ROT_MODEL_DCU
|
||||
*
|
||||
* The DCU backend can be used with rotators that support the DCU command set
|
||||
* by Hy-Gain (currently the DCU-1).
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_ERC
|
||||
* \brief A macro that returns the model number of the ERC backend.
|
||||
* \brief A macro that returns the model number of the ERC backend.
|
||||
*
|
||||
* The Rotor-EZ backend can be used with rotators that support the DCU
|
||||
* command set by DF9GR (currently the ERC).
|
||||
* \def ROT_MODEL_ERC
|
||||
*
|
||||
* The ERC backend can be used with rotators that support the DCU command set
|
||||
* by DF9GR (currently the ERC).
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_RT21
|
||||
* \brief A macro that returns the model number of the RT21 backend.
|
||||
* \brief A macro that returns the model number of the RT21 backend.
|
||||
*
|
||||
* The Rotor-EZ backend can be used with rotators that support the DCU
|
||||
* command set by Green Heron (currently the RT-21).
|
||||
* \def ROT_MODEL_RT21
|
||||
*
|
||||
* The RT21 backend can be used with rotators that support the DCU command set
|
||||
* by Green Heron (currently the RT-21).
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_ROTOREZ 4
|
||||
|
@ -179,11 +188,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_SARTEK1
|
||||
* \brief A macro that returns the model number of the SARtek-1 backend.
|
||||
* \brief A macro that returns the model number of the SARTEK1 backend.
|
||||
*
|
||||
* The sartek backend can be used with rotators that support the SARtek
|
||||
* protocol.
|
||||
* \def ROT_MODEL_SARTEK1
|
||||
*
|
||||
* The SARTEK1 backend can be used with rotators that support the SARtek
|
||||
* protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_SARTEK 5
|
||||
|
@ -193,62 +203,101 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_GS232A
|
||||
* \brief A macro that returns the model number of the GS-232A backend.
|
||||
* \brief A macro that returns the model number of the GS232A backend.
|
||||
*
|
||||
* The GS-232A backend can be used with rotators that support the GS-232A
|
||||
* protocol.
|
||||
* \def ROT_MODEL_GS232A
|
||||
*
|
||||
* The GS232A backend can be used with rotators that support the GS-232A
|
||||
* protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_GS232_GENERIC
|
||||
* \brief A macro that returns the model number of the GS-232 backend.
|
||||
* \brief A macro that returns the model number of the GS232 backend.
|
||||
*
|
||||
* The GS-232 backend can be used with rotators that support the generic (even if not coded correctly) GS-232
|
||||
* protocol.
|
||||
* \def ROT_MODEL_GS232_GENERIC
|
||||
*
|
||||
* The GS232_GENERIC backend can be used with rotators that support the
|
||||
* generic (even if not coded correctly) GS-232 protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_GS232B
|
||||
* \brief A macro that returns the model number of the GS-232B backend.
|
||||
* \brief A macro that returns the model number of the GS232B backend.
|
||||
*
|
||||
* The GS-232B backend can be used with rotators that support the GS-232B
|
||||
* protocol.
|
||||
* \def ROT_MODEL_GS232B
|
||||
*
|
||||
* The GS232B backend can be used with rotators that support the GS232B
|
||||
* protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_F1TETRACKER
|
||||
* \brief A macro that returns the model number of the F1TETRACKER backend.
|
||||
* \brief A macro that returns the model number of the F1TETRACKER backend.
|
||||
*
|
||||
* The F1TETRACKER backend can be used with rotators that support the
|
||||
* F1TETRACKER protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_GS23
|
||||
* \brief A macro that returns the model number of the GS23 backend.
|
||||
* \def ROT_MODEL_F1TETRACKER
|
||||
*
|
||||
* The GS23 backend can be used with rotators that support the
|
||||
* GS23 protocol.
|
||||
* The F1TETRACKER backend can be used with rotators that support the F1TE
|
||||
* Tracker protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_GS232
|
||||
* \brief A macro that returns the model number of the GS232 backend.
|
||||
/**
|
||||
* \brief A macro that returns the model number of the GS23 backend.
|
||||
*
|
||||
* The GS232 backend can be used with rotators that support the
|
||||
* GS232 protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_LVB
|
||||
* \brief A macro that returns the model number of the LVB TRACKER backend.
|
||||
* \def ROT_MODEL_GS23
|
||||
*
|
||||
* The AMSAT LVB TRACKER backend can be used with rotators that support the
|
||||
* AMSAT LVB TRACKER GS232 based protocol.
|
||||
* The GS23 backend can be used with rotators that support the GS-23 protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_ST2
|
||||
* \brief A macro that returns the model number of the Fox Delta ST2 backend.
|
||||
/**
|
||||
* \brief A macro that returns the model number of the GS232 backend.
|
||||
*
|
||||
* The Fox Delta ST2 backend can be used with rotators that support the
|
||||
* Fox Delta ST2 GS232 based protocol.
|
||||
* \def ROT_MODEL_GS232
|
||||
*
|
||||
* The GS232 backend can be used with rotators that support the GS-232
|
||||
* protocol.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief A macro that returns the model number of the LVB backend.
|
||||
*
|
||||
* \def ROT_MODEL_LVB
|
||||
*
|
||||
* The LVB backend can be used with rotators that support the G6LVB AMSAT LVB
|
||||
* Tracker GS-232 based protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the ST2 backend.
|
||||
*
|
||||
* \def ROT_MODEL_ST2
|
||||
*
|
||||
* The ST2 backend can be used with rotators that support the Fox Delta ST2
|
||||
* GS-232 based protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the GS232A_AZ Azimuth backend.
|
||||
*
|
||||
* \def ROT_MODEL_GS232A_AZ
|
||||
*
|
||||
* The GS232A_AZ backend can be used with azimuth rotators that support the
|
||||
* GS-232A protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the GS232A_EL Elevation backend.
|
||||
*
|
||||
* \def ROT_MODEL_GS232A_EL
|
||||
*
|
||||
* The GS232A_EL backend can be used with elevation rotators that support the
|
||||
* GS-232A protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the GS232B_AZ Azimuth backend.
|
||||
*
|
||||
* \def ROT_MODEL_GS232B_AZ
|
||||
*
|
||||
* The GS232B_AZ backend can be used with azimuth rotators that support the
|
||||
* GS-232B protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the GS232B_EL Elevation backend.
|
||||
*
|
||||
* \def ROT_MODEL_GS232B_EL
|
||||
*
|
||||
* The GS232B_EL backend can be used with elevation rotators that support the
|
||||
* GS-232B protocol.
|
||||
*/
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_GS232A 6
|
||||
#define ROT_BACKEND_GS232A "gs232a"
|
||||
|
@ -266,11 +315,14 @@
|
|||
#define ROT_MODEL_GS232B_AZ ROT_MAKE_MODEL(ROT_GS232A, 11)
|
||||
#define ROT_MODEL_GS232B_EL ROT_MAKE_MODEL(ROT_GS232A, 12)
|
||||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_PCROTOR
|
||||
* \brief A macro that returns the model number of the PcRotor/WA6UFQ backend.
|
||||
* \brief A macro that returns the model number of the PCROTOR backend.
|
||||
*
|
||||
* The kit backend can be used with home brewed rotators.
|
||||
* \def ROT_MODEL_PCROTOR
|
||||
*
|
||||
* The PCROTOR backend is a member of the kit backend group that can be used
|
||||
* with home brewed rotators.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_KIT 7
|
||||
|
@ -280,8 +332,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_HD1780
|
||||
* \brief A macro that returns the model number of the HD 1780 backend.
|
||||
* \brief A macro that returns the model number of the HD1780 backend.
|
||||
*
|
||||
* \def ROT_MODEL_HD1780
|
||||
*
|
||||
* The HD1780 backend can be used with rotators that support the Heathkit
|
||||
* HD-1780 protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_HEATHKIT 8
|
||||
|
@ -291,22 +347,28 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_SPID_ROT2PROG
|
||||
* \brief A macro that returns the model number of the ROT2PROG backend.
|
||||
* \brief A macro that returns the model number of the ROT2PROG backend.
|
||||
*
|
||||
* The SPID backend can be used with rotators that support the SPID protocol.
|
||||
* \def ROT_MODEL_SPID_ROT2PROG
|
||||
*
|
||||
* The SPID_ROT2PROG backend can be used with rotators that support the SPID
|
||||
* azimuth and elevation protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_SPID_ROT1PROG
|
||||
* \brief A macro that returns the model number of the ROT1PROG backend.
|
||||
* \brief A macro that returns the model number of the ROT1PROG backend.
|
||||
*
|
||||
* The SPID backend can be used with rotators that support the SPID protocol.
|
||||
* \def ROT_MODEL_SPID_ROT1PROG
|
||||
*
|
||||
* The SPID_ROT1PROG backend can be used with rotators that support the SPID
|
||||
* azimuth protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_SPID_MD01_ROT2PROG
|
||||
* \brief A macro that returns the model number of the MD-01/02 (ROT2PROG protocol) backend.
|
||||
* \brief A macro that returns the model number of the SPID_MD01_ROT2PROG backend.
|
||||
*
|
||||
* The SPID backend can be used with rotators that support the SPID protocol.
|
||||
* \def ROT_MODEL_SPID_MD01_ROT2PROG
|
||||
*
|
||||
* The SPID_MD01_ROT2PROG backend can be used with rotators that support the
|
||||
* extended SPID ROT2PROG azimuth and elevation protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_SPID 9
|
||||
|
@ -318,11 +380,30 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_RC2800
|
||||
* \brief A macro that returns the model number of the RC2800 backend.
|
||||
* \brief A macro that returns the model number of the RC2800 backend.
|
||||
*
|
||||
* The M2 backend can be used with rotators that support the RC2800 protocol
|
||||
* and alike.
|
||||
* \def ROT_MODEL_RC2800
|
||||
*
|
||||
* The RC2800 backend can be used with rotators that support the M2 (M
|
||||
* Squared) RC2800 protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the RC2800_EARLY_AZ
|
||||
* backend.
|
||||
*
|
||||
* \def ROT_MODEL_RC2800_EARLY_AZ
|
||||
*
|
||||
* The RC2800_EARLY_AZ backend can be used with rotators that support the M2
|
||||
* (M Squared) RC2800 early azimuth protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the RC2800_EARLY_AZEL
|
||||
* backend.
|
||||
*
|
||||
* \def ROT_MODEL_RC2800_EARLY_AZEL
|
||||
*
|
||||
* The RC2800_EARLY_AZEL backend can be used with rotators that support the M2
|
||||
* (M Squared) RC2800 early azimuth and elevation protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_M2 10
|
||||
|
@ -334,16 +415,20 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_RCI_AZEL
|
||||
* \brief A macro that returns the model number of the RCI_AZEL backend.
|
||||
* \brief A macro that returns the model number of the RCI_AZEL backend.
|
||||
*
|
||||
* The ARS backend can be used with rotators that support the ARS protocol.
|
||||
* \def ROT_MODEL_RCI_AZEL
|
||||
*
|
||||
* The RCI_AZEL backend can be used with rotators that support the ARS azimuth
|
||||
* and elevation protocol.
|
||||
*/
|
||||
/**
|
||||
* \def ROT_MODEL_RCI_AZ
|
||||
* \brief A macro that returns the model number of the RCI_AZ backend.
|
||||
* \brief A macro that returns the model number of the RCI_AZ backend.
|
||||
*
|
||||
* The ARS backend can be used with rotators that support the ARS protocol.
|
||||
* \def ROT_MODEL_RCI_AZ
|
||||
*
|
||||
* The RCI_AZ backend can be used with rotators that support the ARS azimuth
|
||||
* protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_ARS 11
|
||||
|
@ -354,11 +439,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_IF100
|
||||
* \brief A macro that returns the model number of the IF-100 backend.
|
||||
* \brief A macro that returns the model number of the IF100 backend.
|
||||
*
|
||||
* The AMSAT backend can be used with rotators that support, among other, the
|
||||
* IF-100 interface.
|
||||
* \def ROT_MODEL_IF100
|
||||
*
|
||||
* The IF100 backend can be used with rotators that support the AMSAT IF-100
|
||||
* interface.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_AMSAT 12
|
||||
|
@ -368,11 +454,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_TS7400
|
||||
* \brief A macro that returns the model number of the TS7400 backend.
|
||||
* \brief A macro that returns the model number of the TS7400 backend.
|
||||
*
|
||||
* The TS-7400 backend supports and embedded ARM board using the TS-7400
|
||||
* Linux board. More information is at http://www.embeddedarm.com
|
||||
* \def ROT_MODEL_TS7400
|
||||
*
|
||||
* The TS7400 backend supports an embedded ARM board using the TS-7400 Linux
|
||||
* board. More information is at https://www.embeddedarm.com
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_TS7400 13
|
||||
|
@ -382,11 +469,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_NEXSTAR
|
||||
* \brief A macro that returns the model number of the NEXSTAR backend.
|
||||
* \brief A macro that returns the model number of the NEXSTAR backend.
|
||||
*
|
||||
* The CELESTRON backend can be used with rotators that support the Celestron
|
||||
* protocol and alike.
|
||||
* \def ROT_MODEL_NEXSTAR
|
||||
*
|
||||
* The NEXSTAR backend can be used with rotators that support the Celestron
|
||||
* NexStar protocol and alike.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_CELESTRON 14
|
||||
|
@ -396,11 +484,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_ETHER6
|
||||
* \brief A macro that returns the model number of the Ether6 backend.
|
||||
* \brief A macro that returns the model number of the ETHER6 backend.
|
||||
*
|
||||
* The Ether6 backend can be used with rotators that support the Ether6
|
||||
* protocol and alike.
|
||||
* \def ROT_MODEL_ETHER6
|
||||
*
|
||||
* The ETHER6 backend can be used with rotators that support the Ether6
|
||||
* protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_ETHER6 15
|
||||
|
@ -410,11 +499,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_CNCTRK
|
||||
* \brief A macro that returns the model number of the CNCTRK backend.
|
||||
* \brief A macro that returns the model number of the CNCTRK backend.
|
||||
*
|
||||
* The CNCTRK backend can be used with rotators that support the LinuxCNC
|
||||
* running Axis GUI interface.
|
||||
* \def ROT_MODEL_CNCTRK
|
||||
*
|
||||
* The CNCTRK backend can be used with rotators that support the LinuxCNC
|
||||
* running Axis GUI interface.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_CNCTRK 16
|
||||
|
@ -424,39 +514,46 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_PROSISTEL_D_AZ
|
||||
* \brief A macro that returns the model number of the PROSISTEL D azimuth backend.
|
||||
* \brief A macro that returns the model number of the PROSISTEL_D_AZ backend.
|
||||
*
|
||||
* \def ROT_MODEL_PROSISTEL_D_AZ
|
||||
*
|
||||
* The PROSISTEL_D_AZ backend can be used with rotators that support the Prosistel
|
||||
* azimuth protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the PROSISTEL_D_EL backend.
|
||||
*
|
||||
* \def ROT_MODEL_PROSISTEL_D_EL
|
||||
*
|
||||
* The PROSISTEL_D_EL backend can be used with rotators that support the Prosistel
|
||||
* elevation protocol.
|
||||
*/
|
||||
/**
|
||||
* \brief A macro that returns the model number of the
|
||||
* PROSISTEL_COMBI_TRACK_AZEL backend.
|
||||
*
|
||||
* \def ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL
|
||||
*
|
||||
* The PROSISTEL_AZEL_COMBI_TRACK_AZEL backend can be used with rotators that
|
||||
* support the Prosistel combination azimuth and elevation protocol.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_PROSISTEL 17
|
||||
#define ROT_BACKEND_PROSISTEL "prosistel"
|
||||
//! @endcond
|
||||
#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1)
|
||||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_PROSISTEL_D_EL
|
||||
* \brief A macro that returns the model number of the PROSISTEL D elevation backend.
|
||||
*
|
||||
*/
|
||||
#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2)
|
||||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_PROSISTEL_AZEL_COMBO
|
||||
* \brief A macro that returns the model number of the PROSISTEL Combi-Track azimuth + elevation combo backend.
|
||||
*
|
||||
*/
|
||||
#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3)
|
||||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_MEADE
|
||||
* \brief A macro that returns the model number of the MEADE backend.
|
||||
* \brief A macro that returns the model number of the MEADE backend.
|
||||
*
|
||||
* The MEADE backen can be used with Meade telescope rotators like
|
||||
* DS-2000
|
||||
* \def ROT_MODEL_MEADE
|
||||
*
|
||||
* The MEADE backend can be used with Meade telescope rotators like the
|
||||
* DS-2000.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_MEADE 18
|
||||
|
@ -465,10 +562,11 @@
|
|||
#define ROT_MODEL_MEADE ROT_MAKE_MODEL(ROT_MEADE, 1)
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_IOPTRON
|
||||
* \brief A macro that returns the model number of the IOPTRON backend.
|
||||
* \brief A macro that returns the model number of the IOPTRON backend.
|
||||
*
|
||||
* The IOPTRON backen can be used with IOPTRON telescope mounts
|
||||
* \def ROT_MODEL_IOPTRON
|
||||
*
|
||||
* The IOPTRON backend can be used with IOPTRON telescope mounts.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_IOPTRON 19
|
||||
|
@ -478,12 +576,12 @@
|
|||
|
||||
|
||||
/**
|
||||
+ * \def ROT_MODEL_INDI
|
||||
+ * \brief A macro that returns the model number of the INDI backend.
|
||||
+ *
|
||||
+ * The INDI backend can be used with rotators that support, among other, the
|
||||
+ * INDI interface.
|
||||
+ */
|
||||
* \brief A macro that returns the model number of the INDI backend.
|
||||
*
|
||||
* \def ROT_MODEL_INDI
|
||||
*
|
||||
* The INDI backend can be used with rotators that support the INDI interface.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_INDI 20
|
||||
#define ROT_BACKEND_INDI "indi"
|
||||
|
@ -492,11 +590,12 @@
|
|||
|
||||
|
||||
/**
|
||||
* \def ROT_MODEL_SATEL
|
||||
* \brief A macro that returns the model number of the SatEL backend.
|
||||
* \brief A macro that returns the model number of the SATEL backend.
|
||||
*
|
||||
* The SatEL backend can be used with rotators that support the VE5FP
|
||||
* interface.
|
||||
* \def ROT_MODEL_SATEL
|
||||
*
|
||||
* The SATEL backend can be used with rotators that support the VE5FP
|
||||
* interface.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
#define ROT_SATEL 21
|
||||
|
@ -508,8 +607,9 @@
|
|||
|
||||
|
||||
/**
|
||||
* \typedef typedef int rot_model_t
|
||||
* \brief Convenience type definition for rotator model.
|
||||
* \brief Convenience type definition for a rotator model.
|
||||
*
|
||||
* \typedef typedef int rot_model_t
|
||||
*/
|
||||
typedef int rot_model_t;
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ int long_only;
|
|||
int exact = 0;
|
||||
int ambig = 0;
|
||||
const struct option *pfound = NULL;
|
||||
int indfound;
|
||||
int indfound = 0;
|
||||
int option_index;
|
||||
|
||||
while (*s && *s != '=')
|
||||
|
|
|
@ -109,6 +109,7 @@ to something else than an empty string.
|
|||
fi
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
sysconfig="distutils.sysconfig"
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -132,11 +133,33 @@ variable to configure. See ``configure --help'' for reference.
|
|||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
#
|
||||
# Check for a version of Python >= 3.0.0
|
||||
#
|
||||
AC_MSG_CHECKING([for a version of Python >= '3.0.0'])
|
||||
ac_supports_python3_ver=`$PYTHON -c "import sys; \
|
||||
ver = sys.version.split ()[[0]]; \
|
||||
print (ver >= '3.0.0')"`
|
||||
if test "$ac_supports_python3_ver" != "True"; then
|
||||
if test -z "$PYTHON_NOVERSIONCHECK"; then
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([skip at user request])
|
||||
fi
|
||||
else
|
||||
sysconfig="sysconfig"
|
||||
PYTHON_CPPFLAGS=`python3-config --includes`
|
||||
PYTHON_EXTRA_LDFLAGS=`python3-config --ldflags`
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Check if you have distutils, else fail
|
||||
#
|
||||
AC_MSG_CHECKING([for the distutils Python package])
|
||||
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
|
||||
ac_distutils_result=`$PYTHON -c "import $sysconfig" 2>&1`
|
||||
if test $? -eq 0; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
|
@ -152,10 +175,10 @@ $ac_distutils_result])
|
|||
#
|
||||
AC_MSG_CHECKING([for Python include path])
|
||||
if test -z "$PYTHON_CPPFLAGS"; then
|
||||
python_path=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_python_inc ());"`
|
||||
plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
|
||||
python_path=`$PYTHON -c "import $sysconfig; \
|
||||
print ($sysconfig.get_python_inc ());"`
|
||||
plat_python_path=`$PYTHON -c "import $sysconfig; \
|
||||
print ($sysconfig.get_python_inc (plat_specific=1));"`
|
||||
if test -n "${python_path}"; then
|
||||
if test "${plat_python_path}" != "${python_path}"; then
|
||||
python_path="-I$python_path -I$plat_python_path"
|
||||
|
@ -179,7 +202,7 @@ $ac_distutils_result])
|
|||
|
||||
# join all versioning strings, on some systems
|
||||
# major/minor numbers could be in different list elements
|
||||
from distutils.sysconfig import *
|
||||
from $sysconfig import *
|
||||
e = get_config_var('VERSION')
|
||||
if e is not None:
|
||||
print(e)
|
||||
|
@ -202,8 +225,8 @@ EOD`
|
|||
ac_python_libdir=`cat<<EOD | $PYTHON -
|
||||
|
||||
# There should be only one
|
||||
import distutils.sysconfig
|
||||
e = distutils.sysconfig.get_config_var('LIBDIR')
|
||||
import $sysconfig
|
||||
e = $sysconfig.get_config_var('LIBDIR')
|
||||
if e is not None:
|
||||
print (e)
|
||||
EOD`
|
||||
|
@ -211,8 +234,8 @@ EOD`
|
|||
# Now, for the library:
|
||||
ac_python_library=`cat<<EOD | $PYTHON -
|
||||
|
||||
import distutils.sysconfig
|
||||
c = distutils.sysconfig.get_config_vars()
|
||||
import $sysconfig
|
||||
c = $sysconfig.get_config_vars()
|
||||
if 'LDVERSION' in c:
|
||||
print ('python'+c[['LDVERSION']])
|
||||
else:
|
||||
|
@ -231,7 +254,7 @@ EOD`
|
|||
else
|
||||
# old way: use libpython from python_configdir
|
||||
ac_python_libdir=`$PYTHON -c \
|
||||
"from distutils.sysconfig import get_python_lib as f; \
|
||||
"from $sysconfig import get_python_lib as f; \
|
||||
import os; \
|
||||
print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
|
||||
PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
|
||||
|
@ -252,8 +275,8 @@ EOD`
|
|||
#
|
||||
AC_MSG_CHECKING([for Python site-packages path])
|
||||
if test -z "$PYTHON_SITE_PKG"; then
|
||||
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_python_lib(0,0));"`
|
||||
PYTHON_SITE_PKG=`$PYTHON -c "import $sysconfig; \
|
||||
print ($sysconfig.get_python_lib(0,0));"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_SITE_PKG])
|
||||
AC_SUBST([PYTHON_SITE_PKG])
|
||||
|
@ -263,8 +286,8 @@ EOD`
|
|||
#
|
||||
AC_MSG_CHECKING(python extra libraries)
|
||||
if test -z "$PYTHON_EXTRA_LIBS"; then
|
||||
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
|
||||
conf = distutils.sysconfig.get_config_var; \
|
||||
PYTHON_EXTRA_LIBS=`$PYTHON -c "import $sysconfig; \
|
||||
conf = $sysconfig.get_config_var; \
|
||||
print (conf('LIBS') + ' ' + conf('SYSLIBS'))"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
|
||||
|
@ -275,8 +298,8 @@ EOD`
|
|||
#
|
||||
AC_MSG_CHECKING(python extra linking flags)
|
||||
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
|
||||
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
|
||||
conf = distutils.sysconfig.get_config_var; \
|
||||
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import $sysconfig; \
|
||||
conf = $sysconfig.get_config_var; \
|
||||
print (conf('LINKFORSHARED'))"`
|
||||
fi
|
||||
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
AC_DEFUN([GR_PWIN32],
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
AC_SEARCH_LIBS([nanosleep], [pthread], [], [AC_MSG_ERROR([unable to find nanosleep])])
|
||||
AC_CHECK_HEADERS([pthread.h])
|
||||
AC_CHECK_HEADERS([sys/types.h])
|
||||
|
|
|
@ -7,6 +7,6 @@ LOCAL_MODULE := adat
|
|||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
LOCAL_C_INCLUDES := android include src
|
||||
LOCAL_LDLIBS := -lhamlib -Lobj/local/armeabi
|
||||
LOCAL_LDLIBS := $(LOCAL_SHARED_LIBRARIES) -Lobj/local/armeabi
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
|
|
@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := dx77.c alinco.c
|
||||
LOCAL_SRC_FILES := dx77.c alinco.c dxsr8.c
|
||||
LOCAL_MODULE := alinco
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
|
|
|
@ -632,7 +632,7 @@ int aor_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ && !RIG_IS_DBLST_END(rs->attenuator[i]); i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ && !RIG_IS_DBLST_END(rs->attenuator[i]); i++)
|
||||
{
|
||||
if (rs->attenuator[i] == val.i)
|
||||
{
|
||||
|
@ -642,7 +642,7 @@ int aor_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
}
|
||||
|
||||
/* should be caught by the front end */
|
||||
if ((val.i != 0) && (i >= MAXDBLSTSIZ || RIG_IS_DBLST_END(rs->attenuator[i])))
|
||||
if ((val.i != 0) && (i >= HAMLIB_MAXDBLSTSIZ || RIG_IS_DBLST_END(rs->attenuator[i])))
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -762,7 +762,7 @@ int aor_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
}
|
||||
|
||||
if (att > MAXDBLSTSIZ || rs->attenuator[att - 1] == 0)
|
||||
if (att > HAMLIB_MAXDBLSTSIZ || rs->attenuator[att - 1] == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "Unsupported att %s %d\n",
|
||||
__func__, att);
|
||||
|
@ -1270,7 +1270,7 @@ int aor_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
*/
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
for (i = 0; i < HAMLIB_CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
{
|
||||
if (channel_num >= chan_list[i].startc &&
|
||||
channel_num <= chan_list[i].endc)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
static enum PAGE_e curPage = NONE; /* Current memory page */
|
||||
static unsigned int curAddr = 65535; /* Current page address */
|
||||
static enum LOCK_LVL_e curLock = LOCK_0; /* Current lock level */
|
||||
static const unsigned int PAGE_SIZE[] =
|
||||
static const unsigned int AR7030_PAGE_SIZE[] =
|
||||
{
|
||||
256, 256, 512, 4096, 4096,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
@ -435,7 +435,7 @@ static int setAddr(RIG *rig, enum PAGE_e page, unsigned int addr)
|
|||
|
||||
if ((EEPROM3 >= page) || (ROM == page))
|
||||
{
|
||||
if (PAGE_SIZE[page] > addr)
|
||||
if (AR7030_PAGE_SIZE[page] > addr)
|
||||
{
|
||||
if (curPage != page)
|
||||
{
|
||||
|
@ -1454,11 +1454,11 @@ int pageSize(const enum PAGE_e page)
|
|||
|
||||
if ((WORKING <= page) && (EEPROM3 >= page))
|
||||
{
|
||||
rc = (int) PAGE_SIZE[ page ];
|
||||
rc = (int) AR7030_PAGE_SIZE[ page ];
|
||||
}
|
||||
else if (ROM == page)
|
||||
{
|
||||
rc = (int) PAGE_SIZE[ page ];
|
||||
rc = (int) AR7030_PAGE_SIZE[ page ];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -638,7 +638,7 @@ int sr2200_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
break;
|
||||
|
||||
case RIG_LEVEL_ATT:
|
||||
for (i = 0; i < MAXDBLSTSIZ && !RIG_IS_DBLST_END(rs->attenuator[i]); i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ && !RIG_IS_DBLST_END(rs->attenuator[i]); i++)
|
||||
{
|
||||
if (rs->attenuator[i] == val.i)
|
||||
{
|
||||
|
@ -648,7 +648,7 @@ int sr2200_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
}
|
||||
|
||||
/* should be caught by the front end */
|
||||
if ((val.i != 0) && (i >= MAXDBLSTSIZ || RIG_IS_DBLST_END(rs->attenuator[i])))
|
||||
if ((val.i != 0) && (i >= HAMLIB_MAXDBLSTSIZ || RIG_IS_DBLST_END(rs->attenuator[i])))
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -759,7 +759,7 @@ int sr2200_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
}
|
||||
|
||||
if (att > MAXDBLSTSIZ || rs->attenuator[att - 1] == 0)
|
||||
if (att > HAMLIB_MAXDBLSTSIZ || rs->attenuator[att - 1] == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "Unsupported att %s %u\n",
|
||||
__func__, att);
|
||||
|
|
|
@ -154,7 +154,7 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
char cmd_buf[MAXCMDLEN];
|
||||
int retval;
|
||||
int i;
|
||||
int chan;
|
||||
int chan = -1;
|
||||
freq_t freq_rx, freq_tx;
|
||||
freq_t freq_MHz;
|
||||
char *response = NULL;
|
||||
|
|
|
@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := barrett.c barrett.h
|
||||
LOCAL_SRC_FILES := barrett.c barrett.h 950.c
|
||||
LOCAL_MODULE := barrett
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
|
|
|
@ -187,7 +187,7 @@ int dra818_cleanup(RIG *rig)
|
|||
int dra818_open(RIG *rig)
|
||||
{
|
||||
int i;
|
||||
int r;
|
||||
int r = -1;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c trxmanager.c
|
||||
LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c trxmanager.c dummy_common.c
|
||||
LOCAL_MODULE := dummy
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
|
|
|
@ -389,7 +389,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
|
||||
|
||||
usleep(CMDSLEEP);
|
||||
sprintf_freq(fstr, freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), freq);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__,
|
||||
rig_strvfo(vfo), fstr);
|
||||
|
||||
|
@ -451,7 +451,7 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
ENTERFUNC;
|
||||
usleep(CMDSLEEP);
|
||||
sprintf_freq(buf, width);
|
||||
sprintf_freq(buf, sizeof(buf), width);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s %s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strrmode(mode), buf);
|
||||
|
||||
|
@ -505,8 +505,12 @@ static int dummy_set_vfo(RIG *rig, vfo_t vfo)
|
|||
case RIG_VFO_VFO: /* FIXME */
|
||||
|
||||
case RIG_VFO_RX:
|
||||
case RIG_VFO_MAIN: priv->curr = &priv->vfo_a; break;
|
||||
|
||||
case RIG_VFO_A: priv->curr = &priv->vfo_a; break;
|
||||
|
||||
case RIG_VFO_SUB: priv->curr = &priv->vfo_b; break;
|
||||
|
||||
case RIG_VFO_B: priv->curr = &priv->vfo_b; break;
|
||||
|
||||
case RIG_VFO_MEM:
|
||||
|
@ -1004,6 +1008,8 @@ static int dummy_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
if (RIG_LEVEL_IS_FLOAT(level))
|
||||
{
|
||||
if (val.f > 1.0) { RETURNFUNC(-RIG_EINVAL); }
|
||||
|
||||
sprintf(lstr, "%f", val.f);
|
||||
}
|
||||
else
|
||||
|
@ -1956,9 +1962,7 @@ static int dummy_get_trn(RIG *rig, int *trn)
|
|||
|
||||
static const char *dummy_get_info(RIG *rig)
|
||||
{
|
||||
ENTERFUNC;
|
||||
|
||||
RETURNFUNC("Nothing much (dummy)");
|
||||
return "Nothing much (dummy)";
|
||||
}
|
||||
|
||||
|
||||
|
@ -2242,7 +2246,7 @@ struct rig_caps dummy_no_vfo_caps =
|
|||
RIG_MODEL(RIG_MODEL_DUMMY_NOVFO),
|
||||
.model_name = "Dummy No VFO",
|
||||
.mfg_name = "Hamlib",
|
||||
.version = "20200606.0",
|
||||
.version = "20210218.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_OTHER,
|
||||
|
|
3000
rigs/dummy/flrig.c
3000
rigs/dummy/flrig.c
Plik diff jest za duży
Load Diff
|
@ -28,7 +28,7 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "20210215"
|
||||
#define BACKEND_VER "20210308"
|
||||
|
||||
#define EOM "\r"
|
||||
#define TRUE 1
|
||||
|
|
|
@ -215,7 +215,7 @@ static int netrigctl_open(RIG *rig)
|
|||
len = sprintf(cmd, "\\chk_vfo\n");
|
||||
ret = netrigctl_transaction(rig, cmd, len, buf);
|
||||
|
||||
if (sscanf(buf,"CHKVFO %d", &priv->rigctld_vfo_mode)==1)
|
||||
if (sscanf(buf, "CHKVFO %d", &priv->rigctld_vfo_mode) == 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chkvfo=%d\n", __func__, priv->rigctld_vfo_mode);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ static int netrigctl_open(RIG *rig)
|
|||
|
||||
rs->deprecated_itu_region = atoi(buf);
|
||||
|
||||
for (i = 0; i < FRQRANGESIZ; i++)
|
||||
for (i = 0; i < HAMLIB_FRQRANGESIZ; i++)
|
||||
{
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -300,7 +300,7 @@ static int netrigctl_open(RIG *rig)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < FRQRANGESIZ; i++)
|
||||
for (i = 0; i < HAMLIB_FRQRANGESIZ; i++)
|
||||
{
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -330,7 +330,7 @@ static int netrigctl_open(RIG *rig)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < TSLSTSIZ; i++)
|
||||
for (i = 0; i < HAMLIB_TSLSTSIZ; i++)
|
||||
{
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -354,7 +354,7 @@ static int netrigctl_open(RIG *rig)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < FLTLSTSIZ; i++)
|
||||
for (i = 0; i < HAMLIB_FLTLSTSIZ; i++)
|
||||
{
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -380,7 +380,7 @@ static int netrigctl_open(RIG *rig)
|
|||
|
||||
#if 0
|
||||
/* TODO */
|
||||
chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
#endif
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
@ -432,7 +432,7 @@ static int netrigctl_open(RIG *rig)
|
|||
&rs->preamp[4], &rs->preamp[5],
|
||||
&rs->preamp[6]);
|
||||
|
||||
if (ret < 0 || ret >= MAXDBLSTSIZ)
|
||||
if (ret < 0 || ret >= HAMLIB_MAXDBLSTSIZ)
|
||||
{
|
||||
ret = 0;
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ static int netrigctl_open(RIG *rig)
|
|||
&rs->attenuator[4], &rs->attenuator[5],
|
||||
&rs->attenuator[6]);
|
||||
|
||||
if (ret < 0 || ret >= MAXDBLSTSIZ)
|
||||
if (ret < 0 || ret >= HAMLIB_MAXDBLSTSIZ)
|
||||
{
|
||||
ret = 0;
|
||||
}
|
||||
|
@ -526,13 +526,13 @@ static int netrigctl_open(RIG *rig)
|
|||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */
|
||||
#endif
|
||||
|
||||
for (i = 0; i < FRQRANGESIZ && !RIG_IS_FRNG_END(rs->rx_range_list[i]); i++)
|
||||
for (i = 0; i < HAMLIB_FRQRANGESIZ && !RIG_IS_FRNG_END(rs->rx_range_list[i]); i++)
|
||||
{
|
||||
rs->mode_list |= rs->rx_range_list[i].modes;
|
||||
rs->vfo_list |= rs->rx_range_list[i].vfo;
|
||||
}
|
||||
|
||||
for (i = 0; i < FRQRANGESIZ && !RIG_IS_FRNG_END(rs->tx_range_list[i]); i++)
|
||||
for (i = 0; i < HAMLIB_FRQRANGESIZ && !RIG_IS_FRNG_END(rs->tx_range_list[i]); i++)
|
||||
{
|
||||
rs->mode_list |= rs->tx_range_list[i].modes;
|
||||
rs->vfo_list |= rs->tx_range_list[i].vfo;
|
||||
|
|
|
@ -259,7 +259,8 @@ static int dummy_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
|
|||
priv->target_el = el;
|
||||
gettimeofday(&priv->tv, NULL);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
priv->az = priv->target_az = az;
|
||||
priv->el = priv->target_az = el;
|
||||
}
|
||||
|
@ -358,7 +359,7 @@ static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (simulating)
|
||||
if (simulating)
|
||||
{
|
||||
dummy_rot_simulate_rotation(rot);
|
||||
}
|
||||
|
|
|
@ -1929,7 +1929,7 @@ int elad_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
int foundit = 0;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
|
||||
{
|
||||
if (val.i == rig->state.attenuator[i])
|
||||
{
|
||||
|
@ -1958,7 +1958,7 @@ int elad_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
int foundit = 0;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ && rig->state.preamp[i]; i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.preamp[i]; i++)
|
||||
{
|
||||
if (val.i == rig->state.preamp[i])
|
||||
{
|
||||
|
@ -2141,7 +2141,7 @@ int elad_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < lvl && i < MAXDBLSTSIZ; i++)
|
||||
for (i = 0; i < lvl && i < HAMLIB_MAXDBLSTSIZ; i++)
|
||||
{
|
||||
if (rig->state.attenuator[i] == 0)
|
||||
{
|
||||
|
@ -2178,7 +2178,7 @@ int elad_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
{
|
||||
lvl = lvlbuf[2] - '0';
|
||||
|
||||
for (i = 0; i < lvl && i < MAXDBLSTSIZ; i++)
|
||||
for (i = 0; i < lvl && i < HAMLIB_MAXDBLSTSIZ; i++)
|
||||
{
|
||||
if (rig->state.preamp[i] == 0)
|
||||
{
|
||||
|
|
|
@ -519,7 +519,7 @@ int dttsp_init(RIG *rig)
|
|||
cmdpath = rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK ?
|
||||
DEFAULT_DTTSP_CMD_NET_ADDR : DEFAULT_DTTSP_CMD_PATH;
|
||||
|
||||
strncpy(rig->state.rigport.pathname, cmdpath, FILPATHLEN - 1);
|
||||
strncpy(rig->state.rigport.pathname, cmdpath, HAMLIB_FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ int dttsp_open(RIG *rig)
|
|||
if (!p)
|
||||
{
|
||||
meterpath = priv->meter_port.pathname;
|
||||
snprintf(meterpath, FILPATHLEN, "%s", rig->state.rigport.pathname);
|
||||
snprintf(meterpath, HAMLIB_FILPATHLEN, "%s", rig->state.rigport.pathname);
|
||||
|
||||
if (rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK)
|
||||
{
|
||||
|
@ -694,7 +694,7 @@ int dttsp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
max_delta = priv->sample_rate / 2 - kHz(2);
|
||||
|
||||
sprintf_freq(fstr, freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), freq);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called: %s %s\n",
|
||||
__func__, rig_strvfo(vfo), fstr);
|
||||
|
||||
|
@ -730,7 +730,7 @@ int dttsp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
priv->rx_delta_f = freq - tuner_freq;
|
||||
|
||||
sprintf_freq(fstr, tuner_freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), tuner_freq);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: tuner=%s, rx_delta=%d Hz\n",
|
||||
__func__, fstr, priv->rx_delta_f);
|
||||
|
||||
|
@ -802,7 +802,7 @@ int dttsp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
width = rig_passband_normal(rig, mode);
|
||||
}
|
||||
|
||||
sprintf_freq(buf, width);
|
||||
sprintf_freq(buf, sizeof(buf), width);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n",
|
||||
__func__, rig_strrmode(mode), buf);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := icm700pro.c icm710.c icm802.c \
|
||||
LOCAL_SRC_FILES := icm700pro.c icm710.c icm802.c icm803.c \
|
||||
icmarine.c
|
||||
LOCAL_MODULE := icmarine
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@ LOCAL_SRC_FILES := ic706.c icr8500.c ic735.c ic775.c ic756.c \
|
|||
id1.c id5100.c ic2730.c \
|
||||
ic707.c ic728.c ic751.c ic761.c \
|
||||
ic78.c ic7800.c ic7000.c ic7100.c ic7200.c ic7600.c ic7700.c \
|
||||
icom.c frame.c optoscan.c
|
||||
icom.c frame.c optoscan.c x108g.c perseus.c id4100.c id51.c \
|
||||
id31.c icr8600.c ic7300.c ic7610.c icr30.c ic785x.c
|
||||
LOCAL_MODULE := icom
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
|
|
|
@ -53,6 +53,7 @@ int make_cmd_frame(char frame[], char re_id, char ctrl_id, char cmd, int subcmd,
|
|||
{
|
||||
int i = 0;
|
||||
|
||||
ENTERFUNC;
|
||||
#if 0
|
||||
frame[i++] = PAD; /* give old rigs a chance to flush their rx buffers */
|
||||
#endif
|
||||
|
@ -86,7 +87,7 @@ int make_cmd_frame(char frame[], char re_id, char ctrl_id, char cmd, int subcmd,
|
|||
|
||||
frame[i++] = FI; /* EOM code */
|
||||
|
||||
return i;
|
||||
RETURNFUNC(i);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -115,7 +116,9 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
int frm_len, retval;
|
||||
int ctrl_id;
|
||||
|
||||
sendbuf[0] = buf[0] = 0;
|
||||
ENTERFUNC;
|
||||
memset(buf, 0, 200);
|
||||
memset(sendbuf, 0, MAXFRAMELEN);
|
||||
rs = &rig->state;
|
||||
priv = (struct icom_priv_data *)rs->priv;
|
||||
priv_caps = (struct icom_priv_caps *)rig->caps->priv;
|
||||
|
@ -132,12 +135,14 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
|
||||
rig_flush(&rs->rigport);
|
||||
|
||||
if (data_len) { *data_len = 0; }
|
||||
|
||||
retval = write_block(&rs->rigport, (char *) sendbuf, frm_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
Unhold_Decode(rig);
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
if (!priv_caps->serial_full_duplex && !priv->serial_USB_echo_off)
|
||||
|
@ -158,18 +163,18 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
{
|
||||
/* Nothing received, CI-V interface is not echoing */
|
||||
Unhold_Decode(rig);
|
||||
return -RIG_BUSERROR;
|
||||
RETURNFUNC(-RIG_BUSERROR);
|
||||
}
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
/* Other error, return it */
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
if (retval < 1)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
switch (buf[retval - 1])
|
||||
|
@ -177,7 +182,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
case COL:
|
||||
/* Collision */
|
||||
Unhold_Decode(rig);
|
||||
return -RIG_BUSBUSY;
|
||||
RETURNFUNC(-RIG_BUSBUSY);
|
||||
|
||||
case FI:
|
||||
/* Ok, normal frame */
|
||||
|
@ -187,7 +192,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
/* Timeout after reading at least one character */
|
||||
/* Problem on ci-v bus? */
|
||||
Unhold_Decode(rig);
|
||||
return -RIG_BUSERROR;
|
||||
RETURNFUNC(-RIG_BUSERROR);
|
||||
}
|
||||
|
||||
if (retval != frm_len)
|
||||
|
@ -196,7 +201,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
/* Problem on ci-v bus? */
|
||||
/* Someone else got a packet in? */
|
||||
Unhold_Decode(rig);
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
if (memcmp(buf, sendbuf, frm_len))
|
||||
|
@ -205,7 +210,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
/* Problem on ci-v bus? */
|
||||
/* Someone else got a packet in? */
|
||||
Unhold_Decode(rig);
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +220,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
if (data_len == NULL)
|
||||
{
|
||||
Unhold_Decode(rig);
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -246,44 +251,50 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
{
|
||||
/* RIG_TIMEOUT: timeout getting response, return timeout */
|
||||
/* other error: return it */
|
||||
return frm_len;
|
||||
RETURNFUNC(frm_len);
|
||||
}
|
||||
|
||||
if (frm_len < 1)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
switch (buf[frm_len - 1])
|
||||
{
|
||||
case COL:
|
||||
/* Collision */
|
||||
return -RIG_BUSBUSY;
|
||||
RETURNFUNC(-RIG_BUSBUSY);
|
||||
|
||||
case FI:
|
||||
/* Ok, normal frame */
|
||||
break;
|
||||
|
||||
case NAK:
|
||||
RETURNFUNC(-RIG_ERJCTED);
|
||||
|
||||
default:
|
||||
/* Timeout after reading at least one character */
|
||||
/* Problem on ci-v bus? */
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
if (frm_len < ACKFRMLEN) { return -RIG_EPROTO; }
|
||||
if (frm_len < ACKFRMLEN) { RETURNFUNC(-RIG_EPROTO); }
|
||||
|
||||
if (NAK == buf[frm_len - 2]) { return -RIG_ERJCTED; }
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: frm_len=%d, frm_len-1=%02x, frm_len-2=%02x\n", __func__, frm_len, buf[frm_len-1], buf[frm_len-2]);
|
||||
if (NAK == buf[frm_len - 2]) { RETURNFUNC(-RIG_ERJCTED); }
|
||||
|
||||
// has to be one of these two now or frame is corrupt
|
||||
if (FI != buf[frm_len - 1] && ACK != buf[frm_len - 1]) { RETURNFUNC(-RIG_BUSBUSY); }
|
||||
|
||||
*data_len = frm_len - (ACKFRMLEN - 1);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: data_len=%d, frm_len=%d\n", __func__, *data_len,
|
||||
frm_len);
|
||||
if (*data_len <= 0) { RETURNFUNC(-RIG_EPROTO); }
|
||||
memcpy(data, buf + 4, *data_len);
|
||||
|
||||
/*
|
||||
* TODO: check addresses in reply frame
|
||||
*/
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -305,6 +316,7 @@ int icom_transaction(RIG *rig, int cmd, int subcmd,
|
|||
{
|
||||
int retval, retry;
|
||||
|
||||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: cmd=0x%02x, subcmd=0x%02x, payload_len=%d\n", __func__,
|
||||
cmd, subcmd, payload_len);
|
||||
|
@ -320,9 +332,12 @@ int icom_transaction(RIG *rig, int cmd, int subcmd,
|
|||
{
|
||||
break;
|
||||
}
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: timeout retry=%d\n", __func__, retry);
|
||||
|
||||
//hl_usleep(500 * 1000); // pause a half second -- don't think we need this
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: retry=%d: %s\n", __func__, retry,
|
||||
rigerror(retval));
|
||||
|
||||
// On some serial errors we may need a bit of time
|
||||
hl_usleep(100 * 1000); // pause just a bit
|
||||
}
|
||||
while (retry-- > 0);
|
||||
|
||||
|
@ -351,6 +366,10 @@ int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[],
|
|||
int retries = 10;
|
||||
char *rx_ptr = (char *)rxbuffer;
|
||||
|
||||
ENTERFUNC;
|
||||
// zeroize the buffer so we can still check contents after timeouts
|
||||
memset(rx_ptr, 0, rxbuffer_len);
|
||||
|
||||
/*
|
||||
* OK, now sometimes we may time out, e.g. the IC7000 can time out
|
||||
* during a PTT operation. So, we will insure that the last thing we
|
||||
|
@ -363,14 +382,14 @@ int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[],
|
|||
|
||||
if (i < 0) /* die on errors */
|
||||
{
|
||||
return i;
|
||||
RETURNFUNC(i);
|
||||
}
|
||||
|
||||
if (i == 0) /* nothing read?*/
|
||||
{
|
||||
if (--retries <= 0) /* Tried enough times? */
|
||||
{
|
||||
return read;
|
||||
RETURNFUNC(read);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -381,7 +400,7 @@ int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[],
|
|||
while ((read < rxbuffer_len) && (rxbuffer[read - 1] != FI)
|
||||
&& (rxbuffer[read - 1] != COL));
|
||||
|
||||
return read;
|
||||
RETURNFUNC(read);
|
||||
}
|
||||
|
||||
|
||||
|
@ -404,6 +423,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
|
|||
pbwidth_t width_tmp = width;
|
||||
struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv;
|
||||
|
||||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode=%d, width=%d\n", __func__, (int)mode,
|
||||
(int)width);
|
||||
icmode_ext = -1;
|
||||
|
@ -479,7 +499,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
|
|||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported Hamlib mode %s\n", __func__,
|
||||
rig_strrmode(mode));
|
||||
return -RIG_EINVAL;
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
if (width_tmp != RIG_PASSBAND_NOCHANGE)
|
||||
|
@ -527,7 +547,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
|
|||
}
|
||||
|
||||
*md = icmode;
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -651,6 +671,5 @@ void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode,
|
|||
rig_debug(RIG_DEBUG_ERR, "icom: Unsupported Icom mode width %#.2x\n", pd);
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
|
1227
rigs/icom/icom.c
1227
rigs/icom/icom.c
Plik diff jest za duży
Load Diff
|
@ -30,7 +30,7 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "20210217"
|
||||
#define BACKEND_VER "20210310"
|
||||
|
||||
/*
|
||||
* defines used by comp_cal_str in rig.c
|
||||
|
|
|
@ -7,7 +7,8 @@ LOCAL_SRC_FILES := ts850.c ts870s.c ts570.c ts450s.c ts950.c ts50s.c \
|
|||
ts680.c ts690.c ts140.c ts480.c trc80.c ts590.c \
|
||||
ts440.c ts940.c ts711.c ts811.c r5000.c \
|
||||
thd7.c thf7.c thg71.c tmd700.c tmv7.c thf6a.c thd72.c tmd710.c \
|
||||
kenwood.c th.c ic10.c elecraft.c transfox.c
|
||||
kenwood.c th.c ic10.c elecraft.c transfox.c flex6xxx.c ts990s.c \
|
||||
xg3.c thd74.c flex.c pihpsdr.c
|
||||
LOCAL_MODULE := kenwood
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
|
|
|
@ -177,12 +177,14 @@ int elecraft_open(RIG *rig)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s: K2 level is %d, %s\n", __func__,
|
||||
priv->k2_ext_lvl, elec_ext_id_str_lst[priv->k2_ext_lvl].id);
|
||||
|
||||
priv->is_k2 = 1;
|
||||
break;
|
||||
|
||||
case RIG_MODEL_K3:
|
||||
case RIG_MODEL_K3S:
|
||||
case RIG_MODEL_KX2:
|
||||
case RIG_MODEL_KX3:
|
||||
case RIG_MODEL_K4:
|
||||
// we need to know what's hooked up for PC command max levels
|
||||
err = kenwood_safe_transaction(rig, "OM", buf, KENWOOD_MAX_BUF_LEN, 15);
|
||||
|
||||
|
@ -193,6 +195,33 @@ int elecraft_open(RIG *rig)
|
|||
|
||||
if (strstr(buf, "P")) { priv->has_kpa3 = 1; }
|
||||
|
||||
// could also use K4; command
|
||||
priv->is_k3 = 1; // default to K3
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_K4)
|
||||
{
|
||||
priv->is_k3 = 0;
|
||||
priv->is_k4 = 1;
|
||||
}
|
||||
else if (strstr(buf, "R"))
|
||||
{
|
||||
priv->is_k3 = 0;
|
||||
priv->is_k3s = 1;
|
||||
}
|
||||
|
||||
// combination of OM flags determines model
|
||||
if (strstr(buf, "S") && strstr(buf, "4") && strstr(buf, "H"))
|
||||
{
|
||||
// new firmware should recognize k4hd now
|
||||
priv->is_k4 = priv->is_k3 = 0;
|
||||
priv->is_k4hd = 1;
|
||||
}
|
||||
else if (strstr(buf, "S") && strstr(buf, "4"))
|
||||
{
|
||||
priv->is_k4 = priv->is_k3 = 0;
|
||||
priv->is_k4d = 1;
|
||||
}
|
||||
|
||||
if (buf[13] == '0') // then we have a KX3 or KX2
|
||||
{
|
||||
char modelnum;
|
||||
|
@ -200,9 +229,17 @@ int elecraft_open(RIG *rig)
|
|||
|
||||
switch (modelnum)
|
||||
{
|
||||
case '1': model = "KX2"; break;
|
||||
case '1':
|
||||
priv->is_k2 = 0;
|
||||
model = "KX2";
|
||||
priv->is_kx2 = 1;
|
||||
break;
|
||||
|
||||
case '2': model = "KX3"; break;
|
||||
case '2':
|
||||
model = "KX3";
|
||||
priv->is_k3 = 0;
|
||||
priv->is_kx3 = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unknown Elecraft modelnum=%c, expected 1 or 2\n",
|
||||
|
@ -219,8 +256,10 @@ int elecraft_open(RIG *rig)
|
|||
if (strstr(buf, "R")) { model = "K3S"; }
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: model=%s, kpa3%d\n", __func__, model,
|
||||
priv->has_kpa3);
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: model=%s, is_k2=%d, is_k3=%d, is_k3s=%d, is_kx3=%d, is_kx2=%d, is_k4d=%d, is_k4hd=%d, kpa3=%d\n",
|
||||
__func__, model, priv->is_k2, priv->is_k3, priv->is_k3s, priv->is_kx3,
|
||||
priv->is_kx2, priv->is_k4d, priv->is_k4hd, priv->has_kpa3);
|
||||
|
||||
err = elecraft_get_extension_level(rig, "K2", &priv->k2_ext_lvl);
|
||||
|
||||
|
@ -274,6 +313,15 @@ int elecraft_open(RIG *rig)
|
|||
it's not supported */
|
||||
}
|
||||
|
||||
// For rigs like K3X vfo emulation need to set VFO_A to start
|
||||
vfo_t vfo;
|
||||
rig_get_vfo(rig, &vfo);
|
||||
|
||||
if (vfo != RIG_VFO_A && vfo != RIG_VFO_B)
|
||||
{
|
||||
rig_set_vfo(rig, RIG_VFO_A);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -876,6 +876,17 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
|
||||
case RIG_LEVEL_AF:
|
||||
n = sscanf(lvlbuf, "ZZAG%f", &val->f);
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n",
|
||||
__func__, lvlbuf);
|
||||
val->f = 0;
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
val->f /= 100.0;
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_RFPOWER_METER:
|
||||
case RIG_LEVEL_RFPOWER_METER_WATTS:
|
||||
n = sscanf(lvlbuf, "ZZRM5%f", &val->f);
|
||||
|
|
|
@ -290,7 +290,7 @@ int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
|
||||
int err;
|
||||
char f;
|
||||
char f = '*';
|
||||
struct k2_filt_lst_s *flt;
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "elecraft.h"
|
||||
#include "token.h"
|
||||
#include "cal.h"
|
||||
#include "iofunc.h"
|
||||
|
||||
#define K3_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\
|
||||
RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_PKTUSB|\
|
||||
|
@ -142,6 +143,7 @@ static struct kenwood_priv_caps k3_priv_caps =
|
|||
/* K3 specific function declarations */
|
||||
int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
int k3_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
int k3_set_vfo(RIG *rig, vfo_t vfo);
|
||||
int k3_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val);
|
||||
int k3_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val);
|
||||
|
@ -181,7 +183,7 @@ const struct rig_caps k3_caps =
|
|||
RIG_MODEL(RIG_MODEL_K3),
|
||||
.model_name = "K3",
|
||||
.mfg_name = "Elecraft",
|
||||
.version = BACKEND_VER ".3",
|
||||
.version = BACKEND_VER ".10",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -295,7 +297,7 @@ const struct rig_caps k3_caps =
|
|||
.set_mode = k3_set_mode,
|
||||
.get_mode = k3_get_mode,
|
||||
.set_vfo = k3_set_vfo,
|
||||
.get_vfo = kenwood_get_vfo_if,
|
||||
.get_vfo = k3_get_vfo,
|
||||
.set_split_mode = k3_set_split_mode,
|
||||
.get_split_mode = k3_get_split_mode,
|
||||
.set_split_vfo = kenwood_set_split_vfo,
|
||||
|
@ -332,7 +334,7 @@ const struct rig_caps k3s_caps =
|
|||
RIG_MODEL(RIG_MODEL_K3S),
|
||||
.model_name = "K3S",
|
||||
.mfg_name = "Elecraft",
|
||||
.version = BACKEND_VER ".2",
|
||||
.version = BACKEND_VER ".9",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -445,7 +447,7 @@ const struct rig_caps k3s_caps =
|
|||
.set_mode = k3_set_mode,
|
||||
.get_mode = k3_get_mode,
|
||||
.set_vfo = k3_set_vfo,
|
||||
.get_vfo = kenwood_get_vfo_if,
|
||||
.get_vfo = k3_get_vfo,
|
||||
.set_split_mode = k3_set_split_mode,
|
||||
.get_split_mode = k3_get_split_mode,
|
||||
.set_split_vfo = kenwood_set_split_vfo,
|
||||
|
@ -482,9 +484,9 @@ const struct rig_caps k4_caps =
|
|||
RIG_MODEL(RIG_MODEL_K4),
|
||||
.model_name = "K4",
|
||||
.mfg_name = "Elecraft",
|
||||
.version = BACKEND_VER ".2",
|
||||
.version = BACKEND_VER ".9",
|
||||
.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,
|
||||
|
@ -595,7 +597,7 @@ const struct rig_caps k4_caps =
|
|||
.set_mode = k3_set_mode,
|
||||
.get_mode = k3_get_mode,
|
||||
.set_vfo = k3_set_vfo,
|
||||
.get_vfo = kenwood_get_vfo_if,
|
||||
.get_vfo = k3_get_vfo,
|
||||
.set_split_mode = k3_set_split_mode,
|
||||
.get_split_mode = k3_get_split_mode,
|
||||
.set_split_vfo = kenwood_set_split_vfo,
|
||||
|
@ -631,9 +633,9 @@ const struct rig_caps kx3_caps =
|
|||
RIG_MODEL(RIG_MODEL_KX3),
|
||||
.model_name = "KX3",
|
||||
.mfg_name = "Elecraft",
|
||||
.version = BACKEND_VER ".2",
|
||||
.version = BACKEND_VER ".9",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
|
@ -744,7 +746,7 @@ const struct rig_caps kx3_caps =
|
|||
.set_mode = k3_set_mode,
|
||||
.get_mode = k3_get_mode,
|
||||
.set_vfo = k3_set_vfo,
|
||||
.get_vfo = kenwood_get_vfo_if,
|
||||
.get_vfo = k3_get_vfo,
|
||||
.set_split_mode = k3_set_split_mode,
|
||||
.get_split_mode = k3_get_split_mode,
|
||||
.set_split_vfo = kenwood_set_split_vfo,
|
||||
|
@ -780,9 +782,9 @@ const struct rig_caps kx2_caps =
|
|||
RIG_MODEL(RIG_MODEL_KX2),
|
||||
.model_name = "KX2",
|
||||
.mfg_name = "Elecraft",
|
||||
.version = BACKEND_VER ".2",
|
||||
.version = BACKEND_VER ".9",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
|
@ -893,7 +895,7 @@ const struct rig_caps kx2_caps =
|
|||
.set_mode = k3_set_mode,
|
||||
.get_mode = k3_get_mode,
|
||||
.set_vfo = k3_set_vfo,
|
||||
.get_vfo = kenwood_get_vfo_if,
|
||||
.get_vfo = k3_get_vfo,
|
||||
.set_split_mode = k3_set_split_mode,
|
||||
.get_split_mode = k3_get_split_mode,
|
||||
.set_split_vfo = kenwood_set_split_vfo,
|
||||
|
@ -949,6 +951,11 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
err = kenwood_get_mode(rig, vfo, &temp_m, &temp_w);
|
||||
|
||||
if (err != RIG_OK)
|
||||
|
@ -971,11 +978,11 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
{
|
||||
case K3_MODE_DATA_A:
|
||||
case K3_MODE_PSK_D:
|
||||
*mode = RIG_MODE_PKTUSB;
|
||||
*mode = RIG_MODE_PKTLSB;
|
||||
break;
|
||||
|
||||
case K3_MODE_AFSK_A:
|
||||
*mode = RIG_MODE_PKTLSB;
|
||||
*mode = RIG_MODE_PKTUSB;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -998,11 +1005,11 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
{
|
||||
case K3_MODE_DATA_A:
|
||||
case K3_MODE_PSK_D:
|
||||
*mode = RIG_MODE_PKTLSB;
|
||||
*mode = RIG_MODE_PKTUSB;
|
||||
break;
|
||||
|
||||
case K3_MODE_AFSK_A:
|
||||
*mode = RIG_MODE_PKTUSB;
|
||||
*mode = RIG_MODE_PKTLSB;
|
||||
break;
|
||||
|
||||
case K3_MODE_FSK_D:
|
||||
|
@ -1019,7 +1026,14 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
/* The K3 is not limited to specific filter widths so we can query
|
||||
* the actual bandwidth using the BW command
|
||||
*/
|
||||
err = kenwood_safe_transaction(rig, "BW", buf, KENWOOD_MAX_BUF_LEN, 6);
|
||||
if (vfo == RIG_VFO_B)
|
||||
{
|
||||
err = kenwood_safe_transaction(rig, "BW$", buf, KENWOOD_MAX_BUF_LEN, 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = kenwood_safe_transaction(rig, "BW", buf, KENWOOD_MAX_BUF_LEN, 6);
|
||||
}
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
|
@ -1027,7 +1041,14 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return err;
|
||||
}
|
||||
|
||||
*width = atoi(&buf[2]) * 10;
|
||||
if (vfo == RIG_VFO_B)
|
||||
{
|
||||
*width = atoi(&buf[3]) * 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
*width = atoi(&buf[2]) * 10;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -1041,15 +1062,24 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
* The K3 supports AFSK & FSK sub-modes and for the D versions it also
|
||||
* has an internal RTTY and PSK31 decoder. The decoder sub-modes are
|
||||
* reported as FSK (RTTY) and the AFSK sub-modes are reported as
|
||||
* PKT(USB & LSB). LSB modes are assumed to be RTTY and USB modes are
|
||||
* assumed to be PKT(PSK, WS modes etc.).
|
||||
* PKT(USB & LSB). The Submode determines if MD6 starts off in USB
|
||||
* or LSB. To get the reverse of that, you send MD9 and the the submode.
|
||||
* On KX3 it's
|
||||
*
|
||||
* DT0 defaults MD6 to USB
|
||||
* DT1 defaults MD6 to LSB
|
||||
* DT2 defaults MD6 to LSB
|
||||
* DT3 defaults MD6 to USB
|
||||
*
|
||||
* So to inverse that DT0 for LSB, you'd send MD9 then DT0.
|
||||
*
|
||||
* For mode set the data sub-modes are set as follows:
|
||||
*
|
||||
* RTTY -> FSK D normal (LSB) VFO shows MARK QRG
|
||||
* RTTYR -> FSK D reversed (USB) VFO shows MARK QRG
|
||||
* PKTUSB -> DATA A normal (USB) VFO shows suppressed carrier QRG
|
||||
* PKTLSB -> AFSK A normal (LSB) optimised for RTTY VFO shows MARK QRG
|
||||
* PKTUSB = sets the rig to DATA mode submode Data A (DT0)
|
||||
* PKTLSB = sets the rig to DATA REV mode submode Data A (DT0)
|
||||
* RTTY = sets the rig to AFSK A 45 bps rtty (DT1)
|
||||
* RTTYR = sets the rig to FSK D 45 bps rtty (DT2)
|
||||
* PSK = sets the rig to PSK D (DT3)
|
||||
|
||||
* Not all data sub-mode combinations are possible but the above
|
||||
* mapping seems most likely to cover the user requirements.
|
||||
|
@ -1059,41 +1089,87 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
int err;
|
||||
char cmd_m[4];
|
||||
char buf[KENWOOD_MAX_BUF_LEN];
|
||||
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case RIG_MODE_PKTLSB:
|
||||
mode = RIG_MODE_RTTY;
|
||||
case RIG_MODE_PKTLSB:
|
||||
mode = RIG_MODE_RTTY; // in "DT0" Subband RIG_MODE_RTTYR = USB and RIG_MODE_RTTY = LSB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT1"); /* AFSK A mode - AFSK on LSB optimised for RTTY, VFO dial is MARK */
|
||||
"DT0"); /* DATA A mode - DATA (REV) on LSB optimized for HF Packet, VFO dial is suppressed carrier QRG */
|
||||
break;
|
||||
|
||||
case RIG_MODE_PKTUSB:
|
||||
mode = RIG_MODE_RTTY;
|
||||
mode = RIG_MODE_RTTYR; // in "DT0" Subband RIG_MODE_RTTYR = USB and RIG_MODE_RTTY = LSB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT0"); /* DATA A mode - AFSK on USB general, VFO dial is suppressed carrier QRG */
|
||||
"DT0"); /* DATA A mode - DATA on USB general, VFO dial is suppressed carrier QRG */
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTY:
|
||||
mode = RIG_MODE_RTTY; // in "DT1" Subband RIG_MODE_RTTY = LSB and RIG_MODE_RTTYR = USB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT1"); /* FSK D mode - direct FSK on LSB optimized for RTTY, VFO dial is MARK */
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTYR:
|
||||
mode = RIG_MODE_RTTYR; // in "DT2" Subband RIG_MODE_RTTY = LSB and RIG_MODE_RTTYR = USB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT2"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */
|
||||
break;
|
||||
|
||||
case RIG_MODE_PSK:
|
||||
mode = RIG_MODE_PSK; // in "DT3" subband RIG_MODE_PSK = USB # kenwood.c mode but may need kenwwod.c mode table review.
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT3"); /* PSK D Mode - direct PSK keying, USB is "normal", VFO dial is MARK */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* kenwood_set_mode() ignores width value for K2/K3/TS-570 */
|
||||
err = kenwood_set_mode(rig, vfo, mode, width);
|
||||
int kmode;
|
||||
int c;
|
||||
kmode = rmode2kenwood(mode, caps->mode_table);
|
||||
|
||||
if (err != RIG_OK)
|
||||
if (kmode < 0)
|
||||
{
|
||||
return err;
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: unsupported mode '%s'\n",
|
||||
__func__, rig_strrmode(mode));
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
if (kmode <= 9)
|
||||
{
|
||||
c = '0' + kmode;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = 'A' + kmode - 10;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: kmode=%d, cmode=%c\n", __func__, kmode, c)
|
||||
|
||||
if (vfo == RIG_VFO_B)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "MD$%c", c);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "MD%c", c);
|
||||
}
|
||||
|
||||
err = kenwood_transaction(rig, buf, NULL, 0);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE)
|
||||
{
|
||||
char cmd_s[64];
|
||||
|
@ -1108,8 +1184,8 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
*/
|
||||
|
||||
/* passband widths vary by mode so gather lower and upper limits */
|
||||
pbwidth_t pb_nar = rig_passband_narrow(rig, mode);
|
||||
pbwidth_t pb_wid = rig_passband_wide(rig, mode);
|
||||
//pbwidth_t pb_nar = rig_passband_narrow(rig, mode);
|
||||
//pbwidth_t pb_wid = rig_passband_wide(rig, mode);
|
||||
|
||||
if (width < 0)
|
||||
{
|
||||
|
@ -1120,6 +1196,8 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
width = rig_passband_normal(rig, mode);
|
||||
}
|
||||
|
||||
#if 0
|
||||
else if (width < pb_nar)
|
||||
{
|
||||
width = pb_nar;
|
||||
|
@ -1129,7 +1207,30 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
width = pb_wid;
|
||||
}
|
||||
|
||||
snprintf(cmd_s, sizeof(cmd_s), "BW%04ld", width / 10);
|
||||
#endif
|
||||
// width is 50Hz rounded down
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
if (priv->is_k4d || priv->is_k4hd)
|
||||
{
|
||||
width += 9; // rounds to 10Hz
|
||||
}
|
||||
else
|
||||
{
|
||||
width += 49;
|
||||
}
|
||||
|
||||
if (width > 99999) { width = 99999; }
|
||||
|
||||
if (vfo == RIG_VFO_B)
|
||||
{
|
||||
snprintf(cmd_s, sizeof(cmd_s), "BW$%04ld", width / 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(cmd_s, sizeof(cmd_s), "BW%04ld", width / 10);
|
||||
}
|
||||
|
||||
err = kenwood_transaction(rig, cmd_s, NULL, 0);
|
||||
|
||||
if (err != RIG_OK)
|
||||
|
@ -1155,38 +1256,28 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
/* The K3 changes "VFOs" by swapping the contents of
|
||||
* the upper display with the lower display. This function
|
||||
* accomplishes this by sending the emulation command, SWT11;
|
||||
* to the K3 to emulate a tap of the A/B button.
|
||||
/* Elecraft rigs don't really know about swappings vfos.
|
||||
* We just emulate them so rigctl can work correctly.
|
||||
*/
|
||||
|
||||
int k3_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
int err;
|
||||
ENTERFUNC;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
// we emulate vfo selection for Elecraft
|
||||
rig->state.current_vfo = vfo;
|
||||
|
||||
switch (vfo)
|
||||
{
|
||||
case RIG_VFO_B:
|
||||
err = kenwood_transaction(rig, "SWT11", NULL, 0);
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int k3_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
ENTERFUNC;
|
||||
|
||||
*vfo = rig->state.current_vfo;
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
/* Support the RC command for clearing RIT/XIT,
|
||||
*
|
||||
|
@ -1371,23 +1462,35 @@ int k3_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
|
|||
switch (tx_mode)
|
||||
{
|
||||
case RIG_MODE_PKTLSB:
|
||||
tx_mode = RIG_MODE_RTTY;
|
||||
tx_mode = RIG_MODE_RTTY; // in "DT0" Subband RIG_MODE_RTTY = USB and RIG_MODE_RTTYR = LSB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT1"); /* AFSK A mode - AFSK on LSB optimised for RTTY, VFO dial is MARK */
|
||||
"DT0"); /* DATA A mode - DATA (REV) on LSB optimized for HF Packet, VFO dial is suppressed carrier QRG */
|
||||
break;
|
||||
|
||||
case RIG_MODE_PKTUSB:
|
||||
tx_mode = RIG_MODE_RTTY;
|
||||
tx_mode = RIG_MODE_RTTYR; // in "DT0" Subband RIG_MODE_RTTY = USB and RIG_MODE_RTTYR = LSB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT0"); /* DATA A mode - AFSK on USB general, VFO dial is suppressed carrier QRG */
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTY:
|
||||
tx_mode = RIG_MODE_RTTY; // in "DT1" Subband RIG_MODE_RTTY = LSB and RIG_MODE_RTTYR = USB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT1"); /* FSK D mode - direct FSK on LSB optimized for RTTY, VFO dial is MARK */
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTYR:
|
||||
tx_mode = RIG_MODE_RTTYR; // in "DT2" Subband RIG_MODE_RTTY = LSB and RIG_MODE_RTTYR = USB
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT2"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */
|
||||
break;
|
||||
|
||||
case RIG_MODE_PSK:
|
||||
tx_mode = RIG_MODE_PSK;
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT3"); /* PSK D Mode - direct PSK keying, USB is "normal", VFO dial is MARK */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1689,7 +1792,7 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
int i;
|
||||
int foundit = 0;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
|
||||
{
|
||||
if (val.i == rig->state.attenuator[i])
|
||||
{
|
||||
|
@ -1924,7 +2027,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < lvl && i < MAXDBLSTSIZ; i++)
|
||||
for (i = 0; i < lvl && i < HAMLIB_MAXDBLSTSIZ; i++)
|
||||
{
|
||||
if (rig->state.attenuator[i] == 0)
|
||||
{
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -26,8 +26,9 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "token.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define BACKEND_VER "20210209"
|
||||
#define BACKEND_VER "20210309"
|
||||
|
||||
#define EOM_KEN ';'
|
||||
#define EOM_TH '\r'
|
||||
|
@ -133,6 +134,14 @@ struct kenwood_priv_data
|
|||
int has_rit2; /* rig has set 2 rit command */
|
||||
int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/
|
||||
int micgain_min, micgain_max; /* varies by rig so we figure it out automagically */
|
||||
int is_k2;
|
||||
int is_k3;
|
||||
int is_k3s;
|
||||
int is_kx3;
|
||||
int is_kx2;
|
||||
int is_k4;
|
||||
int is_k4d;
|
||||
int is_k4hd;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -843,7 +843,7 @@ int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
int foundit = 0;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
|
||||
{
|
||||
if (val.i == rig->state.attenuator[i])
|
||||
{
|
||||
|
@ -872,7 +872,7 @@ int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
int foundit = 0;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ && rig->state.preamp[i]; i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.preamp[i]; i++)
|
||||
{
|
||||
if (val.i == rig->state.preamp[i])
|
||||
{
|
||||
|
|
|
@ -309,7 +309,7 @@ th_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
kmode = rmode2kenwood(mode, priv->mode_table);
|
||||
|
||||
if (kmode == -1)
|
||||
if (kmode < 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: Unsupported Mode value '%s'\n",
|
||||
__func__, rig_strrmode(mode));
|
||||
|
|
|
@ -1121,7 +1121,7 @@ static int thd72_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
|
||||
static int thd72_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
{
|
||||
int retval, f;
|
||||
int retval, f = -1;
|
||||
char c;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
|
||||
|
|
|
@ -470,7 +470,7 @@ int thd74_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
kmode = rmode2kenwood(mode, priv->mode_table);
|
||||
|
||||
if (kmode == -1)
|
||||
if (kmode < 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: Unsupported Mode value '%s'\n",
|
||||
__func__, rig_strrmode(mode));
|
||||
|
|
|
@ -522,7 +522,7 @@ int thg71_open(RIG *rig)
|
|||
|
||||
strtok(ackbuf, " ");
|
||||
|
||||
for (i = 0; i < FRQRANGESIZ - 1; i++)
|
||||
for (i = 0; i < HAMLIB_FRQRANGESIZ - 1; i++)
|
||||
{
|
||||
freq_range_t frng;
|
||||
char *strl, *stru;
|
||||
|
|
|
@ -1405,7 +1405,7 @@ static int tmd710_find_tuning_step_index(RIG *rig, shortfreq_t ts,
|
|||
{
|
||||
int k, stepind = -1;
|
||||
|
||||
for (k = 0; k < TSLSTSIZ; k++)
|
||||
for (k = 0; k < HAMLIB_TSLSTSIZ; k++)
|
||||
{
|
||||
if ((rig->caps->tuning_steps[k].modes == RIG_MODE_NONE)
|
||||
&& (rig->caps->tuning_steps[k].ts == 0))
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#define TS480_AM_TX_MODES RIG_MODE_AM
|
||||
#define TS480_VFO (RIG_VFO_A|RIG_VFO_B)
|
||||
|
||||
#define TS480_LEVEL_ALL (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC)
|
||||
#define TS480_LEVEL_ALL (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH)
|
||||
#define TS480_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT)
|
||||
#define TS890_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_NB2|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT)
|
||||
|
||||
|
@ -105,6 +105,7 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
char levelbuf[16];
|
||||
int kenwood_val;
|
||||
int rf_max_level = 100; /* 100 for TS-480 and 255 for TS-890S */
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
||||
|
||||
|
@ -114,10 +115,11 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
return kenwood_set_level(rig, vfo, level, val);
|
||||
|
||||
case RIG_LEVEL_AF:
|
||||
priv->ag_format = 2;
|
||||
return kenwood_set_level(rig, vfo, level, val);
|
||||
|
||||
case RIG_LEVEL_RF:
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
rf_max_level = 255;
|
||||
}
|
||||
|
@ -130,7 +132,7 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
case RIG_LEVEL_SQL:
|
||||
kenwood_val = val.f * 255; /* possible values for TS480 are 000.. 255 */
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
sprintf(levelbuf, "SQ%03d", kenwood_val);
|
||||
}
|
||||
|
@ -146,7 +148,7 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
/* hamlib argument is int, possible values rig.h:enum agc_level_e */
|
||||
/* possible values for TS480 000(=off), 001(=fast), 002(=slow) */
|
||||
/* possible values for TS890 0(=off), 1(=slow), 2(=mid), 3(=fast), 4(=off/Last) */
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s TS890S RIG_LEVEL_AGC\n", __func__);
|
||||
|
||||
|
@ -218,7 +220,7 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
|
||||
/*
|
||||
* kenwood_get_level
|
||||
* kenwood_ts480_get_level
|
||||
* Assumes rig!=NULL, val!=NULL
|
||||
*/
|
||||
int
|
||||
|
@ -233,7 +235,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S || RIG_IS_TS480)
|
||||
{
|
||||
rf_max_level = 255;
|
||||
}
|
||||
|
@ -245,7 +247,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
switch (level)
|
||||
{
|
||||
case RIG_LEVEL_AF:
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
retval = kenwood_transaction(rig, "AG", ackbuf, sizeof(ackbuf));
|
||||
offset_level = 2;
|
||||
|
@ -277,6 +279,11 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return RIG_OK;
|
||||
|
||||
case RIG_LEVEL_RF:
|
||||
if (RIG_IS_TS480)
|
||||
{
|
||||
rf_max_level = 100;
|
||||
}
|
||||
|
||||
retval = kenwood_transaction(rig, "RG", ackbuf, sizeof(ackbuf));
|
||||
|
||||
if (RIG_OK != retval)
|
||||
|
@ -300,7 +307,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return RIG_OK;
|
||||
|
||||
case RIG_LEVEL_SQL:
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
retval = kenwood_transaction(rig, "SQ", ackbuf, sizeof(ackbuf));
|
||||
ack_len_expected = 5;
|
||||
|
@ -332,7 +339,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return RIG_OK;
|
||||
|
||||
case RIG_LEVEL_AGC:
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
retval = kenwood_transaction(rig, "GC", ackbuf, sizeof(ackbuf));
|
||||
ack_len_expected = 3;
|
||||
|
@ -362,7 +369,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
|
||||
case '1':
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
val->i = RIG_AGC_SLOW;
|
||||
}
|
||||
|
@ -374,7 +381,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
|
||||
case '2':
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS890S)
|
||||
if (RIG_IS_TS890S)
|
||||
{
|
||||
val->i = RIG_AGC_MEDIUM;
|
||||
}
|
||||
|
@ -399,10 +406,11 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
return RIG_OK;
|
||||
|
||||
case RIG_LEVEL_STRENGTH:
|
||||
case RIG_LEVEL_MICGAIN:
|
||||
case RIG_LEVEL_RFPOWER:
|
||||
return kenwood_get_level(rig, vfo, level, val);
|
||||
|
||||
case RIG_LEVEL_MICGAIN:
|
||||
case RIG_LEVEL_PREAMP:
|
||||
case RIG_LEVEL_IF:
|
||||
case RIG_LEVEL_APF:
|
||||
|
@ -447,7 +455,7 @@ const struct rig_caps ts480_caps =
|
|||
RIG_MODEL(RIG_MODEL_TS480),
|
||||
.model_name = "TS-480",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = BACKEND_VER ".0",
|
||||
.version = BACKEND_VER ".1",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
|
|
@ -352,7 +352,7 @@ ts570_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ; i++)
|
||||
for (i = 0; i < HAMLIB_MAXDBLSTSIZ; i++)
|
||||
if (kenwood_val == rig->state.preamp[i])
|
||||
{
|
||||
sprintf(levelbuf, "PA%01d", i + 1);
|
||||
|
@ -475,7 +475,7 @@ ts570_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < levelint && i < MAXDBLSTSIZ; i++)
|
||||
for (i = 0; i < levelint && i < HAMLIB_MAXDBLSTSIZ; i++)
|
||||
{
|
||||
if (rig->state.preamp[i] == 0)
|
||||
{
|
||||
|
|
|
@ -439,7 +439,7 @@ static int ts870s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < lvl && i < MAXDBLSTSIZ; i++)
|
||||
for (i = 0; i < lvl && i < HAMLIB_MAXDBLSTSIZ; i++)
|
||||
if (rig->state.attenuator[i] == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "ts870s_get_level: "
|
||||
|
|
|
@ -47,16 +47,15 @@
|
|||
#define TS990S_SCAN_OP (RIG_SCAN_VFO)
|
||||
#define TS990S_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
|
||||
|
||||
#define TS990S_STR_CAL {9, {\
|
||||
// Measurements from Wolfgang OE1MWW
|
||||
#define TS990S_STR_CAL {7, {\
|
||||
{0x00, -54},\
|
||||
{0x03, -48},\
|
||||
{0x06, -36},\
|
||||
{0x09, -24},\
|
||||
{0x0C, -12},\
|
||||
{0x0F, 0},\
|
||||
{0x14, 20},\
|
||||
{0x19, 40},\
|
||||
{0x1E, 60}}\
|
||||
{0x04, -48},\
|
||||
{0x0B, -36},\
|
||||
{0x13, -24},\
|
||||
{0x1B, -12},\
|
||||
{0x23, 0},\
|
||||
{0x46, 60}}\
|
||||
}
|
||||
|
||||
/* memory capabilities */
|
||||
|
@ -126,7 +125,7 @@ const struct rig_caps ts990s_caps =
|
|||
RIG_MODEL(RIG_MODEL_TS990S),
|
||||
.model_name = "TS-990s",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = BACKEND_VER ".0",
|
||||
.version = BACKEND_VER ".1",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
|
|
@ -307,7 +307,7 @@ int hiqsdr_init(RIG *rig)
|
|||
priv->split = RIG_SPLIT_OFF;
|
||||
priv->ref_clock = REFCLOCK;
|
||||
priv->sample_rate = DEFAULT_SAMPLE_RATE;
|
||||
strncpy(rig->state.rigport.pathname, "192.168.2.196:48248", FILPATHLEN - 1);
|
||||
strncpy(rig->state.rigport.pathname, "192.168.2.196:48248", HAMLIB_FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ static int miniVNA_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
char cmdstr[40];
|
||||
int retval;
|
||||
|
||||
sprintf_freq(fstr, freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), freq);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called: %s %s\n", __func__,
|
||||
rig_strvfo(vfo), fstr);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
// The rig's PLL only deals with freq in Hz divided by this value
|
||||
#define FREQ_DIV 12500.
|
||||
|
||||
/* V4 commands
|
||||
/* V5 based on V4 commands
|
||||
* retrieved from https://github.com/f4fez/prm80
|
||||
* and https://github.com/f4fez/prm80/blob/master/doc/Computer_commands_V4.md
|
||||
* It used to be from https://sourceforge.net/projects/prm80/
|
||||
|
@ -139,16 +139,11 @@ MessageAide: DB "H",0Dh,0Ah
|
|||
*/
|
||||
|
||||
/*
|
||||
* TODO make read_colon_prompt_and_send() more generic to read
|
||||
* a prompt terminated by "$" (without space afterwards)
|
||||
* Read a prompt terminated by delimiter, then write an optional string s.
|
||||
*/
|
||||
#define read_dollar_prompt_and_send read_colon_prompt_and_send
|
||||
|
||||
/*
|
||||
* Read a prompt terminated by ": ", then write an optional string s.
|
||||
*/
|
||||
static int read_colon_prompt_and_send(hamlib_port_t *rigport,
|
||||
char *data, int *data_len, const char *s)
|
||||
static int read_prompt_and_send(hamlib_port_t *rigport,
|
||||
char *data, int *data_len, const char *s, const char *delimiter,
|
||||
int space_after_delim)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
char spacebuf[4];
|
||||
|
@ -162,7 +157,7 @@ static int read_colon_prompt_and_send(hamlib_port_t *rigport,
|
|||
|
||||
buflen = (data_len == NULL) ? sizeof(buf) : *data_len;
|
||||
|
||||
retval = read_string(rigport, data, buflen, ":", 1);
|
||||
retval = read_string(rigport, data, buflen, delimiter, 1);
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
|
@ -178,11 +173,14 @@ static int read_colon_prompt_and_send(hamlib_port_t *rigport,
|
|||
}
|
||||
|
||||
// Read one (dummy) space character after the colon
|
||||
retval = read_block(rigport, spacebuf, 1);
|
||||
|
||||
if (retval < 0 && retval != -RIG_ETIMEOUT)
|
||||
if (space_after_delim)
|
||||
{
|
||||
return retval;
|
||||
retval = read_block(rigport, spacebuf, 1);
|
||||
|
||||
if (retval < 0 && retval != -RIG_ETIMEOUT)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
// Here is the answer to the prompt
|
||||
|
@ -191,6 +189,25 @@ static int read_colon_prompt_and_send(hamlib_port_t *rigport,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a prompt terminated by ": ", then write an optional string s.
|
||||
*/
|
||||
static int read_colon_prompt_and_send(hamlib_port_t *rigport,
|
||||
char *data, int *data_len, const char *s)
|
||||
{
|
||||
return read_prompt_and_send(rigport, data, data_len, s, ":", 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a prompt terminated by "$" (without space afterwards),
|
||||
* then write an optional string s.
|
||||
*/
|
||||
static int read_dollar_prompt_and_send(hamlib_port_t *rigport,
|
||||
char *data, int *data_len, const char *s)
|
||||
{
|
||||
return read_prompt_and_send(rigport, data, data_len, s, "$", 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* After each executed command, the rig generally sends "\r\n>"
|
||||
*/
|
||||
|
@ -213,7 +230,7 @@ static int prm80_wait_for_prompt(hamlib_port_t *rigport)
|
|||
/*
|
||||
*
|
||||
* \param cmd is string of generally one letter (or digit)
|
||||
* \param arg1 is an optional string string sent
|
||||
* \param arg1 is an optional string to send afterwards
|
||||
* \param wait_prompt boolean when non-nul, will wait for "\r\n>" afterwards
|
||||
*/
|
||||
static int prm80_transaction(RIG *rig, const char *cmd,
|
||||
|
@ -551,33 +568,19 @@ static int hhtoi(const char *p)
|
|||
return (int)strtol(buf, NULL, 16);
|
||||
}
|
||||
|
||||
/*
|
||||
* prm80_get_channel
|
||||
* Assumes rig!=NULL
|
||||
/**
|
||||
* Get system state [E] from rig into \a statebuf
|
||||
*/
|
||||
int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
||||
static int prm80_read_system_state(hamlib_port_t *rigport, char *statebuf)
|
||||
{
|
||||
struct prm80_priv_data *priv = (struct prm80_priv_data *)rig->state.priv;
|
||||
struct rig_state *rs = &rig->state;
|
||||
char statebuf[BUFSZ];
|
||||
char *p;
|
||||
int ret, chanstate, mode_byte, lock_byte;
|
||||
|
||||
if (chan->vfo == RIG_VFO_MEM)
|
||||
{
|
||||
ret = prm80_set_mem(rig, RIG_VFO_CURR, chan->channel_num);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
int ret;
|
||||
|
||||
// Get rid of possible prompt sent by the rig
|
||||
rig_flush(&rs->rigport);
|
||||
rig_flush(rigport);
|
||||
|
||||
/* [E] = Show system state */
|
||||
ret = write_block(&rs->rigport, "E", 1);
|
||||
ret = write_block(rigport, "E", 1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
|
@ -585,7 +588,7 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
}
|
||||
|
||||
// The response length is fixed
|
||||
ret = read_block(&rs->rigport, statebuf, 20);
|
||||
ret = read_block(rigport, statebuf, 20);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
|
@ -610,9 +613,13 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
{
|
||||
int left_to_read = (p - statebuf) + 1;
|
||||
memmove(statebuf, p + 1, 20 - left_to_read);
|
||||
ret = read_block(&rs->rigport, statebuf + 20 - left_to_read, left_to_read);
|
||||
ret = read_block(rigport, statebuf + 20 - left_to_read, left_to_read);
|
||||
|
||||
if (ret >= 0)
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
statebuf[20] = '\0';
|
||||
}
|
||||
|
@ -621,6 +628,38 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
statebuf);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* prm80_get_channel
|
||||
* Assumes rig!=NULL
|
||||
*/
|
||||
int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
||||
{
|
||||
struct prm80_priv_data *priv = (struct prm80_priv_data *)rig->state.priv;
|
||||
struct rig_state *rs = &rig->state;
|
||||
char statebuf[BUFSZ];
|
||||
int ret, chanstate, mode_byte, lock_byte;
|
||||
|
||||
if (chan->vfo == RIG_VFO_MEM)
|
||||
{
|
||||
ret = prm80_set_mem(rig, RIG_VFO_CURR, chan->channel_num);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = prm80_read_system_state(&rs->rigport, statebuf);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* (Mode-Chan-Chanstate-Sql-Vol-Lock-RX freq-TX freq). */
|
||||
/* Examples: 1240080AFF0033F02D40 or 14000C00FD0079708020 */
|
||||
|
||||
|
@ -654,10 +693,12 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
chan->levels[LVL_AF].f = ((float)(hhtoi(statebuf + 8) >> 4)) / 15.;
|
||||
chan->levels[LVL_RFPOWER].f = (mode_byte & 0x02) ? 1.0 : 0.0;
|
||||
|
||||
chan->funcs = 0;
|
||||
chan->funcs |= (chanstate & 0x02) ? RIG_FUNC_REV : 0;
|
||||
|
||||
lock_byte = hhtoi(statebuf + 10) & 0x0f;
|
||||
chan->funcs = (lock_byte != 0) ? RIG_FUNC_LOCK : 0;
|
||||
chan->funcs |= (lock_byte & 0x05) ? RIG_FUNC_LOCK : 0;
|
||||
chan->funcs |= (lock_byte & 0x08) ? RIG_FUNC_MUTE : 0;
|
||||
|
||||
chan->freq = ((hhtoi(statebuf + 12) << 8) + hhtoi(statebuf + 14)) * FREQ_DIV +
|
||||
RX_IF_OFFSET;
|
||||
|
@ -715,9 +756,8 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
PLL value to load : $8020
|
||||
Channel state : $00
|
||||
|
||||
TODO: handle the possible query from the rig:
|
||||
Possibly:
|
||||
"This channel number doesn't exist. Add new channel (Y/N) ? "
|
||||
TODO implement correctly read_dollar_prompt_and_send (dollar prompt)
|
||||
*/
|
||||
|
||||
sprintf(buf, "%02u", (unsigned)chan->channel_num);
|
||||
|
@ -729,8 +769,10 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Set the RX frequency as PLL word
|
||||
// Set the RX frequency as PLL word.
|
||||
sprintf(buf, "%04X", (unsigned)((chan->freq - RX_IF_OFFSET) / FREQ_DIV));
|
||||
|
||||
// "PLL value to load : $"
|
||||
ret = read_dollar_prompt_and_send(&rs->rigport, NULL, NULL, buf);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
|
@ -753,6 +795,8 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
chanstate |= (chan->flags & RIG_CHFLAG_SKIP) ? 0x08 : 0;
|
||||
|
||||
sprintf(buf, "%02X", chanstate);
|
||||
|
||||
// "Channel state : $"
|
||||
ret = read_dollar_prompt_and_send(&rs->rigport, NULL, NULL, buf);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
|
@ -760,6 +804,43 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Determine if prompt came back (CRLF'>') or have to
|
||||
// handle the possible query from the rig:
|
||||
// "This channel number doesn't exist. Add new channel (Y/N) ? "
|
||||
ret = read_block(&rs->rigport, buf, 3);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
}
|
||||
|
||||
if (ret == 3 && buf[2] == 'T')
|
||||
{
|
||||
// Read the question
|
||||
ret = read_string(&rs->rigport, buf, sizeof(buf), "?", 1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
}
|
||||
|
||||
// Read extra space
|
||||
ret = read_block(&rs->rigport, buf, 1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
}
|
||||
|
||||
// Send confirmation
|
||||
ret = write_block(&rs->rigport, "Y", 1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
}
|
||||
}
|
||||
|
||||
prm80_wait_for_prompt(&rs->rigport);
|
||||
}
|
||||
else
|
||||
|
@ -805,7 +886,8 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
|
||||
#endif
|
||||
|
||||
ret = prm80_set_func(rig, vfo, RIG_FUNC_LOCK, chan->funcs & RIG_FUNC_LOCK);
|
||||
ret = prm80_set_func(rig, vfo, RIG_FUNC_LOCK,
|
||||
!!(chan->funcs & RIG_FUNC_LOCK));
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
|
@ -817,15 +899,21 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
}
|
||||
|
||||
|
||||
// TODO FUNC_REV ?
|
||||
// TODO FUNC_REV through Channel state byte ?
|
||||
// TODO "Read-Modify-Write" (or shadowing in priv area) of the lock bits
|
||||
int prm80_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (func & RIG_FUNC_LOCK)
|
||||
{
|
||||
/* Lock keys/TX/Vol */
|
||||
ret = prm80_transaction(rig, "K", (status != 0) ? "03" : "00", 1);
|
||||
/* Lock keys(b0)/Vol(b2) */
|
||||
ret = prm80_transaction(rig, "K", (status != 0) ? "05" : "00", 1);
|
||||
}
|
||||
else if (func & RIG_FUNC_MUTE)
|
||||
{
|
||||
/* Lock RX(b3) */
|
||||
ret = prm80_transaction(rig, "K", (status != 0) ? "08" : "00", 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -850,7 +938,7 @@ int prm80_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
return ret;
|
||||
}
|
||||
|
||||
*status = (chan.funcs & func);
|
||||
*status = !!(chan.funcs & func);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -862,6 +950,7 @@ int prm80_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
int prm80_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
int ret, mode_byte;
|
||||
|
||||
// do some clamping, all levels are float values.
|
||||
if (val.f < 0.0)
|
||||
|
@ -886,19 +975,28 @@ int prm80_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
return prm80_transaction(rig, "F", buf, 1);
|
||||
|
||||
case RIG_LEVEL_RFPOWER:
|
||||
// TODO : modify the Mode byte b1 ?
|
||||
#if 0
|
||||
/* Current mode:
|
||||
; b0: Squelch b1: power
|
||||
; b2: Squelch open b3: TX
|
||||
; b4: PLL locked b5: Long press memorize
|
||||
; b6: Debouncing in effect b7: LCD refresh
|
||||
*/
|
||||
// TODO perform a "Read-Modify-Write" of the mode_byte
|
||||
mode_byte = 0x10;
|
||||
mode_byte |= (chan->levels[LVL_RFPOWER].f == 0.) ? 0 : 0x02;
|
||||
#endif
|
||||
return -RIG_ENIMPL;
|
||||
// Perform a "Read-Modify-Write" of the mode_byte
|
||||
ret = prm80_read_system_state(&rig->state.rigport, buf);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
prm80_wait_for_prompt(&rig->state.rigport);
|
||||
|
||||
mode_byte = hhtoi(buf);
|
||||
mode_byte &= ~0x02;
|
||||
mode_byte |= (val.f == 0.) ? 0 : 0x02;
|
||||
sprintf(buf, "%02X", (unsigned)mode_byte);
|
||||
|
||||
return prm80_transaction(rig, "D", buf, 1);
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unsupported set_level %s\n", __func__,
|
||||
|
@ -909,6 +1007,110 @@ int prm80_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
#ifdef V4_ONLY
|
||||
/*
|
||||
* get_level RIG_LEVEL_RAWSTR
|
||||
*/
|
||||
static int prm80_get_rawstr_RAM(RIG *rig, value_t *val)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
struct rig_state *rs = &rig->state;
|
||||
int ret, i;
|
||||
|
||||
/* [U] = Print 80c552 internal RAM. */
|
||||
|
||||
// Send cmd, Wait for colon prompt, but then send nothing
|
||||
ret = prm80_transaction(rig, "U", "", 0);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Read CRLF
|
||||
ret = read_string(&rs->rigport, buf, BUFSZ, "\n", 1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
// (16 lines of 16 bytes each)
|
||||
|
||||
// According to prm.a51, the rssi_hold variable is in RAM at RAM+35.
|
||||
// The RAM base is at 030h.
|
||||
|
||||
#define RSSI_HOLD_ADDR (0x30 + 35) // = 0x53
|
||||
|
||||
for (i = 0; i < (RSSI_HOLD_ADDR / 16) + 1; i++)
|
||||
{
|
||||
ret = read_string(&rs->rigport, buf, BUFSZ, "\n", 1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
// A line looks like this
|
||||
// "$50 : 00 01 02 53 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f\r\n"
|
||||
|
||||
val->i = hhtoi(buf + 6 + 3 * (RSSI_HOLD_ADDR % 16));
|
||||
|
||||
// discard the remaining content of RAM print
|
||||
for (i = 0; i < (16 - RSSI_HOLD_ADDR / 16) - 1; i++)
|
||||
{
|
||||
read_string(&rs->rigport, buf, BUFSZ, "\n", 1);
|
||||
}
|
||||
|
||||
prm80_wait_for_prompt(&rs->rigport);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* get_level RIG_LEVEL_RAWSTR
|
||||
*
|
||||
* NB : requires a V5 firmware!
|
||||
*/
|
||||
static int prm80_get_rawstr(RIG *rig, value_t *val)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
struct rig_state *rs = &rig->state;
|
||||
int ret;
|
||||
|
||||
// Get rid of possible prompt sent by the rig
|
||||
rig_flush(&rs->rigport);
|
||||
|
||||
/* [A] = RSSI */
|
||||
ret = write_block(&rs->rigport, "A", 1);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
}
|
||||
|
||||
// The response length is fixed
|
||||
ret = read_block(&rs->rigport, buf, 4);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ret >= 0)
|
||||
{
|
||||
buf[ret] = '\0';
|
||||
}
|
||||
|
||||
val->i = hhtoi(buf);
|
||||
|
||||
prm80_wait_for_prompt(&rs->rigport);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* prm80_get_level
|
||||
* Assumes rig!=NULL
|
||||
|
@ -918,6 +1120,12 @@ int prm80_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
int ret;
|
||||
channel_t chan;
|
||||
|
||||
// Get rawstr apart, it is not read from system state
|
||||
if (level == RIG_LEVEL_RAWSTR)
|
||||
{
|
||||
return prm80_get_rawstr(rig, val);
|
||||
}
|
||||
|
||||
memset(&chan, 0, sizeof(chan));
|
||||
chan.vfo = RIG_VFO_CURR;
|
||||
|
||||
|
@ -954,6 +1162,52 @@ int prm80_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
int prm80_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
{
|
||||
char statebuf[BUFSZ];
|
||||
int ret, mode_byte;
|
||||
|
||||
// TODO use command 'A' which is faster, but not in V4
|
||||
ret = prm80_read_system_state(&rig->state.rigport, statebuf);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
mode_byte = hhtoi(statebuf);
|
||||
|
||||
// TX mode on?
|
||||
*ptt = (mode_byte & 0x08) ? RIG_PTT_ON : RIG_PTT_OFF;
|
||||
|
||||
prm80_wait_for_prompt(&rig->state.rigport);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
int prm80_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
||||
{
|
||||
char statebuf[BUFSZ];
|
||||
int ret, mode_byte;
|
||||
|
||||
// TODO use command 'A' which is faster, but not in V4
|
||||
ret = prm80_read_system_state(&rig->state.rigport, statebuf);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
mode_byte = hhtoi(statebuf);
|
||||
|
||||
// Squelch open?
|
||||
*dcd = (mode_byte & 0x04) ? RIG_DCD_ON : RIG_DCD_OFF;
|
||||
|
||||
prm80_wait_for_prompt(&rig->state.rigport);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
// TODO vfo_op : MCL FROM_VFO ..
|
||||
|
||||
/*
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <hamlib/rig.h>
|
||||
|
||||
#define BACKEND_VER "20210217"
|
||||
#define BACKEND_VER "20210306"
|
||||
|
||||
#define PRM80_MEM_CAP { \
|
||||
.freq = 1, \
|
||||
|
@ -57,6 +57,8 @@ 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, vfo_t vfo, const channel_t *chan);
|
||||
int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
|
||||
int prm80_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
|
||||
int prm80_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
|
||||
const char *prm80_get_info(RIG *rig);
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
#define PRM8060_ALL_MODES (RIG_MODE_FM)
|
||||
|
||||
#define PRM8060_FUNC (RIG_FUNC_REV|RIG_FUNC_LOCK)
|
||||
#define PRM8060_FUNC (RIG_FUNC_REV|RIG_FUNC_LOCK|RIG_FUNC_MUTE)
|
||||
|
||||
#define PRM8060_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_SQL /* |RIG_LEVEL_RFPOWER */)
|
||||
#define PRM8060_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_SQL|RIG_LEVEL_RFPOWER)
|
||||
|
||||
#define PRM8060_PARM_ALL (RIG_PARM_NONE)
|
||||
|
||||
|
@ -44,6 +44,26 @@
|
|||
|
||||
#define PRM8060_VFO (RIG_VFO_MEM)
|
||||
|
||||
// Calibration done on PRM8070
|
||||
#define PRM8060_STR_CAL { 15, \
|
||||
{ \
|
||||
{ 0x14, -54 }, /* S0 */ \
|
||||
{ 0x1D, -48 }, /* S1 */ \
|
||||
{ 0x26, -42 }, /* S2 */ \
|
||||
{ 0x33, -36 }, /* S3 */ \
|
||||
{ 0x3F, -30 }, /* S4 */ \
|
||||
{ 0x4D, -24 }, /* S5 */ \
|
||||
{ 0x55, -18 }, /* S6 */ \
|
||||
{ 0x61, -12 }, /* S7 */ \
|
||||
{ 0x68, -6 }, /* S8 */ \
|
||||
{ 0x6C, 0 }, /* S9 */ \
|
||||
{ 0x81, 10 }, /* +10 */ \
|
||||
{ 0x8B, 20 }, /* +20 */ \
|
||||
{ 0x8C, 40 }, /* +40 */ \
|
||||
{ 0x8C, 50 }, /* +50 */ \
|
||||
{ 0xFF, 60 } /* +60 */ \
|
||||
} }
|
||||
|
||||
/*
|
||||
* PRM 8060 rig capabilities.
|
||||
* http://prm80.sourceforge.net/
|
||||
|
@ -58,8 +78,8 @@ const struct rig_caps prm8060_caps =
|
|||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.ptt_type = RIG_PTT_NONE,
|
||||
.dcd_type = RIG_DCD_NONE,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 4800,
|
||||
.serial_rate_max = 4800,
|
||||
|
@ -74,7 +94,7 @@ const struct rig_caps prm8060_caps =
|
|||
|
||||
.has_get_func = PRM8060_FUNC,
|
||||
.has_set_func = PRM8060_FUNC,
|
||||
.has_get_level = PRM8060_LEVEL_ALL | RIG_LEVEL_RFPOWER,
|
||||
.has_get_level = PRM8060_LEVEL_ALL | RIG_LEVEL_RAWSTR,
|
||||
.has_set_level = RIG_LEVEL_SET(PRM8060_LEVEL_ALL),
|
||||
.has_get_parm = PRM8060_PARM_ALL,
|
||||
.has_set_parm = RIG_PARM_SET(PRM8060_PARM_ALL),
|
||||
|
@ -120,6 +140,8 @@ const struct rig_caps prm8060_caps =
|
|||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.str_cal = PRM8060_STR_CAL,
|
||||
|
||||
.rig_init = prm80_init,
|
||||
.rig_cleanup = prm80_cleanup,
|
||||
.get_mode = prm80_get_mode,
|
||||
|
@ -138,6 +160,8 @@ const struct rig_caps prm8060_caps =
|
|||
.set_level = prm80_set_level,
|
||||
.get_level = prm80_get_level,
|
||||
.reset = prm80_reset,
|
||||
.get_dcd = prm80_get_dcd,
|
||||
.get_ptt = prm80_get_ptt,
|
||||
.get_info = prm80_get_info,
|
||||
|
||||
};
|
||||
|
|
|
@ -0,0 +1,252 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# This file is part of Hamlib
|
||||
# (C) 2021 Stephane Fillod
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3
|
||||
|
||||
"""
|
||||
Protocol simulator of PRM80xx running firmware V5.
|
||||
This script needs a POSIX system to run.
|
||||
|
||||
On one terminal, start this script:
|
||||
$ ./pysimulprm80.py -l /tmp/prm80simul
|
||||
Slave name /dev/pts/5
|
||||
Name symlinked /tmp/prm80simul
|
||||
...
|
||||
On another terminal, test the prm80 backend:
|
||||
$ rigctl -vvvvvv -r /tmp/prm80simul -m 28001
|
||||
"""
|
||||
# Implementation from
|
||||
# - https://github.com/f4fez/prm80/blob/master/doc/Computer_commands_V4.md
|
||||
# - https://github.com/f4fez/prm80/blob/master/doc/Computer_control.md
|
||||
# - https://sourceforge.net/p/hamlib/discussion/25919/thread/93afa09f52/
|
||||
# - https://github.com/f4fez/prm80/blob/master/src/inc_ser.a51
|
||||
|
||||
import argparse
|
||||
import time
|
||||
import os, pty, tty, termios
|
||||
|
||||
class Prm80Simul:
|
||||
|
||||
def __init__(self, pty_r, pty_w):
|
||||
self.pty_r = pty_r
|
||||
self.pty_w = pty_w
|
||||
self.SetupPseudoSerial(self.pty_r)
|
||||
self.SetupPseudoSerial(self.pty_w)
|
||||
|
||||
self.msg_version = "PRM8060 V5.0 430"
|
||||
|
||||
self.mdict = {
|
||||
'V' : self.tch_Version,
|
||||
'N' : self.tch_Nmem,
|
||||
'K' : self.tch_Klock,
|
||||
'F' : self.tch_Fsquelch,
|
||||
'O' : self.tch_Ovolume,
|
||||
'D' : self.tch_Dmode,
|
||||
'T' : self.tch_Tstate,
|
||||
'U' : self.tch_UprintRAM,
|
||||
'P' : self.tch_Peditchannel,
|
||||
'Q' : self.tch_Qmaxchan,
|
||||
'C' : self.tch_Chanlist,
|
||||
'R' : self.tch_Rfreq,
|
||||
'E' : self.tch_Estate,
|
||||
'A' : self.tch_Astatus,
|
||||
'#' : self.tch_diese,
|
||||
'*' : self.tch_autre,
|
||||
}
|
||||
# Some live data simulated inside the rig
|
||||
self.ChanNum = 0
|
||||
self.LockByte = 0
|
||||
self.Squelch = 0
|
||||
self.Volume = 0xff
|
||||
self.ModeByte = 0x16
|
||||
self.ChanState = 0x0c
|
||||
self.MaxChan = 80
|
||||
self.RxPLL = 0x7970 # 410 MHz (w/ IF offset)
|
||||
self.TxPLL = 0x8020 # 410 MHz
|
||||
|
||||
def SetupPseudoSerial(self, fd):
|
||||
""" make it raw, at 4800 bauds (defaults to 8N1) """
|
||||
tty.setraw(fd)
|
||||
term_settings = termios.tcgetattr(fd)
|
||||
term_settings[4] = termios.B4800 # ispeed
|
||||
term_settings[5] = termios.B4800 # ospeed
|
||||
termios.tcsetattr(fd, termios.TCSANOW, term_settings)
|
||||
|
||||
def pty_write(self, a):
|
||||
""" helper write+flush """
|
||||
self.pty_w.write(a)
|
||||
self.flush_w()
|
||||
|
||||
|
||||
def tch_autre(self):
|
||||
""" Unknown command """
|
||||
self.pty_write(b'* ?')
|
||||
|
||||
def tch_Version(self):
|
||||
""" Print firmware version """
|
||||
self.pty_write(self.msg_version.encode())
|
||||
|
||||
def tch_Nmem(self):
|
||||
""" Set current channel """
|
||||
self.pty_write(b'Channel : ')
|
||||
self.ChanNum = int(pty_r.read(2).decode('ascii'))
|
||||
|
||||
def tch_Klock(self):
|
||||
""" Set lock byte """
|
||||
self.pty_write(b'Lock : ')
|
||||
self.LockByte = int(pty_r.read(2).decode('ascii'), 16)
|
||||
|
||||
def tch_Fsquelch(self):
|
||||
""" Set squelch. """
|
||||
self.pty_write(b'Squelch : ')
|
||||
self.Squelch = int(pty_r.read(2).decode('ascii'))
|
||||
|
||||
def tch_Ovolume(self):
|
||||
""" Set volume. """
|
||||
self.pty_write(b'Volume : ')
|
||||
self.Volume = int(pty_r.read(2).decode('ascii'))
|
||||
|
||||
def tch_Dmode(self):
|
||||
""" Set "Mode" byte. """
|
||||
self.pty_write(b'Mode : ')
|
||||
self.ModeByte = int(pty_r.read(2).decode('ascii'), 16)
|
||||
|
||||
def tch_Tstate(self):
|
||||
""" Set Channel State. """
|
||||
self.pty_write(b'Channel state : $')
|
||||
self.ChanState = int(pty_r.read(2).decode('ascii'))
|
||||
|
||||
def tch_UprintRAM(self):
|
||||
""" Print 80c552 internal RAM. """
|
||||
self.pty_w.write(b'Display the 256 bytes from internal RAM : \r\n')
|
||||
# 16 lines of 16 bytes each. The command needs about 3 sec.
|
||||
# In V4, rssi_hold is at 0x53
|
||||
self.pty_w.write(b'$00 : 00 00 00 D5 09 00 00 0F 7F 99 D2 7D B2 93 8F C5\r\n')
|
||||
self.pty_w.write(b'$10 : 60 8B 43 CA 31 43 BB BA F9 27 87 47 06 52 BE 55\r\n')
|
||||
self.pty_w.write(b'$20 : 81 2F FD 17 01 12 A3 00 13 02 34 96 0B 04 54 7A\r\n')
|
||||
self.pty_w.write(b'$30 : 13 03 00 30 B4 00 03 00 FC 58 71 00 0F 08 08 82\r\n')
|
||||
self.pty_w.write(b'$40 : 9E 86 EE 60 1F 1F 00 FB FF FF 44 55 FF 73 5A F5\r\n')
|
||||
self.pty_w.write(b'$50 : 7E 02 06 72 B7 FF 8D B1 92 79 93 8D 3E 4E 8E 06\r\n')
|
||||
self.pty_w.write(b'$60 : DB C7 3D 11 AE 5A 4F 3D 80 82 D1 8A 88 6C 7B E5\r\n')
|
||||
self.pty_w.write(b'$70 : 2F 98 4C 72 5B A4 78 5C 7D 45 46 8C 25 23 BB 82\r\n')
|
||||
self.pty_w.write(b'$80 : 60 1E 2F 42 28 38 E3 7D 94 BC CA B4 B1 43 AE 84\r\n')
|
||||
self.pty_w.write(b'$90 : 81 88 75 1A 2D 93 7E E8 CF 79 B6 E0 0F 31 AD AA\r\n')
|
||||
self.pty_w.write(b'$A0 : 4F 1C 0F 12 55 00 24 13 08 D2 0E C0 00 20 AF 0E\r\n')
|
||||
self.pty_w.write(b'$B0 : 40 FF 40 00 B8 00 0F 0F B8 0F 10 B8 0F 14 10 FC\r\n')
|
||||
self.pty_w.write(b'$C0 : 08 E8 D8 3F 33 20 D9 50 8F 1A A2 FF CC D4 2E 3A\r\n')
|
||||
self.pty_w.write(b'$D0 : 12 22 B7 23 2F 8F 64 47 99 21 6C D8 B4 B0 C3 51\r\n')
|
||||
self.pty_w.write(b'$E0 : 90 E8 67 5C 18 5E AB 2D BD 71 52 0F 96 6F DA 56\r\n')
|
||||
self.pty_w.write(b'$F0 : 1D E1 08 42 C2 2D 3B C7 87 23 88 E3 1A 95 F1 EE\r\n')
|
||||
self.flush_w()
|
||||
|
||||
def tch_Qmaxchan(self):
|
||||
""" Set channels number. """
|
||||
self.pty_write(b'Channels number (00 to 99) : ')
|
||||
self.MaxChan = int(pty_r.read(2).decode('ascii'))
|
||||
# This command gets an extra CRLF ??!
|
||||
self.pty_write(b'\r\n')
|
||||
|
||||
def tch_Peditchannel(self):
|
||||
""" Edit/Add channel """
|
||||
# TODO keep edited channel content in the class
|
||||
self.pty_write(b'Channel to set : ')
|
||||
chan_num = int(pty_r.read(2).decode('ascii'))
|
||||
self.pty_write(b'\r\n')
|
||||
|
||||
# NB: here prompts end with '$'
|
||||
self.pty_write(b'PLL value to load : $')
|
||||
pll_freq_value = int(pty_r.read(4).decode('ascii'), 16)
|
||||
self.pty_write(b'\r\n')
|
||||
|
||||
self.pty_write(b'Channel state : $')
|
||||
chan_state = int(pty_r.read(2).decode('ascii'), 16)
|
||||
self.pty_write(b'\r\n')
|
||||
|
||||
# for higher channels, allow to test this scenario
|
||||
if chan_num > self.MaxChan and chan_num != 99:
|
||||
self.pty_write(b'This channel number doesn\'t exist. Add new channel (Y/N) ? ')
|
||||
# response "Y/N"
|
||||
yesno = pty_r.read(1).decode('ascii')
|
||||
self.pty_write(b'\r\n')
|
||||
|
||||
def tch_Estate(self):
|
||||
""" Show system state (Mode-Chan-Chanstate-Sql-Vol-Lock-RX freq-TX freq) """
|
||||
#self.pty_write(b'16000C00FF0079708020')
|
||||
self.pty_write('{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}{:04X}{:04X}'.format(
|
||||
self.ModeByte,
|
||||
self.ChanNum,
|
||||
self.ChanState,
|
||||
self.Squelch,
|
||||
self.Volume,
|
||||
self.LockByte,
|
||||
self.RxPLL,
|
||||
self.TxPLL
|
||||
).encode())
|
||||
|
||||
def tch_Astatus(self):
|
||||
""" Print value of RSSI, squelch and transmit status. V5. """
|
||||
self.pty_write(b'1801')
|
||||
|
||||
def tch_Chanlist(self):
|
||||
""" Print channels list """
|
||||
self.pty_write(b'Channels list :\r\n00 : 8464 84\r\n01 : 81B0 00\r\n02 : 8464 0C')
|
||||
|
||||
def tch_Rfreq(self):
|
||||
""" Set synthetiser frequencies """
|
||||
self.pty_write(b'RX frequency : ')
|
||||
self.RxPLL = int(pty_r.read(4).decode('ascii'), 16)
|
||||
|
||||
self.pty_write(b'\r\nTX frequency : ')
|
||||
self.TxPLL = int(pty_r.read(4).decode('ascii'), 16)
|
||||
|
||||
def tch_diese(self):
|
||||
""" Ping """
|
||||
self.pty_write(b'!')
|
||||
|
||||
def exec_cmd(self,cmd):
|
||||
default='*'
|
||||
self.mdict.get(cmd.upper(),default)() # get() method returns the function matching the argument
|
||||
|
||||
self.pty_write(b'\r\n>')
|
||||
|
||||
def flush_w(self):
|
||||
self.pty_w.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
master, slave = pty.openpty()
|
||||
s_name = os.ttyname(slave)
|
||||
m_name = os.ttyname(master)
|
||||
pty_r = os.fdopen(master, "rb")
|
||||
pty_w = os.fdopen(master, "wb")
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-l", "--symlink",
|
||||
help="make a symlink with the opened pty",
|
||||
type=str,
|
||||
dest='symlink')
|
||||
options = parser.parse_args()
|
||||
|
||||
print ("Slave name ", s_name)
|
||||
|
||||
# Create a symlink
|
||||
if options.symlink:
|
||||
if os.access(options.symlink, os.F_OK, follow_symlinks=False):
|
||||
os.remove(options.symlink)
|
||||
os.symlink(s_name, options.symlink)
|
||||
print ("Name symlinked ", options.symlink)
|
||||
|
||||
|
||||
prm80 = Prm80Simul(pty_r, pty_w)
|
||||
|
||||
while True:
|
||||
cmd = pty_r.read(1).decode('ascii')
|
||||
print ("Received command ["+cmd+"]")
|
||||
|
||||
prm80.exec_cmd(cmd)
|
||||
|
||||
print ("Restart mainloop")
|
||||
|
|
@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := esmc.c eb200.c rs.c xk2000.c gp2000.c
|
||||
LOCAL_SRC_FILES := esmc.c eb200.c rs.c xk2100.c gp2000.c
|
||||
LOCAL_MODULE := rs
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
|
|
|
@ -302,21 +302,21 @@ int cu_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
char cmd;
|
||||
char *cmd;
|
||||
int ret;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case RIG_MODE_USB: cmd = 'X'; break;
|
||||
case RIG_MODE_USB: cmd = "X"; break;
|
||||
|
||||
case RIG_MODE_LSB: cmd = 'Y'; break;
|
||||
case RIG_MODE_LSB: cmd = "Y"; break;
|
||||
|
||||
case RIG_MODE_AM: cmd = 'Z'; break;
|
||||
case RIG_MODE_AM: cmd = "Z"; break;
|
||||
|
||||
case RIG_MODE_RTTY: cmd = '['; break;
|
||||
case RIG_MODE_RTTY: cmd = "["; break;
|
||||
|
||||
/* case RIG_MODE_R3E: cmd = '\\'; break; */
|
||||
case RIG_MODE_CW: cmd = ']'; break;
|
||||
/* case RIG_MODE_R3E: cmd = "\\"; break; */
|
||||
case RIG_MODE_CW: cmd = "]"; break;
|
||||
|
||||
/* case RIG_MODE_MCW: cmd = '^'; break; */
|
||||
|
||||
|
@ -324,7 +324,7 @@ int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
ret = cu_transaction(rig, &cmd, 1);
|
||||
ret = cu_transaction(rig, cmd, 1);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
{
|
||||
|
@ -340,18 +340,18 @@ int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
if (width < rig_passband_normal(rig, mode))
|
||||
{
|
||||
cmd = 'D';
|
||||
cmd = "D";
|
||||
}
|
||||
else if (width > rig_passband_normal(rig, mode))
|
||||
{
|
||||
cmd = 'B';
|
||||
cmd = "B";
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd = 'C';
|
||||
cmd = "C";
|
||||
}
|
||||
|
||||
return cu_transaction(rig, &cmd, 1);
|
||||
return cu_transaction(rig, cmd, 1);
|
||||
}
|
||||
|
||||
int cu_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
|
@ -480,11 +480,11 @@ int cu_set_parm(RIG *rig, setting_t parm, value_t val)
|
|||
|
||||
int cu_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
{
|
||||
char cmd;
|
||||
char *cmd;
|
||||
|
||||
cmd = ptt == RIG_PTT_ON ? 'u' : 'v';
|
||||
cmd = ptt == RIG_PTT_ON ? "u" : "v";
|
||||
|
||||
return cu_transaction(rig, &cmd, 1);
|
||||
return cu_transaction(rig, cmd, 1);
|
||||
}
|
||||
|
||||
static int cu_set_mem(RIG *rig, vfo_t vfo, int ch)
|
||||
|
|
|
@ -260,7 +260,7 @@ static int tt588_rxFilter[] =
|
|||
static int tt588_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
|
||||
int *data_len)
|
||||
{
|
||||
int i, retval;
|
||||
int i, retval = -RIG_EINTERNAL;
|
||||
struct rig_state *rs = &rig->state;
|
||||
|
||||
// The original file had "A few XX's" due to sync problems
|
||||
|
|
|
@ -379,7 +379,7 @@ int tt565_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
*/
|
||||
in_range = FALSE;
|
||||
|
||||
for (i = 0; i < FRQRANGESIZ; i++)
|
||||
for (i = 0; i < HAMLIB_FRQRANGESIZ; i++)
|
||||
{
|
||||
this_range = rig->state.rx_range_list[i];
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
char ttmode;
|
||||
rmode_t saved_mode;
|
||||
pbwidth_t saved_width;
|
||||
int mdbuf_len, ttfilter, retval;
|
||||
int mdbuf_len, ttfilter = -1, retval;
|
||||
char mdbuf[32];
|
||||
|
||||
switch (mode)
|
||||
|
|
|
@ -697,7 +697,7 @@ tt550_set_rx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
char ttmode;
|
||||
rmode_t saved_mode;
|
||||
pbwidth_t saved_width;
|
||||
int mdbuf_len, ttfilter, retval;
|
||||
int mdbuf_len, ttfilter = -1, retval;
|
||||
char mdbuf[48];
|
||||
|
||||
/*
|
||||
|
@ -812,7 +812,7 @@ tt550_set_tx_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
char ttmode;
|
||||
rmode_t saved_mode;
|
||||
pbwidth_t saved_width;
|
||||
int mdbuf_len, ttfilter, retval;
|
||||
int mdbuf_len, ttfilter = -1, retval;
|
||||
char mdbuf[48];
|
||||
|
||||
switch (mode)
|
||||
|
|
|
@ -159,7 +159,7 @@ const struct rig_caps v4l_caps =
|
|||
int v4l_init(RIG *rig)
|
||||
{
|
||||
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L_PATH, FILPATHLEN - 1);
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L_PATH, HAMLIB_FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ const struct rig_caps v4l2_caps =
|
|||
int v4l2_init(RIG *rig)
|
||||
{
|
||||
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L2_PATH, FILPATHLEN - 1);
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L2_PATH, HAMLIB_FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
int wr_rig_init(RIG *rig)
|
||||
{
|
||||
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_WINRADIO_PATH, FILPATHLEN - 1);
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_WINRADIO_PATH, HAMLIB_FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -7,12 +7,14 @@ LOCAL_SRC_FILES := ft100.c ft747.c ft817.c ft847.c ft890.c ft900.c ft920.c \
|
|||
ft757gx.c ft736.c frg100.c frg9600.c ft1000d.c \
|
||||
vr5000.c ft767gx.c ft840.c ft980.c vx1700.c \
|
||||
newcat.c ft450.c ft950.c ft2000.c ft9000.c ft5000.c \
|
||||
ft1200.c ft991.c ft600.c ft3000.c ftdx101.c ftdx101mp.c \
|
||||
ft891.c ftdx10.c \
|
||||
yaesu.c
|
||||
|
||||
LOCAL_MODULE := yaesu
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
LOCAL_C_INCLUDES := android include src
|
||||
LOCAL_LDLIBS := -lhamlib -Lobj/local/armeabi
|
||||
LOCAL_LDLIBS := -Lobj/local/armeabi
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
|
|
@ -11,7 +11,7 @@ YAESUSRC = ft100.c ft100.h ft747.c ft747.h ft817.c ft817.h ft847.c ft847.h \
|
|||
## Yaesu radios that use the new Kenwood style CAT commands
|
||||
NEWCATSRC = newcat.c newcat.h ft450.c ft450.h ft950.c ft950.h ft991.c ft991.h \
|
||||
ft2000.c ft2000.h ft9000.c ft9000.h ft5000.c ft5000.h ft1200.c ft1200.h \
|
||||
ft891.c ft891.h ftdx101.c ftdx101.h ft3000.c ftdx10.c
|
||||
ft891.c ft891.h ftdx101.c ftdx101.h ftdx101mp.c ft3000.c ftdx10.c
|
||||
|
||||
noinst_LTLIBRARIES = libhamlib-yaesu.la
|
||||
libhamlib_yaesu_la_SOURCES = $(YAESUSRC) $(NEWCATSRC) yaesu.c yaesu.h
|
||||
|
|
|
@ -158,7 +158,7 @@ const struct rig_caps ft1000d_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT1000D),
|
||||
.model_name = "FT-1000D",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20210120.0",
|
||||
.version = "20210121.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -3571,6 +3571,10 @@ int ft1000d_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__,
|
||||
tx_freq);
|
||||
|
||||
err = rig_set_split_vfo(rig, vfo, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
|
||||
// priv = (struct ft1000d_priv_data *)rig->state.priv;
|
||||
|
||||
err = ft1000d_send_dial_freq(rig, FT1000D_NATIVE_SET_SUB_VFO_FREQ, tx_freq);
|
||||
|
|
|
@ -222,7 +222,7 @@ const struct rig_caps ft1000mp_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT1000MP),
|
||||
.model_name = "FT-1000MP",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20210120.0",
|
||||
.version = "20210310.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -356,7 +356,7 @@ const struct rig_caps ft1000mpmkv_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT1000MPMKV),
|
||||
.model_name = "MARK-V FT-1000MP",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20210120.0",
|
||||
.version = "20210310.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -490,7 +490,7 @@ const struct rig_caps ft1000mpmkvfld_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT1000MPMKVFLD),
|
||||
.model_name = "MARK-V Field FT-1000MP",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20210120.0",
|
||||
.version = "20210310.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -629,15 +629,14 @@ int ft1000mp_init(RIG *rig)
|
|||
{
|
||||
struct ft1000mp_priv_data *priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called \n", __func__);
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
rig->state.priv = (struct ft1000mp_priv_data *) calloc(1,
|
||||
sizeof(struct ft1000mp_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
RETURNFUNC(-RIG_ENOMEM);
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
@ -653,7 +652,7 @@ int ft1000mp_init(RIG *rig)
|
|||
priv->read_update_delay =
|
||||
FT1000MP_DEFAULT_READ_TIMEOUT; /* set update timeout to safe value */
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -665,9 +664,7 @@ int ft1000mp_init(RIG *rig)
|
|||
|
||||
int ft1000mp_cleanup(RIG *rig)
|
||||
{
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
if (rig->state.priv)
|
||||
{
|
||||
|
@ -676,7 +673,7 @@ int ft1000mp_cleanup(RIG *rig)
|
|||
|
||||
rig->state.priv = NULL;
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -691,14 +688,15 @@ int ft1000mp_open(RIG *rig)
|
|||
struct ft1000mp_priv_data *p;
|
||||
unsigned char *cmd; /* points to sequence to send */
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
ENTERFUNC;
|
||||
|
||||
rig_s = &rig->state;
|
||||
p = (struct ft1000mp_priv_data *)rig_s->priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: rig_open: write_delay = %i msec \n",
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: rig_open: write_delay = %i msec \n", __func__,
|
||||
rig_s->rigport.write_delay);
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: rig_open: post_write_delay = %i msec \n",
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: rig_open: post_write_delay = %i msec \n",
|
||||
__func__,
|
||||
rig_s->rigport.post_write_delay);
|
||||
|
||||
/*
|
||||
|
@ -706,7 +704,7 @@ int ft1000mp_open(RIG *rig)
|
|||
*/
|
||||
memcpy(&p->p_cmd, &ncmd[FT1000MP_NATIVE_PACING].nseq, YAESU_CMD_LENGTH);
|
||||
p->p_cmd[3] = p->pacing; /* get pacing value, and store in private cmd */
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: read pacing = %i\n", p->pacing);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: read pacing = %i\n", __func__, p->pacing);
|
||||
|
||||
/* send PACING cmd to rig */
|
||||
cmd = p->p_cmd;
|
||||
|
@ -715,7 +713,7 @@ int ft1000mp_open(RIG *rig)
|
|||
ft1000mp_get_vfo(rig, &rig->state.current_vfo);
|
||||
/* TODO */
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -727,8 +725,7 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
unsigned char *cmd; /* points to sequence to send */
|
||||
int cmd_index = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ft1000mp_set_freq called\n", __func__);
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
p = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -754,11 +751,11 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
case RIG_VFO_MEM:
|
||||
/* TODO, hint: store current memory number */
|
||||
return -RIG_ENIMPL;
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_WARN, "ft1000mp: unknown VFO %d\n", vfo);
|
||||
return -RIG_EINVAL;
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: unknown VFO %d\n", __func__, vfo);
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -776,13 +773,15 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
cmd = p->p_cmd; /* get native sequence */
|
||||
write_block(&rig_s->rigport, (char *) cmd, YAESU_CMD_LENGTH);
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_get_vfo_data(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
int cmd_index, len, retval;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
if (vfo == RIG_VFO_A || vfo == RIG_VFO_B)
|
||||
{
|
||||
cmd_index = FT1000MP_NATIVE_VFO_UPDATE;
|
||||
|
@ -800,7 +799,7 @@ int ft1000mp_get_vfo_data(RIG *rig, vfo_t vfo)
|
|||
*/
|
||||
retval = ft1000mp_get_update_data(rig, cmd_index, len);
|
||||
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
/*
|
||||
* Return Freq for a given VFO
|
||||
|
@ -816,11 +815,19 @@ int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: current_vfo=%s\n", __func__,
|
||||
rig_strvfo(rig->state.current_vfo));
|
||||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
retval = ft1000mp_get_vfo_data(rig, vfo);
|
||||
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
priv = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
@ -837,12 +844,13 @@ int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
/* big endian integer, kinda */
|
||||
f = ((((((p[0] << 8) + p[1]) << 8) + p[2]) << 8) + p[3]) * 10 / 16;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: freq = %"PRIfreq" Hz for VFO [%x]\n", f,
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: freq = %"PRIfreq" Hz for VFO [%x]\n", __func__,
|
||||
f,
|
||||
vfo);
|
||||
|
||||
*freq = f; /* return displayed frequency */
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -863,6 +871,13 @@ int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: generic mode = %s\n", __func__,
|
||||
rig_strrmode(mode));
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: current_vfo=%s\n", __func__,
|
||||
rig_strvfo(rig->state.current_vfo));
|
||||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
/*
|
||||
* translate mode from generic to ft1000mp specific
|
||||
*/
|
||||
|
@ -939,7 +954,7 @@ int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
break;
|
||||
|
||||
default:
|
||||
return -RIG_EINVAL; /* sorry, wrong MODE */
|
||||
RETURNFUNC(-RIG_EINVAL); /* sorry, wrong MODE * */
|
||||
}
|
||||
|
||||
|
||||
|
@ -954,9 +969,9 @@ int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
*/
|
||||
ft1000mp_send_priv_cmd(rig, cmd_index);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: cmd_index = %i\n", cmd_index);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_index = %i\n", __func__, cmd_index);
|
||||
|
||||
return RIG_OK; /* good */
|
||||
RETURNFUNC(RIG_OK); /* good */
|
||||
|
||||
}
|
||||
|
||||
|
@ -973,14 +988,20 @@ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
unsigned char mymode_ext; /* ft1000mp extra mode bit mode */
|
||||
int retval;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
ENTERFUNC;
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: current_vfo=%s\n", __func__,
|
||||
rig_strvfo(rig->state.current_vfo));
|
||||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
retval = ft1000mp_get_vfo_data(rig, vfo);
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
priv = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
@ -997,10 +1018,10 @@ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
}
|
||||
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: mymode = %x (before)\n", mymode);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mymode = %x (before)\n", __func__, mymode);
|
||||
mymode &= MODE_MASK;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: mymode = %x (after)\n", mymode);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mymode = %x (after)\n", __func__, mymode);
|
||||
|
||||
/*
|
||||
* translate mode from ft1000mp to generic.
|
||||
|
@ -1037,16 +1058,16 @@ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
break;
|
||||
|
||||
default:
|
||||
return -RIG_EINVAL; /* sorry, wrong mode */
|
||||
RETURNFUNC(-RIG_EINVAL); /* sorry, wrong mode */
|
||||
break;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: mode = %s\n", rig_strrmode(*mode));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode = %s\n", __func__, rig_strrmode(*mode));
|
||||
|
||||
/* TODO: set real IF filter selection */
|
||||
*width = RIG_PASSBAND_NORMAL;
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1058,9 +1079,10 @@ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
|
||||
int ft1000mp_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
unsigned char cmd_index = 0; /* index of sequence to send */
|
||||
//unsigned char cmd_index = 0; /* index of sequence to send */
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: ft1000mp_set_vfo called %s\n",
|
||||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called %s\n", __func__,
|
||||
rig_strvfo(vfo));
|
||||
|
||||
/*
|
||||
|
@ -1075,6 +1097,8 @@ int ft1000mp_set_vfo(RIG *rig, vfo_t vfo)
|
|||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
#if 0 // seems switching VFOs like this changes the frequencies in the response
|
||||
|
||||
switch (vfo)
|
||||
{
|
||||
case RIG_VFO_A:
|
||||
|
@ -1091,19 +1115,23 @@ int ft1000mp_set_vfo(RIG *rig, vfo_t vfo)
|
|||
|
||||
case RIG_VFO_CURR:
|
||||
/* do nothing, we're already at it! */
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Unknown default VFO %d\n", __func__, vfo);
|
||||
return -RIG_EINVAL; /* sorry, wrong VFO */
|
||||
RETURNFUNC(-RIG_EINVAL); /* sorry, wrong VFO */
|
||||
}
|
||||
|
||||
/*
|
||||
* phew! now send cmd to rig
|
||||
*/
|
||||
ft1000mp_send_priv_cmd(rig, cmd_index);
|
||||
#endif
|
||||
|
||||
return RIG_OK;
|
||||
// we just store the requested vfo in our internal state
|
||||
rig->state.current_vfo = vfo;
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1119,8 +1147,7 @@ int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
struct ft1000mp_priv_data *p;
|
||||
int retval;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
p = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -1130,13 +1157,23 @@ int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
|
||||
if (retval < 0)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
if (p->update_data[1] & 0x40)
|
||||
{
|
||||
*vfo = RIG_VFO_MEM;
|
||||
}
|
||||
else // we are emulating vfo status
|
||||
{
|
||||
*vfo = rig->state.current_vfo;
|
||||
if (*vfo == RIG_VFO_CURR) {
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: no get_vfo, defaulting to VFOA\n", __func__);
|
||||
*vfo = RIG_VFO_A;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
else if (p->update_data[FT1000MP_SUMO_DISPLAYED_STATUS] & SF_VFOAB)
|
||||
{
|
||||
*vfo = rig->state.current_vfo = RIG_VFO_B;
|
||||
|
@ -1146,10 +1183,12 @@ int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
*vfo = rig->state.current_vfo = RIG_VFO_A;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo status = %x %x\n", __func__,
|
||||
p->update_data[0], p->update_data[1]);
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
|
@ -1158,11 +1197,10 @@ int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
struct rig_state *rs;
|
||||
unsigned char *cmd;
|
||||
|
||||
ENTERFUNC;
|
||||
rs = &rig->state;
|
||||
priv = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called func\n", __func__);
|
||||
|
||||
switch (func)
|
||||
{
|
||||
case RIG_FUNC_RIT:
|
||||
|
@ -1178,7 +1216,7 @@ int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
cmd = priv->p_cmd;
|
||||
|
||||
write_block(&rs->rigport, (char *) cmd, YAESU_CMD_LENGTH);
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
case RIG_FUNC_XIT:
|
||||
if (status)
|
||||
|
@ -1193,14 +1231,15 @@ int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
cmd = priv->p_cmd;
|
||||
|
||||
write_block(&rs->rigport, (char *) cmd, YAESU_CMD_LENGTH); break;
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "Unsupported set_func %s", rig_strfunc(func));
|
||||
return -RIG_EINVAL;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported set_func %s", __func__,
|
||||
rig_strfunc(func));
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
return -RIG_EINVAL;
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
{
|
||||
|
@ -1208,13 +1247,12 @@ int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
struct ft1000mp_priv_data *priv;
|
||||
unsigned char *p;
|
||||
|
||||
ENTERFUNC;
|
||||
priv = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (!status)
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
switch (func)
|
||||
|
@ -1225,7 +1263,7 @@ int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
|
||||
if (retval < 0)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_B)
|
||||
|
@ -1238,7 +1276,7 @@ int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
}
|
||||
|
||||
*status = (*p & 2) ? 1 : 0;
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1248,7 +1286,7 @@ int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
|
||||
if (retval < 0)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_B)
|
||||
|
@ -1261,17 +1299,18 @@ int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
}
|
||||
|
||||
*status = (*p & 1) ? 1 : 0;
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "Unsupported get_func %s", rig_strfunc(func));
|
||||
return -RIG_EINVAL;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported get_func %s", __func__,
|
||||
rig_strfunc(func));
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
return -RIG_EINVAL;
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1279,17 +1318,20 @@ int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
*/
|
||||
int ft1000mp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
{
|
||||
ENTERFUNC;
|
||||
|
||||
if (rit != 0)
|
||||
{
|
||||
ft1000mp_set_func(rig, vfo, RIG_FUNC_RIT, 1);
|
||||
}
|
||||
|
||||
return ft1000mp_set_rxit(rig, vfo, rit);
|
||||
RETURNFUNC(ft1000mp_set_rxit(rig, vfo, rit));
|
||||
}
|
||||
|
||||
int ft1000mp_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
{
|
||||
return ft1000mp_set_rxit(rig, vfo, rit);
|
||||
ENTERFUNC;
|
||||
RETURNFUNC(ft1000mp_set_rxit(rig, vfo, rit));
|
||||
}
|
||||
|
||||
int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
||||
|
@ -1299,7 +1341,7 @@ int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|||
unsigned char *cmd; /* points to sequence to send */
|
||||
int direction = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
|
||||
ENTERFUNC;
|
||||
|
||||
rs = &rig->state;
|
||||
priv = (struct ft1000mp_priv_data *)rs->priv;
|
||||
|
@ -1332,7 +1374,7 @@ int ft1000mp_set_rxit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|||
cmd = priv->p_cmd; /* get native sequence */
|
||||
write_block(&rs->rigport, (char *) cmd, YAESU_CMD_LENGTH);
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1348,7 +1390,7 @@ int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
|||
shortfreq_t f;
|
||||
int retval;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
ENTERFUNC;
|
||||
|
||||
priv = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -1356,7 +1398,7 @@ int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
|||
|
||||
if (retval < 0)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_B)
|
||||
|
@ -1383,7 +1425,7 @@ int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
|||
|
||||
*rit = f; /* return displayed frequency */
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1396,6 +1438,7 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
int retval;
|
||||
int retry = rig->state.rigport.retry;
|
||||
|
||||
ENTERFUNC;
|
||||
rs = &rig->state;
|
||||
priv = (struct ft1000mp_priv_data *)rs->priv;
|
||||
|
||||
|
@ -1445,7 +1488,7 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_level %s", __func__,
|
||||
rig_strlevel(level));
|
||||
return -RIG_EINVAL;
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
memset(&priv->p_cmd, m, YAESU_CMD_LENGTH - 1);
|
||||
|
@ -1461,8 +1504,8 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
if (retval != YAESU_CMD_LENGTH)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "ft1000mp_get_level: ack NG %d", retval);
|
||||
return retval;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: ack NG %d", __func__, retval);
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
switch (level)
|
||||
|
@ -1482,23 +1525,24 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
}
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp_get_level: %d %d %f\n", lvl_data[0],
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: %d %d %f\n", __func__, lvl_data[0],
|
||||
val->i, val->f);
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
{
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "ft1000mp: ft1000mp_set_ptt called %d\n", ptt);
|
||||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called %d\n", __func__, ptt);
|
||||
|
||||
cmd_index = ptt ? FT1000MP_NATIVE_PTT_ON : FT1000MP_NATIVE_PTT_OFF;
|
||||
|
||||
ft1000mp_send_priv_cmd(rig, cmd_index);
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1520,33 +1564,25 @@ static int ft1000mp_get_update_data(RIG *rig, unsigned char ci,
|
|||
struct rig_state *rig_s;
|
||||
struct ft1000mp_priv_data *p;
|
||||
int n; /* for read_ */
|
||||
int retry = rig->state.rigport.retry;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
p = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
rig_s = &rig->state;
|
||||
|
||||
// timeout retries are done in read_block now
|
||||
// based on rig backed retry value
|
||||
// do
|
||||
/* send UPDATE command to fetch data*/
|
||||
ft1000mp_send_priv_cmd(rig, ci);
|
||||
|
||||
n = read_block(&rig_s->rigport, (char *) p->update_data, rl);
|
||||
|
||||
if (n == -RIG_ETIMEOUT)
|
||||
{
|
||||
/* send UPDATE command to fetch data*/
|
||||
ft1000mp_send_priv_cmd(rig, ci);
|
||||
|
||||
n = read_block(&rig_s->rigport, (char *) p->update_data, rl);
|
||||
|
||||
if (n == -RIG_ETIMEOUT)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Timeout retry count = %d\n", __func__, retry);
|
||||
//rig_debug(RIG_DEBUG_TRACE, "%s: Timeout\n", __func__, retry);
|
||||
}
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Timeout\n", __func__);
|
||||
}
|
||||
// while (retry-- && n == -RIG_ETIMEOUT);
|
||||
|
||||
return n;
|
||||
|
||||
RETURNFUNC(n);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1564,9 +1600,7 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci)
|
|||
unsigned char *cmd; /* points to sequence to send */
|
||||
unsigned char cmd_index; /* index of sequence to send */
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
p = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
rig_s = &rig->state;
|
||||
|
@ -1577,14 +1611,14 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci)
|
|||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: attempt to send incomplete sequence\n",
|
||||
__func__);
|
||||
return -RIG_EINVAL;
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
cmd = (unsigned char *) p->pcs[cmd_index].nseq; /* get native sequence */
|
||||
rig_flush(&rig_s->rigport);
|
||||
write_block(&rig_s->rigport, (char *) cmd, YAESU_CMD_LENGTH);
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1595,6 +1629,7 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
unsigned char cmd_index = 0; /* index of sequence to send */
|
||||
freq_t tx_freq;
|
||||
|
||||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called rx_vfo=%s, tx_vfo=%s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strvfo(tx_vfo));
|
||||
|
||||
|
@ -1610,7 +1645,7 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Unknown split value = %d\n", __func__, split);
|
||||
return -RIG_EINVAL; /* sorry, wrong VFO */
|
||||
RETURNFUNC(-RIG_EINVAL); /* sorry, wrong VFO */
|
||||
}
|
||||
|
||||
rig_get_freq(rig, RIG_VFO_B, &tx_freq);
|
||||
|
@ -1622,7 +1657,7 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
ft1000mp_send_priv_cmd(rig, cmd_index);
|
||||
rig_set_freq(rig, RIG_VFO_B, tx_freq); // restore orig frequency
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1635,8 +1670,7 @@ int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
struct ft1000mp_priv_data *p;
|
||||
int retval;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
p = (struct ft1000mp_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -1646,7 +1680,7 @@ int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
|
||||
if (retval < 0)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
if (p->update_data[0] & 0x01)
|
||||
|
@ -1660,15 +1694,21 @@ int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
*split = RIG_SPLIT_OFF;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
{
|
||||
return ft1000mp_set_freq(rig, RIG_VFO_B, tx_freq);
|
||||
ENTERFUNC;
|
||||
int retval = rig_set_split_vfo(rig, vfo, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retval != RIG_OK) { RETURNFUNC(retval); }
|
||||
|
||||
RETURNFUNC(ft1000mp_set_freq(rig, RIG_VFO_B, tx_freq));
|
||||
}
|
||||
|
||||
int ft1000mp_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
{
|
||||
return ft1000mp_get_freq(rig, RIG_VFO_B, tx_freq);
|
||||
ENTERFUNC;
|
||||
RETURNFUNC(ft1000mp_get_freq(rig, RIG_VFO_B, tx_freq));
|
||||
}
|
||||
|
|
|
@ -92,26 +92,33 @@ int ft3000_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
|||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
switch (ant)
|
||||
{
|
||||
case 1:
|
||||
cmd = "EX0321"; // R3/1 ANT1/ANT3
|
||||
break;
|
||||
case 2:
|
||||
cmd = "EX0322"; // RE/2 ANT2/ANT3
|
||||
break;
|
||||
case 3:
|
||||
cmd = "EX0320"; // TRX ANT3
|
||||
break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 3,4,5 got %d\n", __func__, ant);
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
case 1:
|
||||
cmd = "AN01;"; // R3/1 ANT1/ANT3
|
||||
break;
|
||||
|
||||
case 2:
|
||||
cmd = "AN02;"; // RE/2 ANT2/ANT3
|
||||
break;
|
||||
|
||||
case 3:
|
||||
cmd = "AN03;"; // TRX ANT3
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 1,2,3 got %d\n", __func__, ant);
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd);
|
||||
|
||||
if (RIG_OK != (err = newcat_get_cmd(rig)))
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
@ -126,7 +133,8 @@ int ft3000_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
|||
option->i = 0; // default to no options
|
||||
|
||||
// find out what ANT3 setting
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s", "EX032;");
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s", "AN0;");
|
||||
|
||||
if (RIG_OK != (err = newcat_get_cmd(rig)))
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
|
@ -134,23 +142,27 @@ int ft3000_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
|||
|
||||
if (strlen(priv->ret_data) >= 7)
|
||||
{
|
||||
char c = priv->ret_data[5];
|
||||
switch(c)
|
||||
char c = priv->ret_data[3];
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '0':
|
||||
*ant_rx = *ant_tx = RIG_ANT_3;
|
||||
break;
|
||||
case '1':
|
||||
*ant_rx = RIG_ANT_3;
|
||||
*ant_tx = RIG_ANT_1;
|
||||
break;
|
||||
case '2':
|
||||
*ant_rx = RIG_ANT_3;
|
||||
*ant_tx = RIG_ANT_2;
|
||||
break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown antenna=%c\n", __func__, c);
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
case '1':
|
||||
*ant_rx = RIG_ANT_3;
|
||||
*ant_tx = RIG_ANT_1;
|
||||
break;
|
||||
|
||||
case '2':
|
||||
*ant_rx = RIG_ANT_3;
|
||||
*ant_tx = RIG_ANT_2;
|
||||
break;
|
||||
|
||||
case '3':
|
||||
*ant_rx = *ant_tx = RIG_ANT_3;
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown antenna=%c\n", __func__, c);
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +183,7 @@ const struct rig_caps ftdx3000_caps =
|
|||
RIG_MODEL(RIG_MODEL_FTDX3000),
|
||||
.model_name = "FTDX-3000",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = NEWCAT_VER ".3",
|
||||
.version = NEWCAT_VER ".4",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
|
|
@ -102,7 +102,7 @@ const struct rig_caps ft736_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT736R),
|
||||
.model_name = "FT-736R",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20200113.0",
|
||||
.version = "20210221.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -368,6 +368,10 @@ int ft736_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
{
|
||||
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x2e};
|
||||
|
||||
int retval = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retval != RIG_OK) { RETURNFUNC(retval); }
|
||||
|
||||
/* store bcd format in cmd (MSB) */
|
||||
to_bcd_be(cmd, freq / 10, 8);
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ const struct rig_caps ft767gx_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT767),
|
||||
.model_name = "FT-767GX",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20200325.0",
|
||||
.version = "20210221.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -832,6 +832,10 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
unsigned char curr_split;
|
||||
int retval;
|
||||
|
||||
retval = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retval != RIG_OK) { RETURNFUNC(retval); }
|
||||
|
||||
/* This appears to always pass in VFO_CURR as the vfo */
|
||||
/* My decision is to only update the xmit VFO if we're in split mode */
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ const struct rig_caps ft847_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT847),
|
||||
.model_name = "FT-847",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20200509.0",
|
||||
.version = "20210221.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -371,7 +371,7 @@ const struct rig_caps ft847uni_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT847UNI),
|
||||
.model_name = "FT-847UNI",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20200509.0",
|
||||
.version = "20210221.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -1056,6 +1056,10 @@ int ft847_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
|
||||
int ft847_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
int retval = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retval != RIG_OK) { RETURNFUNC(retval); }
|
||||
|
||||
return ft847_set_freq(rig, RIG_VFO_TX, freq);
|
||||
}
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ const struct rig_caps ft857_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT857),
|
||||
.model_name = "FT-857",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20201215.0",
|
||||
.version = "20210221.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -991,6 +991,11 @@ int ft857_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode,
|
|||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
retcode = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retcode != RIG_OK) { RETURNFUNC(retcode); }
|
||||
|
||||
|
||||
retcode = ft857_send_cmd(rig, FT857_NATIVE_CAT_SET_VFOAB);
|
||||
|
||||
if (RIG_OK != retcode)
|
||||
|
|
|
@ -151,7 +151,7 @@ const struct rig_caps ft920_caps =
|
|||
RIG_MODEL(RIG_MODEL_FT920),
|
||||
.model_name = "FT-920",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = "20100823.0", /* YYYYMMDD */
|
||||
.version = "20210221.0", /* YYYYMMDD */
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -1460,6 +1460,10 @@ static int ft920_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__,
|
||||
tx_freq);
|
||||
|
||||
err = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
|
||||
priv = (struct ft920_priv_data *)rig->state.priv;
|
||||
|
||||
err = ft920_get_split_vfo(rig, vfo, &priv->split, &priv->split_vfo);
|
||||
|
|
|
@ -209,27 +209,27 @@ static void dump_switch(unsigned char data)
|
|||
|
||||
static void dump_if_shift(unsigned char data)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "if_shift :\%d\n", data - 15);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s:%d\n", __func__, data - 15);
|
||||
}
|
||||
|
||||
static void dump_rptr_split_code(unsigned char data)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "rptr_split_code :\%02x\n", data);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s:%02x\n", __func__, data);
|
||||
}
|
||||
|
||||
static void dump_fsk_shift(unsigned char data)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "fsk_shift :\%02x\n", data);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s:%02x\n", __func__, data);
|
||||
}
|
||||
|
||||
static void dump_if_width(unsigned char data)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "if_width :\%d\n", data);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s:%d\n", __func__, data);
|
||||
}
|
||||
|
||||
static void dump_mem_shift_flag(unsigned char data)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s", "mem_shift_flag :");
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s:", __func__);
|
||||
|
||||
switch ((unsigned int)data)
|
||||
{
|
||||
|
@ -627,7 +627,8 @@ int ft980_get_status_data(RIG *rig)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
retval = ft980_transaction(rig, cmd, (unsigned char *)&priv->update_data, FT980_ALL_STATUS_LENGTH);
|
||||
retval = ft980_transaction(rig, cmd, (unsigned char *)&priv->update_data,
|
||||
FT980_ALL_STATUS_LENGTH);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
|
@ -759,9 +760,11 @@ int ft980_open(RIG *rig)
|
|||
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
|
||||
|
||||
write_block(&rig->state.rigport, (char *) cmd_OK, YAESU_CMD_LENGTH);
|
||||
retval = read_block(&rig->state.rigport, (char *) &priv->update_data, FT980_ALL_STATUS_LENGTH);
|
||||
retval = read_block(&rig->state.rigport, (char *) &priv->update_data,
|
||||
FT980_ALL_STATUS_LENGTH);
|
||||
}
|
||||
while (!priv->update_data.ext_ctl_flag && retry_count1++ < rig->state.rigport.retry);
|
||||
while (!priv->update_data.ext_ctl_flag
|
||||
&& retry_count1++ < rig->state.rigport.retry);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -803,9 +806,11 @@ int ft980_close(RIG *rig)
|
|||
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
|
||||
|
||||
write_block(&rig->state.rigport, (char *) cmd_OK, YAESU_CMD_LENGTH);
|
||||
retval = read_block(&rig->state.rigport, (char *) &priv->update_data, FT980_ALL_STATUS_LENGTH);
|
||||
retval = read_block(&rig->state.rigport, (char *) &priv->update_data,
|
||||
FT980_ALL_STATUS_LENGTH);
|
||||
}
|
||||
while (priv->update_data.ext_ctl_flag && retry_count1++ < rig->state.rigport.retry);
|
||||
while (priv->update_data.ext_ctl_flag
|
||||
&& retry_count1++ < rig->state.rigport.retry);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -941,7 +946,7 @@ int ft980_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: Selected Memory Freq = %lf\n", __func__, f*10);
|
||||
"%s: Selected Memory Freq = %lf\n", __func__, f * 10);
|
||||
|
||||
*freq = f * 10; /* return displayed frequency */
|
||||
|
||||
|
@ -983,7 +988,8 @@ int ft980_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_TRACE, " %s: passed vfo = 0x%02x\n", __func__, vfo);
|
||||
rig_debug(RIG_DEBUG_TRACE, " %s: passed mode = %s\n", __func__, rig_strrmode(mode));
|
||||
rig_debug(RIG_DEBUG_TRACE, " %s: passed mode = %s\n", __func__,
|
||||
rig_strrmode(mode));
|
||||
rig_debug(RIG_DEBUG_TRACE, " %s: passed width = %ld Hz\n", __func__, width);
|
||||
|
||||
// Set to selected VFO
|
||||
|
@ -1061,7 +1067,8 @@ int ft980_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
rig_force_cache_timeout(&priv->status_tv);
|
||||
|
||||
/* Mode set */
|
||||
return ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data, FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
return ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data,
|
||||
FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1184,6 +1191,7 @@ int ft980_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
default:
|
||||
return -RIG_EPROTO; /* Oops! file bug report */
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, " %s: Hamlib mode = %s\n", __func__,
|
||||
rig_strrmode(*mode));
|
||||
|
||||
|
@ -1195,7 +1203,9 @@ int ft980_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
{
|
||||
*width = rig_passband_narrow(rig, *mode);
|
||||
}
|
||||
rig_debug(RIG_DEBUG_TRACE, " %s: Filter width = %d Hz\n", __func__, (int)*width);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, " %s: Filter width = %d Hz\n", __func__,
|
||||
(int)*width);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -1242,7 +1252,8 @@ int ft980_set_mem(RIG *rig, vfo_t vfo, int ch)
|
|||
|
||||
cmd[3] = ch - 1;
|
||||
|
||||
return ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data, FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
return ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data,
|
||||
FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -1329,11 +1340,14 @@ int ft980_set_vfo(RIG *rig, vfo_t vfo)
|
|||
cmd[3] = FT980_CMD0A_VFO_SEL_HAM;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set VFO GEN/HAM = 0x%02x\n",
|
||||
__func__, cmd[3]);
|
||||
err = ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data, FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
err = ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data,
|
||||
FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
cmd[3] = FT980_CMD0A_FREQ_SEL_VFO;
|
||||
break;
|
||||
|
||||
|
@ -1341,11 +1355,14 @@ int ft980_set_vfo(RIG *rig, vfo_t vfo)
|
|||
cmd[3] = FT980_CMD0A_VFO_SEL_GEN;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set VFO GEN/HAM = 0x%02x\n",
|
||||
__func__, cmd[3]);
|
||||
err = ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data, FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
err = ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data,
|
||||
FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
cmd[3] = FT980_CMD0A_FREQ_SEL_VFO;
|
||||
break;
|
||||
|
||||
|
@ -1360,7 +1377,8 @@ int ft980_set_vfo(RIG *rig, vfo_t vfo)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: set VFO Status = %s\n",
|
||||
__func__, rig_strvfo(vfo));
|
||||
|
||||
return ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data, FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
return ft980_transaction(rig, cmd, UPDATE_DATA_OFS(&priv->update_data,
|
||||
FT980_OTHER_STATUS_LENGTH), FT980_OTHER_STATUS_LENGTH);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -1385,16 +1403,20 @@ int ft980_set_vfo(RIG *rig, vfo_t vfo)
|
|||
int ft980_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
int err;
|
||||
struct ft980_priv_data *priv = (struct ft980_priv_data *)rig->state.priv;
|
||||
struct ft980_priv_data *priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (!rig)
|
||||
{
|
||||
return -RIG_EARG;
|
||||
}
|
||||
|
||||
priv = (struct ft980_priv_data *)rig->state.priv;
|
||||
|
||||
/* Get flags for VFO status */
|
||||
err = ft980_get_status_data(rig);
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
|
|
|
@ -76,7 +76,7 @@ const struct rig_caps ftdx101d_caps =
|
|||
RIG_MODEL(RIG_MODEL_FTDX101D),
|
||||
.model_name = "FTDX-101D",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = NEWCAT_VER ".9",
|
||||
.version = NEWCAT_VER ".11",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -117,7 +117,8 @@ const struct rig_caps ftdx101d_caps =
|
|||
.transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */
|
||||
.bank_qty = 0,
|
||||
.chan_desc_sz = 0,
|
||||
.rfpower_meter_cal = FTDX101D_RFPOWER_METER_CAL,
|
||||
.rfpower_meter_cal = FTDX101D_RFPOWER_METER_WATTS_CAL,
|
||||
.str_cal = FTDX101D_STR_CAL,
|
||||
.swr_cal = FTDX101D_SWR_CAL,
|
||||
.chan_list = {
|
||||
{ 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP },
|
||||
|
@ -131,10 +132,10 @@ const struct rig_caps ftdx101d_caps =
|
|||
},
|
||||
|
||||
.tx_range_list1 = { /* the 101DX is 100W and the MP is 200W */
|
||||
FRQ_RNG_HF(1, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_HF(1, FTDX101_AM_TX_MODES, W(2), W(75), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(1, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_6m(1, FTDX101_AM_TX_MODES, W(2), W(75), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_HF(1, FTDX101_OTHER_TX_MODES, W(5), W(100), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_HF(1, FTDX101_AM_TX_MODES, W(5), W(25), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(1, FTDX101_OTHER_TX_MODES, W(5), W(100), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_6m(1, FTDX101_AM_TX_MODES, W(5), W(25), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
@ -145,12 +146,12 @@ const struct rig_caps ftdx101d_caps =
|
|||
},
|
||||
|
||||
.tx_range_list2 = {
|
||||
FRQ_RNG_HF(2, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_HF(2, FTDX101_AM_TX_MODES, W(2), W(75), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(2, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_6m(2, FTDX101_AM_TX_MODES, W(2), W(75), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_4m_REGION2(FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_4m_REGION2(FTDX101_AM_TX_MODES, W(2), W(75), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_HF(2, FTDX101_OTHER_TX_MODES, W(5), W(100), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_HF(2, FTDX101_AM_TX_MODES, W(5), W(25), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(2, FTDX101_OTHER_TX_MODES, W(5), W(100), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_6m(2, FTDX101_AM_TX_MODES, W(5), W(25), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_4m_REGION2(FTDX101_OTHER_TX_MODES, W(5), W(100), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_4m_REGION2(FTDX101_AM_TX_MODES, W(5), W(25), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
|
|
@ -71,20 +71,67 @@
|
|||
RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\
|
||||
RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE)
|
||||
|
||||
// Borrowed from FLRig -- Thanks to Dave W1HKJ
|
||||
#define FTDX101D_RFPOWER_METER_CAL \
|
||||
{ \
|
||||
6, \
|
||||
{ \
|
||||
{0, 0.0f}, \
|
||||
{35, 5.0f}, \
|
||||
{94, 25.0f}, \
|
||||
{0, 0.0f}, \
|
||||
{38, 0.5f}, \
|
||||
{94, 0.25f}, \
|
||||
{147, 0.50f}, \
|
||||
{176, 0.75f}, \
|
||||
{205, 1.0f}, \
|
||||
} \
|
||||
}
|
||||
|
||||
#define FTDX101D_RFPOWER_METER_WATTS_CAL \
|
||||
{ \
|
||||
6, \
|
||||
{ \
|
||||
{0, 0.0f}, \
|
||||
{38, 5.0f}, \
|
||||
{94, 25.0f}, \
|
||||
{147, 50.0f}, \
|
||||
{176, 75.0f}, \
|
||||
{205, 100.0f}, \
|
||||
} \
|
||||
}
|
||||
|
||||
#define FTDX101MP_RFPOWER_METER_CAL \
|
||||
{ \
|
||||
11, \
|
||||
{ \
|
||||
{0, 0.00f}, \
|
||||
{69, 0.05f}, \
|
||||
{111, 0.10f}, \
|
||||
{129, 0.15f}, \
|
||||
{143, 0.20f}, \
|
||||
{158, 0.25f}, \
|
||||
{184, 0.35f}, \
|
||||
{200, 0.40f}, \
|
||||
{211, 0.45f}, \
|
||||
{222, 0.50f}, \
|
||||
{255, 1.0f}, \
|
||||
} \
|
||||
}
|
||||
#define FTDX101MP_RFPOWER_METER_WATTS_CAL \
|
||||
{ \
|
||||
11, \
|
||||
{ \
|
||||
{0, 0.0f}, \
|
||||
{69, 10.0f}, \
|
||||
{111, 20.0f}, \
|
||||
{129, 30.0f}, \
|
||||
{143, 40.0f}, \
|
||||
{158, 50.0f}, \
|
||||
{184, 70.0f}, \
|
||||
{200, 80.0f}, \
|
||||
{211, 90.0f}, \
|
||||
{222, 100.0f}, \
|
||||
{255, 200.0f}, \
|
||||
} \
|
||||
}
|
||||
|
||||
// Based on testing with G3VPX Ian Sumner
|
||||
#define FTDX101D_SWR_CAL \
|
||||
{ \
|
||||
|
@ -101,6 +148,23 @@
|
|||
} \
|
||||
}
|
||||
|
||||
#define FTDX101D_STR_CAL { 12, \
|
||||
{ \
|
||||
{ 0, -60 }, /* S0 */ \
|
||||
{ 17, -54 }, /* S0 */ \
|
||||
{ 25, -48 }, \
|
||||
{ 34, -42 }, \
|
||||
{ 51, -36 }, \
|
||||
{ 68, -30 }, \
|
||||
{ 85, -24 }, \
|
||||
{ 102, -18 }, \
|
||||
{ 119, -12 }, \
|
||||
{ 136, -6 }, \
|
||||
{ 160, 0 }, /* S9 */ \
|
||||
{ 255, 60 }, /* +60 */ \
|
||||
} }
|
||||
|
||||
|
||||
/*
|
||||
* Other features (used by rig_caps)
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,249 @@
|
|||
/*
|
||||
* hamlib - (C) Frank Singleton 2000 (javabear at users.sourceforge.net)
|
||||
*
|
||||
* ftdx101md.c - (C) Nate Bargmann 2007 (n0nb at arrl.net)
|
||||
* (C) Stephane Fillod 2008-2010
|
||||
* (C) Terry Embry 2008-2009
|
||||
* (C) Mikael Nousiainen 2020
|
||||
* (C) Michael Black W9MDB 2021
|
||||
*
|
||||
* This shared library provides an API for communicating
|
||||
* via serial interface to an FTDX101(D) using the "CAT" interface
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "bandplan.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "tones.h"
|
||||
#include "newcat.h"
|
||||
#include "ftdx101.h"
|
||||
|
||||
const struct newcat_priv_caps ftdx101mp_priv_caps =
|
||||
{
|
||||
.roofing_filter_count = 6,
|
||||
.roofing_filters =
|
||||
{
|
||||
// The index must match ext level combo index
|
||||
{ .index = 0, .set_value = '0', .get_value = 0, .width = 12000, .optional = 0 },
|
||||
{ .index = 1, .set_value = '1', .get_value = '6', .width = 12000, .optional = 0 },
|
||||
{ .index = 2, .set_value = '2', .get_value = '7', .width = 3000, .optional = 0 },
|
||||
{ .index = 3, .set_value = '3', .get_value = '8', .width = 1200, .optional = 1 },
|
||||
{ .index = 4, .set_value = '4', .get_value = '9', .width = 600, .optional = 0 },
|
||||
{ .index = 5, .set_value = '5', .get_value = 'A', .width = 300, .optional = 1 },
|
||||
}
|
||||
};
|
||||
|
||||
const struct confparams ftdx101mp_ext_levels[] =
|
||||
{
|
||||
{
|
||||
TOK_ROOFING_FILTER,
|
||||
"ROOFINGFILTER",
|
||||
"Roofing filter",
|
||||
"Roofing filter",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "AUTO", "12 kHz", "3 kHz", "1.2 kHz (optional)", "600 Hz", "300 Hz (optional)", NULL } } }
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ftdx101mp_ext_tokens[] =
|
||||
{
|
||||
TOK_ROOFING_FILTER, TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
const struct rig_caps ftdx101mp_caps =
|
||||
{
|
||||
RIG_MODEL(RIG_MODEL_FTDX101MP),
|
||||
.model_name = "FTDX-101MP",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = NEWCAT_VER ".2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_NONE,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 4800,
|
||||
.serial_rate_max = 38400,
|
||||
.serial_data_bits = 8,
|
||||
.serial_stop_bits = 2,
|
||||
.serial_parity = RIG_PARITY_NONE,
|
||||
.serial_handshake = RIG_HANDSHAKE_HARDWARE,
|
||||
.write_delay = FTDX101_WRITE_DELAY,
|
||||
.post_write_delay = FTDX101_POST_WRITE_DELAY,
|
||||
.timeout = 2000,
|
||||
.retry = 3,
|
||||
.has_get_func = FTDX101_FUNCS,
|
||||
.has_set_func = FTDX101_FUNCS,
|
||||
.has_get_level = FTDX101_LEVELS,
|
||||
.has_set_level = RIG_LEVEL_SET(FTDX101_LEVELS),
|
||||
.has_get_parm = RIG_PARM_NONE,
|
||||
.has_set_parm = RIG_PARM_NONE,
|
||||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 10 } },
|
||||
[LVL_KEYSPD] = { .min = { .i = 4 }, .max = { .i = 60 }, .step = { .i = 1 } },
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3200 }, .step = { .i = 10 } },
|
||||
},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
.preamp = { 10, 20, RIG_DBLST_END, },
|
||||
.attenuator = { 6, 12, 18, RIG_DBLST_END, },
|
||||
.max_rit = Hz(9999),
|
||||
.max_xit = Hz(9999),
|
||||
.max_ifshift = Hz(1200),
|
||||
.vfo_ops = FTDX101_VFO_OPS,
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON | RIG_TARGETABLE_ANT,
|
||||
.transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */
|
||||
.bank_qty = 0,
|
||||
.chan_desc_sz = 0,
|
||||
.rfpower_meter_cal = FTDX101MP_RFPOWER_METER_WATTS_CAL,
|
||||
.str_cal = FTDX101D_STR_CAL,
|
||||
.swr_cal = FTDX101D_SWR_CAL,
|
||||
.chan_list = {
|
||||
{ 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP },
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
.rx_range_list1 = {
|
||||
/* General coverage + ham, ANT_5 is RX only antenna */
|
||||
{kHz(30), MHz(60), FTDX101_ALL_RX_MODES, -1, -1, FTDX101_VFO_ALL, FTDX101_TX_ANTS, "USA"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tx_range_list1 = { /* the 101DX is 100W and the MP is 200W */
|
||||
FRQ_RNG_HF(1, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_HF(1, FTDX101_AM_TX_MODES, W(5), W(50), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(1, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_6m(1, FTDX101_AM_TX_MODES, W(5), W(50), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list2 = {
|
||||
{kHz(30), MHz(60), FTDX101_ALL_RX_MODES, -1, -1, FTDX101_VFO_ALL, FTDX101_TX_ANTS, "EUR"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tx_range_list2 = {
|
||||
FRQ_RNG_HF(2, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_HF(2, FTDX101_AM_TX_MODES, W(5), W(50), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(2, FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_6m(2, FTDX101_AM_TX_MODES, W(5), W(50), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
FRQ_RNG_4m_REGION2(FTDX101_OTHER_TX_MODES, W(5), W(200), FTDX101_VFO_ALL, FTDX101_TX_ANTS),
|
||||
FRQ_RNG_4m_REGION2(FTDX101_AM_TX_MODES, W(5), W(50), FTDX101_VFO_ALL, FTDX101_TX_ANTS), /* AM class */
|
||||
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tuning_steps = {
|
||||
{FTDX101_SSB_CW_RX_MODES, Hz(10)}, /* Normal */
|
||||
{FTDX101_SSB_CW_RX_MODES, Hz(100)}, /* Fast */
|
||||
|
||||
{FTDX101_AM_RX_MODES, Hz(100)}, /* Normal */
|
||||
{FTDX101_AM_RX_MODES, kHz(1)}, /* Fast */
|
||||
|
||||
{FTDX101_FM_RX_MODES, Hz(100)}, /* Normal */
|
||||
{FTDX101_FM_RX_MODES, kHz(1)}, /* Fast */
|
||||
|
||||
RIG_TS_END,
|
||||
|
||||
},
|
||||
|
||||
/* mode/filter list, remember that order matters! */
|
||||
.filters = {
|
||||
{FTDX101_CW_RTTY_PKT_RX_MODES, Hz(600)}, /* Normal CW, RTTY, PKT/USER */
|
||||
{FTDX101_CW_RTTY_PKT_RX_MODES, Hz(300)}, /* Narrow CW, RTTY, PKT/USER */
|
||||
{FTDX101_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */
|
||||
{FTDX101_CW_RTTY_PKT_RX_MODES, Hz(1200)}, /* Normal CW, RTTY, PKT/USER */
|
||||
{RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */
|
||||
{RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */
|
||||
{RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */
|
||||
{RIG_MODE_AM, Hz(9000)}, /* Normal AM */
|
||||
{RIG_MODE_AMN, Hz(6000)}, /* Narrow AM */
|
||||
{RIG_MODE_FM | RIG_MODE_PKTFM, Hz(16000)}, /* Normal FM */
|
||||
{RIG_MODE_FMN | RIG_MODE_PKTFMN, Hz(9000)}, /* Narrow FM */
|
||||
{FTDX101_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY},
|
||||
|
||||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.ext_tokens = ftdx101mp_ext_tokens,
|
||||
.extlevels = ftdx101mp_ext_levels,
|
||||
|
||||
.priv = &ftdx101mp_priv_caps,
|
||||
|
||||
.rig_init = newcat_init,
|
||||
.rig_cleanup = newcat_cleanup,
|
||||
.rig_open = newcat_open, /* port opened */
|
||||
.rig_close = newcat_close, /* port closed */
|
||||
|
||||
.cfgparams = newcat_cfg_params,
|
||||
.set_conf = newcat_set_conf,
|
||||
.get_conf = newcat_get_conf,
|
||||
.set_freq = newcat_set_freq,
|
||||
.get_freq = newcat_get_freq,
|
||||
.set_mode = newcat_set_mode,
|
||||
.get_mode = newcat_get_mode,
|
||||
.set_vfo = newcat_set_vfo,
|
||||
.get_vfo = newcat_get_vfo,
|
||||
.set_ptt = newcat_set_ptt,
|
||||
.get_ptt = newcat_get_ptt,
|
||||
.set_split_vfo = newcat_set_split_vfo,
|
||||
.get_split_vfo = newcat_get_split_vfo,
|
||||
.set_rit = newcat_set_rit,
|
||||
.get_rit = newcat_get_rit,
|
||||
.set_xit = newcat_set_xit,
|
||||
.get_xit = newcat_get_xit,
|
||||
.set_ant = newcat_set_ant,
|
||||
.get_ant = newcat_get_ant,
|
||||
.get_func = newcat_get_func,
|
||||
.set_func = newcat_set_func,
|
||||
.get_level = newcat_get_level,
|
||||
.set_level = newcat_set_level,
|
||||
.get_mem = newcat_get_mem,
|
||||
.set_mem = newcat_set_mem,
|
||||
.vfo_op = newcat_vfo_op,
|
||||
.get_info = newcat_get_info,
|
||||
.power2mW = newcat_power2mW,
|
||||
.mW2power = newcat_mW2power,
|
||||
.set_rptr_shift = newcat_set_rptr_shift,
|
||||
.get_rptr_shift = newcat_get_rptr_shift,
|
||||
.set_rptr_offs = newcat_set_rptr_offs,
|
||||
.get_rptr_offs = newcat_get_rptr_offs,
|
||||
.set_ctcss_tone = newcat_set_ctcss_tone,
|
||||
.get_ctcss_tone = newcat_get_ctcss_tone,
|
||||
.set_ctcss_sql = newcat_set_ctcss_sql,
|
||||
.get_ctcss_sql = newcat_get_ctcss_sql,
|
||||
.set_powerstat = newcat_set_powerstat,
|
||||
.get_powerstat = newcat_get_powerstat,
|
||||
.get_ts = newcat_get_ts,
|
||||
.set_ts = newcat_set_ts,
|
||||
.set_trn = newcat_set_trn,
|
||||
.get_trn = newcat_get_trn,
|
||||
.set_channel = newcat_set_channel,
|
||||
.get_channel = newcat_get_channel,
|
||||
.set_ext_level = newcat_set_ext_level,
|
||||
.get_ext_level = newcat_get_ext_level,
|
||||
};
|
|
@ -90,8 +90,9 @@ typedef struct _yaesu_newcat_commands
|
|||
ncboolean ft5000;
|
||||
ncboolean ft1200;
|
||||
ncboolean ft3000;
|
||||
ncboolean ft101;
|
||||
ncboolean ft101d;
|
||||
ncboolean ft10;
|
||||
ncboolean ft101mp;
|
||||
} yaesu_newcat_commands_t;
|
||||
|
||||
/**
|
||||
|
@ -209,7 +210,8 @@ static ncboolean is_ftdx9000;
|
|||
static ncboolean is_ftdx5000;
|
||||
static ncboolean is_ftdx1200;
|
||||
static ncboolean is_ftdx3000;
|
||||
static ncboolean is_ftdx101;
|
||||
static ncboolean is_ftdx101d;
|
||||
static ncboolean is_ftdx101mp;
|
||||
static ncboolean is_ftdx10;
|
||||
|
||||
/*
|
||||
|
@ -230,126 +232,126 @@ static ncboolean is_ftdx10;
|
|||
*/
|
||||
static const yaesu_newcat_commands_t valid_commands[] =
|
||||
{
|
||||
/* Command FT-450 FT-950 FT-891 FT-991 FT-2000 FT-9000 FT-5000 FT-1200 FT-3000 FTDX101D FTDX10 */
|
||||
{"AB", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AM", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AN", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE },
|
||||
{"AO", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
{"BA", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BC", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BM", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
{"BP", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BU", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BY", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CH", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CN", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CO", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CT", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"DA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"DN", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"DT", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE },
|
||||
{"DP", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"DS", TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"ED", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"EK", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE },
|
||||
{"EM", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
{"EN", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"EU", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"EX", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FB", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FK", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"FN", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
{"FR", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FT", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"GT", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"ID", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"IF", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"IS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KP", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KY", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"LK", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"LM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MA", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MB", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
{"MC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MK", TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"ML", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MT", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
{"MW", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MX", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NA", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NB", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NL", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"OI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"OS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PB", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PL", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PR", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"QI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"QR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"QS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RF", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RL", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RO", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE },
|
||||
{"RP", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"RS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RT", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RU", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SF", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SH", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SQ", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SS", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
/* Command FT-450 FT-950 FT-891 FT-991 FT-2000 FT-9000 FT-5000 FT-1200 FT-3000 FTDX101D FTDX10 FTDX101MP */
|
||||
{"AB", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AM", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"AN", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE },
|
||||
{"AO", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
{"BA", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BC", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BM", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
{"BP", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BU", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"BY", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CH", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CN", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CO", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"CT", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"DA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"DN", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"DT", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE },
|
||||
{"DP", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"DS", TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"ED", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"EK", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE },
|
||||
{"EM", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE },
|
||||
{"EN", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"EU", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"EX", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FB", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FK", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"FN", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
{"FR", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"FT", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"GT", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"ID", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"IF", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"IS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KP", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"KY", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"LK", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"LM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MA", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MB", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
{"MC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MK", TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"ML", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MT", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
{"MW", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"MX", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NA", TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NB", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NL", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"NR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"OI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"OS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PB", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PL", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PR", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"PS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"QI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"QR", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"QS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RA", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RF", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RI", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RL", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RO", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE },
|
||||
{"RP", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"RS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RT", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"RU", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SF", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SH", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SQ", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SS", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
// ST command has two meanings Step or Split Status
|
||||
// If new rig is added that has ST ensure it means Split
|
||||
// Otherwise modify newcat_get_tx_vfo
|
||||
{"ST", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
{"SV", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SY", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE },
|
||||
{"TS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"TX", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"UL", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"UP", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VF", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE },
|
||||
{"VG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VR", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"VS", TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VT", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE },
|
||||
{"VV", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
|
||||
{"VX", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"XT", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"ZI", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE },
|
||||
};
|
||||
{"ST", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
{"SV", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"SY", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE },
|
||||
{"TS", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"TX", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"UL", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"UP", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VD", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VF", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE },
|
||||
{"VG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VM", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VR", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE },
|
||||
{"VS", TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"VT", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE },
|
||||
{"VV", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE },
|
||||
{"VX", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"XT", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
|
||||
{"ZI", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE },
|
||||
} ;
|
||||
|
||||
int valid_commands_count = sizeof(valid_commands) / sizeof(
|
||||
yaesu_newcat_commands_t);
|
||||
|
@ -508,6 +510,7 @@ int newcat_open(RIG *rig)
|
|||
|
||||
ENTERFUNC;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Rig=%s, version=%s\n", __func__, rig->caps->model_name, rig->caps->version);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n",
|
||||
__func__, rig_s->rigport.write_delay);
|
||||
|
||||
|
@ -583,6 +586,7 @@ int newcat_close(RIG *rig)
|
|||
{
|
||||
|
||||
struct newcat_priv_data *priv = rig->state.priv;
|
||||
struct rig_state *rig_s = &rig->state;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
|
@ -593,6 +597,11 @@ int newcat_close(RIG *rig)
|
|||
case it's not
|
||||
supported */
|
||||
}
|
||||
if (priv->poweron != 0 && rig_s->auto_power_off)
|
||||
{
|
||||
rig_set_powerstat(rig, 0);
|
||||
priv->poweron = 0;
|
||||
}
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
@ -693,7 +702,7 @@ int newcat_get_conf(RIG *rig, token_t token, char *val)
|
|||
|
||||
|
||||
/*
|
||||
* rig_set_freq
|
||||
* newcat_set_freq
|
||||
*
|
||||
* Set frequency for a given VFO
|
||||
* RIG_TARGETABLE_VFO
|
||||
|
@ -777,20 +786,25 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
// some rigs like FTDX101D cannot change non-TX vfo freq
|
||||
// but they can change the TX vfo
|
||||
if (is_ftdx101 && rig->state.cache.ptt == RIG_PTT_ON)
|
||||
if ((is_ftdx101d || is_ftdx101mp) && rig->state.cache.ptt == RIG_PTT_ON)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n",
|
||||
__func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo));
|
||||
|
||||
// when in split we can change VFOB but not VFOA
|
||||
if (rig->state.cache.split == RIG_SPLIT_ON && target_vfo == '0') return -RIG_ENTARGET;
|
||||
if (rig->state.cache.split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; }
|
||||
|
||||
// when not in split we can't change VFOA at all
|
||||
if (rig->state.cache.split == RIG_SPLIT_OFF && target_vfo == '0') return -RIG_ENTARGET;
|
||||
if (vfo != rig->state.tx_vfo) return -RIG_ENTARGET;
|
||||
if (rig->state.cache.split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; }
|
||||
|
||||
if (vfo != rig->state.tx_vfo) { return -RIG_ENTARGET; }
|
||||
}
|
||||
|
||||
if (is_ftdx3000 || is_ftdx5000)
|
||||
{
|
||||
// we have a few rigs that can't set freq while PTT_ON
|
||||
ptt_t ptt;
|
||||
|
||||
if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt)))
|
||||
{
|
||||
ERRMSG(err, "newcat_set_cmd failed");
|
||||
|
@ -993,7 +1007,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
// after band select re-read things -- may not have to change anything
|
||||
// reading both VFOs is really only needed for rigs with just one VFO stack
|
||||
// but we read them all to ensure we cover both types
|
||||
freq_t tmp_freqA, tmp_freqB;
|
||||
freq_t tmp_freqA = 0, tmp_freqB = 0;
|
||||
rmode_t tmp_mode;
|
||||
pbwidth_t tmp_width;
|
||||
|
||||
|
@ -1023,8 +1037,6 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
// just drop through
|
||||
}
|
||||
|
||||
|
||||
// cppcheck-suppress *
|
||||
if (RIG_MODEL_FT450 == caps->rig_model)
|
||||
{
|
||||
if (c == 'B')
|
||||
|
@ -1944,7 +1956,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
|
|||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs,
|
||||
cat_term);
|
||||
}
|
||||
else if (is_ftdx101 || is_ftdx10)
|
||||
else if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
if (freq >= 28000000 && freq <= 29700000)
|
||||
{
|
||||
|
@ -2152,7 +2164,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs)
|
|||
// Step size is 1 kHz
|
||||
step = 1000;
|
||||
}
|
||||
else if (is_ftdx101 || is_ftdx10)
|
||||
else if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
if (freq >= 28000000 && freq <= 29700000)
|
||||
{
|
||||
|
@ -2242,7 +2254,7 @@ int newcat_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
|||
int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
||||
{
|
||||
int err;
|
||||
vfo_t rx_vfo;
|
||||
vfo_t rx_vfo = RIG_VFO_NONE;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
|
@ -2258,7 +2270,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
vfo = RIG_VFO_A;
|
||||
tx_vfo = RIG_SPLIT_ON == split ? RIG_VFO_B : RIG_VFO_A;
|
||||
}
|
||||
else if (is_ftdx101)
|
||||
else if (is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
vfo = RIG_VFO_MAIN;
|
||||
tx_vfo = RIG_SPLIT_ON == split ? RIG_VFO_SUB : RIG_VFO_MAIN;
|
||||
|
@ -2606,7 +2618,7 @@ int newcat_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
|
|||
}
|
||||
|
||||
/* assume 2 tuning steps per mode */
|
||||
for (i = 0, ts_match = FALSE; i < TSLSTSIZ
|
||||
for (i = 0, ts_match = FALSE; i < HAMLIB_TSLSTSIZ
|
||||
&& rig->caps->tuning_steps[i].ts; i++)
|
||||
if (rig->caps->tuning_steps[i].modes & mode)
|
||||
{
|
||||
|
@ -2668,7 +2680,7 @@ int newcat_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
|
|||
}
|
||||
|
||||
/* assume 2 tuning steps per mode */
|
||||
for (i = 0, ts_match = FALSE; i < TSLSTSIZ
|
||||
for (i = 0, ts_match = FALSE; i < HAMLIB_TSLSTSIZ
|
||||
&& rig->caps->tuning_steps[i].ts; i++)
|
||||
if (rig->caps->tuning_steps[i].modes & mode)
|
||||
{
|
||||
|
@ -2785,7 +2797,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10)
|
||||
if (is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CN%c0%03d%cCT%c2%c",
|
||||
main_sub_vfo, i, cat_term, main_sub_vfo, cat_term);
|
||||
|
@ -2830,7 +2842,7 @@ int newcat_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
|
|||
main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
|
||||
}
|
||||
|
||||
if (is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10)
|
||||
if (is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c0%c", cmd, main_sub_vfo,
|
||||
cat_term);
|
||||
|
@ -3169,6 +3181,8 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
|
|||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1);
|
||||
retval = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str));
|
||||
if (retval != RIG_OK) RETURNFUNC(retval);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3442,7 +3456,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
}
|
||||
|
||||
if (is_ft950 || is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991
|
||||
|| is_ftdx101 || is_ftdx10)
|
||||
|| is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
scale = 100.;
|
||||
}
|
||||
|
@ -3457,7 +3471,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
fpf = newcat_scale_float(scale, val.f);
|
||||
|
||||
if (is_ft950 || is_ft891 || is_ft991 || is_ftdx3000 || is_ftdx101 || is_ftdx10)
|
||||
if (is_ft950 || is_ft891 || is_ft991 || is_ftdx3000 || is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
// Minimum is 5 watts on these rigs
|
||||
if (fpf < 5)
|
||||
|
@ -3475,6 +3489,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (val.f > 1.0) { RETURNFUNC(-RIG_EINVAL); }
|
||||
|
||||
fpf = newcat_scale_float(255, val.f);
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AG%c%03d%c", main_sub_vfo, fpf,
|
||||
cat_term);
|
||||
|
@ -3529,7 +3545,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
@ -3548,7 +3564,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
}
|
||||
}
|
||||
|
||||
if (is_ftdx101 || is_ftdx10)
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS%c0%+.4d%c", main_sub_vfo,
|
||||
val.i, cat_term);
|
||||
|
@ -3571,7 +3587,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
}
|
||||
|
||||
// Some Yaesu rigs reject this command in AM/FM modes
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN
|
||||
|| mode & RIG_MODE_FMN)
|
||||
|
@ -3638,12 +3654,14 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101
|
||||
if (val.f > 1.0) { RETURNFUNC(-RIG_EINVAL); }
|
||||
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp
|
||||
|| is_ftdx10)
|
||||
{
|
||||
fpf = newcat_scale_float(100, val.f);
|
||||
|
@ -3656,7 +3674,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%03d%c", fpf, cat_term);
|
||||
|
||||
// Some Yaesu rigs reject this command in RTTY modes
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_RTTY || mode & RIG_MODE_RTTYR)
|
||||
{
|
||||
|
@ -3673,7 +3691,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101) // new format for the command with VFO selection
|
||||
if (is_ftdx101d || is_ftdx101mp) // new format for the command with VFO selection
|
||||
{
|
||||
format = "MS0%d;";
|
||||
|
||||
|
@ -3912,7 +3930,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
millis = dot10ths_to_millis(val.i, keyspd.i);
|
||||
|
||||
if (is_ftdx101 || is_ftdx10)
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
if (millis <= 30) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD00;"); }
|
||||
else if (millis <= 50) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD01;"); }
|
||||
|
@ -3995,7 +4013,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10)
|
||||
if (is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
scale = 100;
|
||||
}
|
||||
|
@ -4033,7 +4051,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VD%04d%c", val.i, cat_term);
|
||||
}
|
||||
else if (is_ftdx101 || is_ftdx10) // new lookup table argument
|
||||
else if (is_ftdx101d || is_ftdx101mp || is_ftdx10) // new lookup table argument
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ft101 #1 val.i=%d\n", __func__, val.i);
|
||||
|
||||
|
@ -4089,7 +4107,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
break;
|
||||
|
||||
case RIG_LEVEL_ANTIVOX:
|
||||
if (is_ftdx101 || is_ftdx10)
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
fpf = newcat_scale_float(100, val.f);
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AV%03d%c", fpf, cat_term);
|
||||
|
@ -4154,7 +4172,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
}
|
||||
}
|
||||
|
||||
if (is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10)
|
||||
if (is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
if (val.i > 320)
|
||||
{
|
||||
|
@ -4196,7 +4214,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101
|
||||
if (val.f > 1.0) { RETURNFUNC(-RIG_EINVAL); }
|
||||
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp
|
||||
|| is_ftdx10)
|
||||
{
|
||||
fpf = newcat_scale_float(100, val.f);
|
||||
|
@ -4313,7 +4333,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
@ -4327,7 +4347,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
}
|
||||
|
||||
// Some Yaesu rigs reject this command in AM/FM modes
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN
|
||||
|| mode & RIG_MODE_FMN)
|
||||
|
@ -4367,7 +4387,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
@ -4375,7 +4395,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%c", cat_term);
|
||||
|
||||
// Some Yaesu rigs reject this command in RTTY modes
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_RTTY || mode & RIG_MODE_RTTYR)
|
||||
{
|
||||
|
@ -4526,6 +4546,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM08%c", cat_term);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
// separate meters for Main and Sub
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM0%c", cat_term);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM5%c", cat_term);
|
||||
|
@ -4561,7 +4587,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
|
||||
case RIG_LEVEL_ANTIVOX:
|
||||
if (is_ftdx101 || is_ftdx10)
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AV%c", cat_term);
|
||||
}
|
||||
|
@ -4655,6 +4681,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
/* skip command */
|
||||
retlvl = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
retlvl_len = strlen(retlvl);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: retlvl='%s'\n", __func__, retlvl);
|
||||
/* chop term */
|
||||
priv->ret_data[ret_data_len - 1] = '\0';
|
||||
|
||||
|
@ -4662,7 +4689,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
{
|
||||
case RIG_LEVEL_RFPOWER:
|
||||
if (is_ft950 || is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991
|
||||
|| is_ftdx101 || is_ftdx10)
|
||||
|| is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
scale = 100.;
|
||||
}
|
||||
|
@ -4832,7 +4859,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
|
||||
case RIG_LEVEL_MICGAIN:
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp
|
||||
|| is_ftdx10)
|
||||
{
|
||||
scale = 100.;
|
||||
|
@ -4863,7 +4890,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
|
||||
case RIG_LEVEL_SQL:
|
||||
if (is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10)
|
||||
if (is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
scale = 100.;
|
||||
}
|
||||
|
@ -4881,7 +4908,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
int millis;
|
||||
value_t keyspd;
|
||||
|
||||
if (is_ftdx101 || is_ftdx10)
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
switch (raw_value)
|
||||
{
|
||||
|
@ -4929,7 +4956,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
}
|
||||
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ftdx5000 || is_ft891 || is_ft991
|
||||
|| is_ftdx101 || is_ftdx10)
|
||||
|| is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
val->i = round(rig_raw2val(atoi(retlvl), &yaesu_default_str_cal));
|
||||
}
|
||||
|
@ -4991,7 +5018,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
case RIG_LEVEL_VOXDELAY:
|
||||
val->i = atoi(retlvl);
|
||||
|
||||
if (is_ftdx101)
|
||||
if (is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
switch (val->i)
|
||||
{
|
||||
|
@ -5144,7 +5171,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
|
||||
case RIG_LEVEL_MONITOR_GAIN:
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101)
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
scale = 100.;
|
||||
}
|
||||
|
@ -5197,7 +5224,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
err = newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
@ -5211,7 +5238,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
}
|
||||
|
||||
// Some Yaesu rigs reject this command in FM mode
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN)
|
||||
{
|
||||
|
@ -5232,7 +5259,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
@ -5246,7 +5273,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
}
|
||||
|
||||
// Some Yaesu rigs reject this command in FM mode
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN)
|
||||
{
|
||||
|
@ -5305,7 +5332,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
// These rigs can lock Main/Sub VFO dials individually
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "LK%d%c", status ? 7 : 4,
|
||||
|
@ -5355,7 +5382,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
@ -5369,7 +5396,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
}
|
||||
|
||||
// Some Yaesu rigs reject this command in FM mode
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN)
|
||||
{
|
||||
|
@ -5390,12 +5417,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
||||
if (is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000 || is_ftdx101)
|
||||
if (is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
// 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,
|
||||
|
@ -5408,7 +5435,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
}
|
||||
|
||||
// Some Yaesu rigs reject this command in AM/FM/RTTY modes
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN
|
||||
|| mode & RIG_MODE_FMN ||
|
||||
|
@ -5503,7 +5530,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
err = newcat_get_mode(rig, vfo, &mode, &width);
|
||||
}
|
||||
|
@ -5516,7 +5543,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
}
|
||||
|
||||
// Some Yaesu rigs reject this command in FM mode
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ft991 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN)
|
||||
{
|
||||
|
@ -5635,7 +5662,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101)
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%c", cat_term);
|
||||
}
|
||||
|
@ -5723,7 +5750,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
break;
|
||||
|
||||
case RIG_FUNC_LOCK:
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ftdx5000 || is_ftdx101)
|
||||
if (is_ftdx1200 || is_ftdx3000 || is_ftdx5000 || is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
// These rigs can lock Main/Sub VFO dials individually
|
||||
*status = (retfunc[0] == '0' || retfunc[0] == '4') ? 0 : 1;
|
||||
|
@ -5900,7 +5927,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch)
|
|||
|
||||
chan_list = rig->caps->chan_list;
|
||||
|
||||
for (i = 0; i < CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
for (i = 0; i < HAMLIB_CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
{
|
||||
if (ch >= chan_list[i].startc &&
|
||||
ch <= chan_list[i].endc)
|
||||
|
@ -6225,7 +6252,7 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
|||
|
||||
chan_list = rig->caps->chan_list;
|
||||
|
||||
for (i = 0; i < CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
for (i = 0; i < HAMLIB_CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
{
|
||||
if (chan->channel_num >= chan_list[i].startc &&
|
||||
chan->channel_num <= chan_list[i].endc &&
|
||||
|
@ -6379,7 +6406,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
|||
|
||||
chan_list = rig->caps->chan_list;
|
||||
|
||||
for (i = 0; i < CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
for (i = 0; i < HAMLIB_CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
{
|
||||
if (chan->channel_num >= chan_list[i].startc &&
|
||||
chan->channel_num <= chan_list[i].endc)
|
||||
|
@ -6532,8 +6559,6 @@ const char *newcat_get_info(RIG *rig)
|
|||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
static char idbuf[129]; /* extra large static string array */
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
/* Build the command string */
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ID;");
|
||||
|
||||
|
@ -6542,13 +6567,13 @@ const char *newcat_get_info(RIG *rig)
|
|||
/* Get Identification Channel */
|
||||
if (RIG_OK != newcat_get_cmd(rig))
|
||||
{
|
||||
RETURNFUNC(NULL);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
priv->ret_data[6] = '\0';
|
||||
snprintf(idbuf, sizeof(idbuf), "%s", priv->ret_data);
|
||||
|
||||
RETURNFUNC(idbuf);
|
||||
return(idbuf);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6593,12 +6618,12 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command)
|
|||
is_ftdx5000 = newcat_is_rig(rig, RIG_MODEL_FTDX5000);
|
||||
is_ftdx1200 = newcat_is_rig(rig, RIG_MODEL_FTDX1200);
|
||||
is_ftdx3000 = newcat_is_rig(rig, RIG_MODEL_FTDX3000);
|
||||
is_ftdx101 = newcat_is_rig(rig, RIG_MODEL_FTDX101D);
|
||||
is_ftdx101d = newcat_is_rig(rig, RIG_MODEL_FTDX101D);
|
||||
is_ftdx101mp = newcat_is_rig(rig, RIG_MODEL_FTDX101MP);
|
||||
is_ftdx10 = newcat_is_rig(rig, RIG_MODEL_FTDX10);
|
||||
|
||||
if (!is_ft450 && !is_ft950 && !is_ft891 && !is_ft991 && !is_ft2000
|
||||
&& !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101
|
||||
&& !is_ftdx10)
|
||||
&& !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101d && !is_ftdx101mp && !is_ftdx10)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: '%s' is unknown\n", __func__, caps->model_name);
|
||||
RETURNFUNC(FALSE);
|
||||
|
@ -6669,7 +6694,11 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command)
|
|||
{
|
||||
RETURNFUNC(TRUE);
|
||||
}
|
||||
else if (is_ftdx101 && valid_commands[search_index].ft101)
|
||||
else if (is_ftdx101d && valid_commands[search_index].ft101d)
|
||||
{
|
||||
RETURNFUNC(TRUE);
|
||||
}
|
||||
else if (is_ftdx101mp && valid_commands[search_index].ft101mp)
|
||||
{
|
||||
RETURNFUNC(TRUE);
|
||||
}
|
||||
|
@ -6773,7 +6802,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
|
|||
p1 = p1 + 2; /* use non-Toggle commands */
|
||||
}
|
||||
|
||||
if (is_ftdx101)
|
||||
if (is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
// what other Yaeus rigs should be using this?
|
||||
// The DX101D returns FT0 when in split and not transmitting
|
||||
|
@ -6782,7 +6811,8 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
|
|||
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", command, p1, cat_term);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s, vfo=%s\n", priv->cmd_str, rig_strvfo(tx_vfo));
|
||||
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s, vfo=%s\n", priv->cmd_str,
|
||||
rig_strvfo(tx_vfo));
|
||||
|
||||
rig->state.tx_vfo = tx_vfo;
|
||||
|
||||
|
@ -6803,7 +6833,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
|
|||
|
||||
ENTERFUNC;
|
||||
|
||||
if (is_ftdx101)
|
||||
if (is_ftdx101d || is_ftdx101mp)
|
||||
{
|
||||
// what other Yaeus rigs should be using this?
|
||||
// The DX101D returns FT0 when in split and not transmitting
|
||||
|
@ -7659,7 +7689,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
RETURNFUNC(err);
|
||||
}
|
||||
} // end is_ftdx5000
|
||||
else if (is_ftdx101 || is_ftdx10)
|
||||
else if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
|
@ -7901,7 +7931,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
} /* end else */
|
||||
|
||||
if (is_ftdx101 || is_ft891)
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ft891)
|
||||
{
|
||||
// some rigs now require the bandwidth be turned "on"
|
||||
int on = is_ft891;
|
||||
|
@ -8903,7 +8933,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
|
|||
} /* end switch(mode) */
|
||||
|
||||
} /* end if is_ftdx5000 */
|
||||
else if (is_ftdx101 || is_ftdx10)
|
||||
else if (is_ftdx101d || is_ftdx101mp || is_ftdx10)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: is_ftdx101 w=%d, mode=%s\n", __func__, w,
|
||||
rig_strrmode(mode));
|
||||
|
@ -9657,13 +9687,17 @@ int newcat_set_cmd_validate(RIG *rig)
|
|||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: priv->cmd_str=%s\n", __func__, priv->cmd_str);
|
||||
|
||||
// For FA and FB rig.c now tries to verify the set_freq actually works
|
||||
// For example the FT-2000 can't do a FA set followed by an immediate read
|
||||
// We were using "ID" to verify the command but rig.c now does
|
||||
// a verifcation of frequency and retries if it doesn't match
|
||||
if ((strncmp(priv->cmd_str, "FA", 2) == 0) && (strlen(priv->cmd_str) > 3))
|
||||
{
|
||||
strcpy(valcmd, "FA;");
|
||||
strcpy(valcmd, ""); // No validation done -- rig.c now does followup query
|
||||
}
|
||||
else if ((strncmp(priv->cmd_str, "FB", 2) == 0) && (strlen(priv->cmd_str) > 3))
|
||||
{
|
||||
strcpy(valcmd, "FB;");
|
||||
strcpy(valcmd, ""); // No validation done -- rig.c now does followup query
|
||||
}
|
||||
else if ((strncmp(priv->cmd_str, "MD", 2) == 0) && (strlen(priv->cmd_str) > 3))
|
||||
{
|
||||
|
@ -9703,9 +9737,18 @@ int newcat_set_cmd_validate(RIG *rig)
|
|||
|
||||
if (rc != RIG_OK) { RETURNFUNC(-RIG_EIO); }
|
||||
|
||||
if (strlen(valcmd) == 0) { RETURNFUNC(RIG_OK); }
|
||||
|
||||
bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data),
|
||||
&cat_term, sizeof(cat_term));
|
||||
|
||||
// FA and FB success is now verified in rig.c with a followup query
|
||||
// so no validation is needed
|
||||
if (strncmp(priv->cmd_str, "FA", 2) == 0 || strncmp(priv->cmd_str, "FB", 2))
|
||||
{
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (strncmp(priv->cmd_str, "FT", 2) == 0
|
||||
&& strncmp(priv->ret_data, "FT", 2) == 0)
|
||||
{
|
||||
|
@ -9773,6 +9816,7 @@ int newcat_set_cmd(RIG *rig)
|
|||
|
||||
if (rc == RIG_OK)
|
||||
{
|
||||
// if we were able to set and and validate we're done
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_validate OK\n", __func__);
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
@ -9797,6 +9841,15 @@ int newcat_set_cmd(RIG *rig)
|
|||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
// freq set and ptt are now verified in rig.c
|
||||
if (strncmp(priv->cmd_str, "FA", 2) == 0
|
||||
|| strncmp(priv->cmd_str, "FB", 2) == 0
|
||||
|| strncmp(priv->cmd_str, "TX", 2) == 0)
|
||||
{
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
if (strncmp(priv->cmd_str, "BS", 2) == 0)
|
||||
{
|
||||
// the BS command needs time to do it's thing
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
typedef char ncboolean;
|
||||
|
||||
/* shared function version */
|
||||
#define NEWCAT_VER "20210213"
|
||||
#define NEWCAT_VER "20210309"
|
||||
|
||||
/* Hopefully large enough for future use, 128 chars plus '\0' */
|
||||
#define NEWCAT_DATA_LEN 129
|
||||
|
|
|
@ -648,7 +648,7 @@ int find_tuning_step(RIG *rig, vfo_t vfo, rmode_t mode, shortfreq_t *ts)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < TSLSTSIZ; i++)
|
||||
for (i = 0; i < HAMLIB_TSLSTSIZ; i++)
|
||||
{
|
||||
if ((rig->caps->tuning_steps[i].modes & mode) != 0)
|
||||
{
|
||||
|
@ -667,7 +667,7 @@ int check_tuning_step(RIG *rig, vfo_t vfo, rmode_t mode, shortfreq_t ts)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < TSLSTSIZ; i++)
|
||||
for (i = 0; i < HAMLIB_TSLSTSIZ; i++)
|
||||
{
|
||||
if (rig->caps->tuning_steps[i].ts == ts &&
|
||||
((rig->caps->tuning_steps[i].modes & mode) != 0))
|
||||
|
|
|
@ -104,7 +104,7 @@ const struct rig_caps vx1700_caps =
|
|||
RIG_MODEL(RIG_MODEL_VX1700),
|
||||
.model_name = "VX-1700",
|
||||
.mfg_name = "Vertex Standard",
|
||||
.version = "20200320.0",
|
||||
.version = "20210221.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_ALPHA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -702,6 +702,10 @@ static int vx1700_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
{
|
||||
(void) vfo;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: freq=%f\n", __func__, tx_freq);
|
||||
int err = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
|
||||
return vx1700_do_freq_cmd(rig, VX1700_NATIVE_TX_FREQ_SET, tx_freq);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue