kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' into async-reader
commit
39cec4aa27
|
@ -494,7 +494,7 @@ const
|
|||
RIG_FUNC_ANF = (1 shl 8); {* Automatic Notch Filter (DSP); *}
|
||||
RIG_FUNC_NR = (1 shl 9); {* Noise Reduction (DSP); *}
|
||||
RIG_FUNC_AIP = (1 shl 10); {* AIP (Kenwood); *}
|
||||
RIG_FUNC_APF = (1 shl 11); {* Auto Passband Filter *}
|
||||
RIG_FUNC_APF = (1 shl 11); {* Audio Peak Filter *}
|
||||
RIG_FUNC_MON = (1 shl 12); {* Monitor transmitted signal, != rev *}
|
||||
RIG_FUNC_MN = (1 shl 13); {* Manual Notch (Icom); *}
|
||||
RIG_FUNC_RF = (1 shl 14); {* RTTY Filter (Icom); TNX AD7AI -- N0NB *}
|
||||
|
|
|
@ -1088,7 +1088,7 @@ typedef uint64_t setting_t;
|
|||
#define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */
|
||||
#define RIG_FUNC_NR CONSTANT_64BIT_FLAG (9) /*!< \c NR -- Noise Reduction (DSP) */
|
||||
#define RIG_FUNC_AIP CONSTANT_64BIT_FLAG (10) /*!< \c AIP -- RF pre-amp (AIP on Kenwood, IPO on Yaesu, etc.) */
|
||||
#define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11) /*!< \c APF -- Auto Passband/Audio Peak Filter */
|
||||
#define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11) /*!< \c APF -- Audio Peak Filter */
|
||||
#define RIG_FUNC_MON CONSTANT_64BIT_FLAG (12) /*!< \c MON -- Monitor transmitted signal */
|
||||
#define RIG_FUNC_MN CONSTANT_64BIT_FLAG (13) /*!< \c MN -- Manual Notch */
|
||||
#define RIG_FUNC_RF CONSTANT_64BIT_FLAG (14) /*!< \c RF -- RTTY Filter */
|
||||
|
|
|
@ -49,6 +49,8 @@ struct netrigctl_priv_data
|
|||
{
|
||||
vfo_t vfo_curr;
|
||||
int rigctld_vfo_mode;
|
||||
vfo_t rx_vfo;
|
||||
vfo_t tx_vfo;
|
||||
};
|
||||
|
||||
int netrigctl_get_vfo_mode(RIG *rig)
|
||||
|
@ -120,6 +122,8 @@ static int netrigctl_vfostr(RIG *rig, char *vfostr, int len, vfo_t vfo)
|
|||
|
||||
if (vfo == RIG_VFO_NONE) { vfo = RIG_VFO_A; }
|
||||
}
|
||||
else if (vfo == RIG_VFO_RX) vfo = priv->rx_vfo;
|
||||
else if (vfo == RIG_VFO_TX) vfo = priv->tx_vfo;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, rig->state.vfo_opt);
|
||||
|
||||
|
@ -262,6 +266,8 @@ static int netrigctl_open(RIG *rig)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
priv = (struct netrigctl_priv_data *)rig->state.priv;
|
||||
priv->rx_vfo = RIG_VFO_A;
|
||||
priv->tx_vfo = RIG_VFO_B;
|
||||
|
||||
len = sprintf(cmd, "\\chk_vfo\n");
|
||||
ret = netrigctl_transaction(rig, cmd, len, buf);
|
||||
|
@ -621,7 +627,10 @@ static int netrigctl_open(RIG *rig)
|
|||
rs->mode_list |= rs->tx_range_list[i].modes;
|
||||
rs->vfo_list |= rs->tx_range_list[i].vfo;
|
||||
}
|
||||
if (rs->vfo_list == 0) rs->vfo_list = RIG_VFO_A|RIG_VFO_B;
|
||||
if (rs->vfo_list == 0) {
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo_list empty, defaulting to A/B\n", __func__);
|
||||
rs->vfo_list = RIG_VFO_A|RIG_VFO_B;
|
||||
}
|
||||
|
||||
if (prot_ver == 0) { return RIG_OK; }
|
||||
|
||||
|
@ -2570,7 +2579,7 @@ struct rig_caps netrigctl_caps =
|
|||
RIG_MODEL(RIG_MODEL_NETRIGCTL),
|
||||
.model_name = "NET rigctl",
|
||||
.mfg_name = "Hamlib",
|
||||
.version = "20211107.0",
|
||||
.version = "20211118.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_OTHER,
|
||||
|
|
|
@ -248,7 +248,7 @@ const struct rig_caps ic7610_caps =
|
|||
RIG_MODEL(RIG_MODEL_IC7610),
|
||||
.model_name = "IC-7610",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".3",
|
||||
.version = BACKEND_VER ".4",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -477,5 +477,6 @@ const struct rig_caps ic7610_caps =
|
|||
.get_powerstat = icom_get_powerstat,
|
||||
.send_morse = icom_send_morse,
|
||||
.stop_morse = icom_stop_morse,
|
||||
.wait_morse = rig_wait_morse
|
||||
.wait_morse = rig_wait_morse,
|
||||
.send_voice_mem = rig_send_voice_mem
|
||||
};
|
||||
|
|
|
@ -1057,7 +1057,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
|
|||
char vfo_function;
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
||||
|
||||
/* Emulations do not need to set VFO since VFOB is a copy of VFOA
|
||||
|
@ -1088,6 +1088,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
|
|||
break;
|
||||
|
||||
case RIG_VFO_CURR:
|
||||
rig->state.current_vfo = RIG_VFO_CURR;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
default:
|
||||
|
@ -1149,6 +1150,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
|
|||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
rig->state.current_vfo = vfo;
|
||||
|
||||
/* if FN command then there's no FT or FR */
|
||||
/* If split mode on, the don't change TxVFO */
|
||||
|
@ -1518,8 +1520,8 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split,
|
|||
}
|
||||
|
||||
priv->tx_vfo = *txvfo;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->tx_vfo=%s\n", __func__,
|
||||
rig_strvfo(priv->tx_vfo));
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->tx_vfo=%s, split=%d\n", __func__,
|
||||
rig_strvfo(priv->tx_vfo), *split);
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
@ -2053,7 +2055,10 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
char kmode;
|
||||
char buf[6];
|
||||
char data_mode = '0';
|
||||
char *data_cmd = "DA";
|
||||
int err;
|
||||
int datamode = 0;
|
||||
int needdata;
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
||||
|
||||
|
@ -2089,6 +2094,7 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
/* emulations like PowerSDR and SmartSDR normally hijack the
|
||||
RTTY modes for SSB-DATA AFSK modes */
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: emulate=%d, HPSDR=%d, changing PKT mode to RTTY\n", __func__, priv->is_emulation, RIG_IS_HPSDR);
|
||||
if (RIG_MODE_PKTLSB == mode) { mode = RIG_MODE_RTTY; }
|
||||
|
||||
if (RIG_MODE_PKTUSB == mode) { mode = RIG_MODE_RTTYR; }
|
||||
|
@ -2149,12 +2155,6 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
pbwidth_t twidth;
|
||||
err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth);
|
||||
|
||||
// only change mode if needed
|
||||
if (priv->curr_mode != mode)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "MD%c", c);
|
||||
err = kenwood_transaction(rig, buf, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
|
@ -2167,20 +2167,35 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|| RIG_MODE_RTTY == mode
|
||||
|| RIG_MODE_RTTYR == mode))
|
||||
{
|
||||
char *data_cmd = "DA";
|
||||
|
||||
if (RIG_IS_TS950S || RIG_IS_TS950SDX)
|
||||
{
|
||||
data_cmd = "DT";
|
||||
}
|
||||
|
||||
/* supports DATA sub modes - see above */
|
||||
snprintf(buf, sizeof(buf), "%s%c", data_cmd, data_mode);
|
||||
err = kenwood_transaction(rig, buf, NULL, 0);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
datamode = 1;
|
||||
}
|
||||
}
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: curr_mode=%s, new_mode=%s\n", __func__, rig_strrmode(priv->curr_mode), rig_strrmode(mode));
|
||||
// only change mode if needed
|
||||
if (priv->curr_mode != mode)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "MD%c", c);
|
||||
err = kenwood_transaction(rig, buf, NULL, 0);
|
||||
}
|
||||
needdata = 0;
|
||||
if ((vfo == RIG_VFO_A) && ((priv->datamodeA == 0 && datamode) || (priv->datamodeA == 1 && !datamode)))
|
||||
needdata = 1;
|
||||
if ((vfo == RIG_VFO_B) && ((priv->datamodeB == 0 && datamode) || (priv->datamodeB == 1 && !datamode)))
|
||||
needdata = 1;
|
||||
|
||||
if (needdata)
|
||||
{
|
||||
/* supports DATA sub modes - see above */
|
||||
snprintf(buf, sizeof(buf), "%s%c", data_cmd, data_mode);
|
||||
err = kenwood_transaction(rig, buf, NULL, 0);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
}
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) { RETURNFUNC(RIG_OK); }
|
||||
|
||||
|
@ -2401,6 +2416,7 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
{
|
||||
/* emulations like PowerSDR and SmartSDR normally hijack the
|
||||
RTTY modes for SSB-DATA AFSK modes */
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: emulate=%d, HPSDR=%d, changing RTTY mode to PKT\n", __func__, priv->is_emulation, RIG_IS_HPSDR);
|
||||
if (RIG_MODE_RTTY == *mode) { *mode = RIG_MODE_PKTLSB; }
|
||||
|
||||
if (RIG_MODE_RTTYR == *mode) { *mode = RIG_MODE_PKTUSB; }
|
||||
|
@ -2418,6 +2434,8 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
|
||||
if ('1' == modebuf[2])
|
||||
{
|
||||
if (vfo == RIG_VFO_A) priv->datamodeA = 1;
|
||||
else priv->datamodeB = 1;
|
||||
switch (*mode)
|
||||
{
|
||||
case RIG_MODE_USB: *mode = RIG_MODE_PKTUSB; break;
|
||||
|
@ -2426,9 +2444,16 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
|
||||
case RIG_MODE_FM: *mode = RIG_MODE_PKTFM; break;
|
||||
|
||||
case RIG_MODE_AM: *mode = RIG_MODE_PKTAM; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vfo == RIG_VFO_A) priv->datamodeA = 0;
|
||||
else priv->datamodeB = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (RIG_IS_TS480)
|
||||
|
@ -2447,6 +2472,9 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
{
|
||||
*width = rig_passband_normal(rig, *mode);
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_A) priv->modeA = *mode;
|
||||
else priv->modeB = *mode;
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "token.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define BACKEND_VER "20211109"
|
||||
#define BACKEND_VER "20211118"
|
||||
|
||||
#define EOM_KEN ';'
|
||||
#define EOM_TH '\r'
|
||||
|
@ -166,6 +166,10 @@ struct kenwood_priv_data
|
|||
int is_k4hd;
|
||||
int no_id; // if true will not send ID; with every set command
|
||||
int opened; // true once rig_open is called to avoid setting VFOA every open call
|
||||
rmode_t modeA;
|
||||
rmode_t modeB;
|
||||
int datamodeA; // datamode status from get_mode or set_mode
|
||||
int datamodeB; // datamode status from get_mode or set_mode
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -73,12 +73,75 @@ const struct confparams ftdx1200_ext_levels[] =
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_APF_FREQ,
|
||||
"APF_FREQ",
|
||||
"APF frequency",
|
||||
"Audio peak filter frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -250, .max = 250, .step = 10 } },
|
||||
},
|
||||
{
|
||||
TOK_APF_WIDTH,
|
||||
"APF_WIDTH",
|
||||
"APF width",
|
||||
"Audio peak filter width",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "Narrow", "Medium", "Wide", NULL } } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 100, .max = 4000, .step = 100 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ftdx1200_ext_tokens[] =
|
||||
{
|
||||
TOK_ROOFING_FILTER, TOK_BACKEND_NONE
|
||||
TOK_ROOFING_FILTER, TOK_KEYER, TOK_APF_FREQ, TOK_APF_WIDTH,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -74,12 +74,57 @@ const struct confparams ft2000_ext_levels[] =
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 100, .max = 4000, .step = 100 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ft2000_ext_tokens[] =
|
||||
{
|
||||
TOK_ROOFING_FILTER, TOK_BACKEND_NONE
|
||||
TOK_ROOFING_FILTER, TOK_KEYER,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\
|
||||
RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\
|
||||
RIG_FUNC_RIT|RIG_FUNC_XIT|\
|
||||
RIG_FUNC_TUNER)
|
||||
RIG_FUNC_TUNER|RIG_FUNC_APF)
|
||||
|
||||
#define FT2000_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\
|
||||
RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\
|
||||
|
|
|
@ -77,12 +77,75 @@ const struct confparams ftdx3000_ext_levels[] =
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_APF_FREQ,
|
||||
"APF_FREQ",
|
||||
"APF frequency",
|
||||
"Audio peak filter frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -250, .max = 250, .step = 10 } },
|
||||
},
|
||||
{
|
||||
TOK_APF_WIDTH,
|
||||
"APF_WIDTH",
|
||||
"APF width",
|
||||
"Audio peak filter width",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "Narrow", "Medium", "Wide", NULL } } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 100, .max = 4000, .step = 100 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ftdx3000_ext_tokens[] =
|
||||
{
|
||||
TOK_ROOFING_FILTER, TOK_BACKEND_NONE
|
||||
TOK_ROOFING_FILTER, TOK_KEYER, TOK_APF_FREQ, TOK_APF_WIDTH,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
int ft3000_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
||||
|
|
|
@ -75,12 +75,66 @@ const struct confparams ftdx5000_ext_levels[] =
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_APF_WIDTH,
|
||||
"APF_WIDTH",
|
||||
"APF width",
|
||||
"Audio peak filter width",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "S. Narrow", "Narrow", "Medium", "Wide", NULL } } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 100, .max = 4000, .step = 100 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ftdx5000_ext_tokens[] =
|
||||
{
|
||||
TOK_ROOFING_FILTER, TOK_BACKEND_NONE
|
||||
TOK_ROOFING_FILTER, TOK_KEYER, TOK_APF_WIDTH,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
const struct rig_caps ftdx5000_caps =
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\
|
||||
RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\
|
||||
RIG_FUNC_RIT|RIG_FUNC_XIT|\
|
||||
RIG_FUNC_TUNER)
|
||||
RIG_FUNC_TUNER|RIG_FUNC_APF)
|
||||
|
||||
/* TBC */
|
||||
#define FTDX5000_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\
|
||||
|
|
|
@ -50,6 +50,79 @@ static int ft891_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t
|
|||
static int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft891_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
|
||||
|
||||
const struct confparams ft891_ext_levels[] =
|
||||
{
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_APF_FREQ,
|
||||
"APF_FREQ",
|
||||
"APF frequency",
|
||||
"Audio peak filter frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -250, .max = 250, .step = 10 } },
|
||||
},
|
||||
{
|
||||
TOK_APF_WIDTH,
|
||||
"APF_WIDTH",
|
||||
"APF width",
|
||||
"Audio peak filter width",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "Narrow", "Medium", "Wide", NULL } } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 10, .max = 3200, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ft891_ext_tokens[] =
|
||||
{
|
||||
TOK_KEYER, TOK_APF_FREQ, TOK_APF_WIDTH,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
* FT-891 rig capabilities
|
||||
*/
|
||||
|
@ -190,6 +263,9 @@ const struct rig_caps ft891_caps =
|
|||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.ext_tokens = ft891_ext_tokens,
|
||||
.extlevels = ft891_ext_levels,
|
||||
|
||||
.priv = NULL, /* private data FIXME: */
|
||||
|
||||
.rig_init = ft891_init,
|
||||
|
@ -237,6 +313,8 @@ const struct rig_caps ft891_caps =
|
|||
.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,
|
||||
.send_morse = newcat_send_morse,
|
||||
};
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#define FT891_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\
|
||||
RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\
|
||||
RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\
|
||||
RIG_FUNC_TUNER)
|
||||
RIG_FUNC_TUNER|RIG_FUNC_APF)
|
||||
|
||||
#define FT891_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\
|
||||
RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\
|
||||
|
|
|
@ -62,6 +62,79 @@ static int ft991_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
|
|||
static int ft991_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code);
|
||||
static int ft991_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
|
||||
|
||||
const struct confparams ft991_ext_levels[] =
|
||||
{
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_APF_FREQ,
|
||||
"APF_FREQ",
|
||||
"APF frequency",
|
||||
"Audio peak filter frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -250, .max = 250, .step = 10 } },
|
||||
},
|
||||
{
|
||||
TOK_APF_WIDTH,
|
||||
"APF_WIDTH",
|
||||
"APF width",
|
||||
"Audio peak filter width",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "Narrow", "Medium", "Wide", NULL } } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 10, .max = 3200, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ft991_ext_tokens[] =
|
||||
{
|
||||
TOK_KEYER, TOK_APF_FREQ, TOK_APF_WIDTH,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
* FT-991 rig capabilities
|
||||
*/
|
||||
|
@ -194,6 +267,9 @@ const struct rig_caps ft991_caps =
|
|||
RIG_FLT_END,
|
||||
},
|
||||
|
||||
.ext_tokens = ft991_ext_tokens,
|
||||
.extlevels = ft991_ext_levels,
|
||||
|
||||
.priv = NULL, /* private data FIXME: */
|
||||
|
||||
.rig_init = ft991_init,
|
||||
|
@ -249,6 +325,8 @@ const struct rig_caps ft991_caps =
|
|||
.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,
|
||||
.send_morse = newcat_send_morse,
|
||||
.send_voice_mem = newcat_send_voice_mem,
|
||||
};
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\
|
||||
RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\
|
||||
RIG_FUNC_RIT|RIG_FUNC_XIT|\
|
||||
RIG_FUNC_TUNER)
|
||||
RIG_FUNC_TUNER|RIG_FUNC_APF)
|
||||
|
||||
#define FT991_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\
|
||||
RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\
|
||||
|
|
|
@ -63,12 +63,75 @@ const struct confparams ftdx10_ext_levels[] =
|
|||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "AUTO", "12 kHz", "3 kHz", "500 Hz", "300 Hz (optional)", NULL } } }
|
||||
},
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_APF_FREQ,
|
||||
"APF_FREQ",
|
||||
"APF frequency",
|
||||
"Audio peak filter frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -250, .max = 250, .step = 10 } },
|
||||
},
|
||||
{
|
||||
TOK_APF_WIDTH,
|
||||
"APF_WIDTH",
|
||||
"APF width",
|
||||
"Audio peak filter width",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "Narrow", "Medium", "Wide", NULL } } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 10, .max = 3200, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ftdx10_ext_tokens[] =
|
||||
{
|
||||
TOK_ROOFING_FILTER, TOK_BACKEND_NONE
|
||||
TOK_ROOFING_FILTER, TOK_KEYER, TOK_APF_FREQ, TOK_APF_WIDTH,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
const struct rig_caps ftdx10_caps =
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#define FTDX10_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\
|
||||
RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\
|
||||
RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\
|
||||
RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER)
|
||||
RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF)
|
||||
|
||||
/* TBC */
|
||||
#define FTDX10_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\
|
||||
|
|
|
@ -63,12 +63,75 @@ const struct confparams ftdx101d_ext_levels[] =
|
|||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "AUTO", "12 kHz", "3 kHz", "1.2 kHz (optional)", "600 Hz", "300 Hz (optional)", NULL } } }
|
||||
},
|
||||
{
|
||||
TOK_KEYER,
|
||||
"KEYER",
|
||||
"Keyer",
|
||||
"Keyer on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_APF_FREQ,
|
||||
"APF_FREQ",
|
||||
"APF frequency",
|
||||
"Audio peak filter frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -250, .max = 250, .step = 10 } },
|
||||
},
|
||||
{
|
||||
TOK_APF_WIDTH,
|
||||
"APF_WIDTH",
|
||||
"APF width",
|
||||
"Audio peak filter width",
|
||||
NULL,
|
||||
RIG_CONF_COMBO,
|
||||
{ .c = { .combostr = { "Narrow", "Medium", "Wide", NULL } } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR,
|
||||
"CONTOUR",
|
||||
"Contour",
|
||||
"Contour on/off",
|
||||
NULL,
|
||||
RIG_CONF_CHECKBUTTON,
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_FREQ,
|
||||
"CONTOUR_FREQ",
|
||||
"Contour frequency",
|
||||
"Contour frequency",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 10, .max = 3200, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_LEVEL,
|
||||
"CONTOUR_LEVEL",
|
||||
"Contour level",
|
||||
"Contour level (dB)",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = -40, .max = 20, .step = 1 } },
|
||||
},
|
||||
{
|
||||
TOK_CONTOUR_WIDTH,
|
||||
"CONTOUR_WIDTH",
|
||||
"Contour width",
|
||||
"Contour width",
|
||||
NULL,
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
||||
int ftdx101d_ext_tokens[] =
|
||||
{
|
||||
TOK_ROOFING_FILTER, TOK_BACKEND_NONE
|
||||
TOK_ROOFING_FILTER, TOK_KEYER, TOK_APF_FREQ, TOK_APF_WIDTH,
|
||||
TOK_CONTOUR, TOK_CONTOUR_FREQ, TOK_CONTOUR_LEVEL, TOK_CONTOUR_WIDTH,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
const struct rig_caps ftdx101d_caps =
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
#define FTDX101_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\
|
||||
RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\
|
||||
RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\
|
||||
RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER)
|
||||
RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF)
|
||||
|
||||
/* TBC */
|
||||
#define FTDX101_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\
|
||||
|
|
|
@ -391,6 +391,18 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index);
|
|||
static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width);
|
||||
static int get_roofing_filter(RIG *rig, vfo_t vfo,
|
||||
struct newcat_roofing_filter **roofing_filter);
|
||||
static int newcat_set_apf_frequency(RIG *rig, vfo_t vfo, int freq);
|
||||
static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq);
|
||||
static int newcat_set_apf_width(RIG *rig, vfo_t vfo, int choice);
|
||||
static int newcat_get_apf_width(RIG *rig, vfo_t vfo, int *choice);
|
||||
static int newcat_set_contour(RIG *rig, vfo_t vfo, int status);
|
||||
static int newcat_get_contour(RIG *rig, vfo_t vfo, int *status);
|
||||
static int newcat_set_contour_frequency(RIG *rig, vfo_t vfo, int freq);
|
||||
static int newcat_get_contour_frequency(RIG *rig, vfo_t vfo, int *freq);
|
||||
static int newcat_set_contour_level(RIG *rig, vfo_t vfo, int level);
|
||||
static int newcat_get_contour_level(RIG *rig, vfo_t vfo, int *level);
|
||||
static int newcat_set_contour_width(RIG *rig, vfo_t vfo, int width);
|
||||
static int newcat_get_contour_width(RIG *rig, vfo_t vfo, int *width);
|
||||
static ncboolean newcat_valid_command(RIG *rig, char const *const command);
|
||||
|
||||
/*
|
||||
|
@ -5575,6 +5587,27 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|||
cat_term);
|
||||
break;
|
||||
|
||||
case RIG_FUNC_APF:
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c2%04d%c", main_sub_vfo, status ? 1 : 0, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO02%04d%c", status ? 1 : 0, cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c0%02d%c", main_sub_vfo, status ? 2 : 0, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO00%02d%c", status ? 2 : 0, cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
@ -5796,6 +5829,25 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "XT%c", cat_term);
|
||||
break;
|
||||
|
||||
case RIG_FUNC_APF:
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c2%c", main_sub_vfo, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO02%c", cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c0%c", main_sub_vfo, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO00%c", cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
@ -5877,6 +5929,21 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
*status = (retfunc[0] == '1') ? 1 : 0;
|
||||
break;
|
||||
|
||||
case RIG_FUNC_APF:
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
*status = (retfunc[last_char_index] == '1') ? 1 : 0;
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
*status = (retfunc[last_char_index] == '1') ? 1 : 0;
|
||||
} else if (is_ftdx5000) {
|
||||
*status = (retfunc[last_char_index] == '2') ? 1 : 0;
|
||||
} else if (is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
*status = (retfunc[last_char_index] == '2') ? 1 : 0;
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
@ -5903,6 +5970,8 @@ int newcat_get_parm(RIG *rig, setting_t parm, value_t *val)
|
|||
|
||||
int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
switch (token)
|
||||
|
@ -5910,6 +5979,35 @@ int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
|
|||
case TOK_ROOFING_FILTER:
|
||||
RETURNFUNC(set_roofing_filter(rig, vfo, val.i));
|
||||
|
||||
case TOK_KEYER:
|
||||
if (!newcat_valid_command(rig, "ML"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KR%d%c", val.i ? 1 : 0,
|
||||
cat_term);
|
||||
|
||||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
|
||||
case TOK_APF_FREQ:
|
||||
RETURNFUNC(newcat_set_apf_frequency(rig, vfo, val.f));
|
||||
|
||||
case TOK_APF_WIDTH:
|
||||
RETURNFUNC(newcat_set_apf_width(rig, vfo, val.i));
|
||||
|
||||
case TOK_CONTOUR:
|
||||
RETURNFUNC(newcat_set_contour(rig, vfo, val.i));
|
||||
|
||||
case TOK_CONTOUR_FREQ:
|
||||
RETURNFUNC(newcat_set_contour_frequency(rig, vfo, val.f));
|
||||
|
||||
case TOK_CONTOUR_LEVEL:
|
||||
RETURNFUNC(newcat_set_contour_level(rig, vfo, val.f));
|
||||
|
||||
case TOK_CONTOUR_WIDTH:
|
||||
RETURNFUNC(newcat_set_contour_width(rig, vfo, val.f));
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported ext level %s\n", __func__,
|
||||
rig_strlevel(token));
|
||||
|
@ -5919,7 +6017,10 @@ int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
|
|||
|
||||
int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
char *result;
|
||||
int retval;
|
||||
int value;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
|
@ -5939,6 +6040,95 @@ int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
|
|||
break;
|
||||
}
|
||||
|
||||
case TOK_KEYER:
|
||||
if (!newcat_valid_command(rig, "KR"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KR%c", cat_term);
|
||||
|
||||
retval = newcat_get_cmd(rig);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
/* skip command */
|
||||
result = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
/* chop term */
|
||||
priv->ret_data[strlen(priv->ret_data) - 1] = '\0';
|
||||
|
||||
val->i = result[0] == '0' ? 0 : 1;
|
||||
break;
|
||||
|
||||
case TOK_APF_FREQ:
|
||||
retval = newcat_get_apf_frequency(rig, vfo, &value);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
val->f = value;
|
||||
break;
|
||||
|
||||
case TOK_APF_WIDTH:
|
||||
retval = newcat_get_apf_width(rig, vfo, &value);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
val->i = value;
|
||||
break;
|
||||
|
||||
case TOK_CONTOUR:
|
||||
retval = newcat_get_contour(rig, vfo, &value);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
val->i = value;
|
||||
break;
|
||||
|
||||
case TOK_CONTOUR_WIDTH:
|
||||
retval = newcat_get_contour_width(rig, vfo, &value);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
val->f = value;
|
||||
break;
|
||||
|
||||
case TOK_CONTOUR_FREQ:
|
||||
retval = newcat_get_contour_frequency(rig, vfo, &value);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
val->f = value;
|
||||
break;
|
||||
|
||||
case TOK_CONTOUR_LEVEL:
|
||||
retval = newcat_get_contour_level(rig, vfo, &value);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
val->f = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported ext level %s\n", __func__,
|
||||
rig_strlevel(token));
|
||||
|
@ -10214,3 +10404,431 @@ int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
|
|||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
}
|
||||
|
||||
static int newcat_set_apf_frequency(RIG *rig, vfo_t vfo, int freq)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
|
||||
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
// Range seems to be -250..250 Hz in 10 Hz steps
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c3%04d%c", main_sub_vfo, (freq + 250) / 10, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO03%04d%c", (freq + 250) / 10, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO02%02d%c", (freq + 250) / 10, cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
}
|
||||
|
||||
static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
|
||||
int err;
|
||||
int ret_data_len;
|
||||
char *ret_data;
|
||||
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c3%c", main_sub_vfo, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO03%c", cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO02%c", cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
if ((err = newcat_get_cmd(rig)) != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
ret_data_len = strlen(priv->ret_data);
|
||||
|
||||
/* skip command */
|
||||
ret_data = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ret_data='%s'\n", __func__, ret_data);
|
||||
/* chop term */
|
||||
priv->ret_data[ret_data_len - 1] = '\0';
|
||||
|
||||
int raw_value = atoi(ret_data);
|
||||
|
||||
// Range seems to be -250..250 Hz in 10 Hz steps
|
||||
*freq = raw_value * 10 - 250;
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
static int newcat_set_apf_width(RIG *rig, vfo_t vfo, int choice)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
|
||||
if (!newcat_valid_command(rig, "EX"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX030201%d%c", choice, cat_term);
|
||||
} else if (is_ft991) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX111%d%c", choice, cat_term);
|
||||
} else if (is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX1201%d%c", choice, cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX112%d%c", choice, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX107%d%c", choice, cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
}
|
||||
|
||||
static int newcat_get_apf_width(RIG *rig, vfo_t vfo, int *choice)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
int err;
|
||||
int ret_data_len;
|
||||
char *ret_data;
|
||||
|
||||
if (!newcat_valid_command(rig, "EX"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX030201%c", cat_term);
|
||||
} else if (is_ft991) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX111%c", cat_term);
|
||||
} else if (is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX1201%c", cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX112%c", cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX107%c", cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
if ((err = newcat_get_cmd(rig)) != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
ret_data_len = strlen(priv->ret_data);
|
||||
|
||||
/* skip command */
|
||||
ret_data = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ret_data='%s'\n", __func__, ret_data);
|
||||
/* chop term */
|
||||
priv->ret_data[ret_data_len - 1] = '\0';
|
||||
|
||||
*choice = atoi(ret_data);
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
static int newcat_set_contour(RIG *rig, vfo_t vfo, int status)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
|
||||
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c0%04d%c", main_sub_vfo, status ? 1 : 0, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO00%04d%c", status ? 1 : 0, cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c0%02d%c", main_sub_vfo, status ? 1 : 0, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO00%02d%c", status ? 1 : 0, cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
}
|
||||
|
||||
static int newcat_get_contour(RIG *rig, vfo_t vfo, int *status)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
|
||||
int err;
|
||||
int ret_data_len;
|
||||
char *ret_data;
|
||||
int last_char_index;
|
||||
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c0%c", main_sub_vfo, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO00%c", cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c0%c", main_sub_vfo, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO00%c", cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
if ((err = newcat_get_cmd(rig)) != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
ret_data_len = strlen(priv->ret_data);
|
||||
|
||||
/* skip command */
|
||||
ret_data = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ret_data='%s'\n", __func__, ret_data);
|
||||
/* chop term */
|
||||
priv->ret_data[ret_data_len - 1] = '\0';
|
||||
|
||||
last_char_index = strlen(ret_data) - 1;
|
||||
|
||||
*status = (ret_data[last_char_index] == '1') ? 1 : 0;
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
static int newcat_set_contour_frequency(RIG *rig, vfo_t vfo, int freq)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
|
||||
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
// Range is 10..3200 Hz
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c1%04d%c", main_sub_vfo, freq, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
// Range is 10..3200 Hz
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO01%04d%c", freq, cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
// Range is 100..4000 Hz in 100 Hz steps
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c1%01d%c", main_sub_vfo, freq / 100, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
// Range is 100..4000 Hz in 100 Hz steps
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO01%02d%c", freq / 100, cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
}
|
||||
|
||||
static int newcat_get_contour_frequency(RIG *rig, vfo_t vfo, int *freq)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
|
||||
int err;
|
||||
int ret_data_len;
|
||||
char *ret_data;
|
||||
|
||||
if (!newcat_valid_command(rig, "CO"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c1%c", main_sub_vfo, cat_term);
|
||||
} else if (is_ftdx10 || is_ft991 || is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO01%c", cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO%c1%c", main_sub_vfo, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CO01%c", cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
if ((err = newcat_get_cmd(rig)) != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
ret_data_len = strlen(priv->ret_data);
|
||||
|
||||
/* skip command */
|
||||
ret_data = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ret_data='%s'\n", __func__, ret_data);
|
||||
/* chop term */
|
||||
priv->ret_data[ret_data_len - 1] = '\0';
|
||||
|
||||
int raw_value = atoi(ret_data);
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10 || is_ft991 || is_ft891) {
|
||||
*freq = raw_value;
|
||||
} else if (is_ftdx5000 || is_ftdx3000 || is_ftdx1200 || is_ft2000) {
|
||||
*freq = raw_value * 100;
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
static int newcat_set_contour_level(RIG *rig, vfo_t vfo, int level)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
|
||||
if (!newcat_valid_command(rig, "EX"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX030202%+03d%c", level, cat_term);
|
||||
} else if (is_ft991) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX112%+03d%c", level, cat_term);
|
||||
} else if (is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX1202%+03d%c", level, cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX113%+03d%c", level, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX108%+03d%c", level, cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
}
|
||||
|
||||
static int newcat_get_contour_level(RIG *rig, vfo_t vfo, int *level)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
int err;
|
||||
int ret_data_len;
|
||||
char *ret_data;
|
||||
|
||||
if (!newcat_valid_command(rig, "EX"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX030202%c", cat_term);
|
||||
} else if (is_ft991) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX112%c", cat_term);
|
||||
} else if (is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX1202%c", cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX113%c", cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX108%c", cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
if ((err = newcat_get_cmd(rig)) != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
ret_data_len = strlen(priv->ret_data);
|
||||
|
||||
/* skip command */
|
||||
ret_data = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ret_data='%s'\n", __func__, ret_data);
|
||||
/* chop term */
|
||||
priv->ret_data[ret_data_len - 1] = '\0';
|
||||
|
||||
*level = atoi(ret_data);
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
static int newcat_set_contour_width(RIG *rig, vfo_t vfo, int width)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
|
||||
if (!newcat_valid_command(rig, "EX"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX030203%02d%c", width, cat_term);
|
||||
} else if (is_ft991) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX113%02d%c", width, cat_term);
|
||||
} else if (is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX1203%02d%c", width, cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX114%02d%c", width, cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX109%02d%c", width, cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
RETURNFUNC(newcat_set_cmd(rig));
|
||||
}
|
||||
|
||||
static int newcat_get_contour_width(RIG *rig, vfo_t vfo, int *width)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
int err;
|
||||
int ret_data_len;
|
||||
char *ret_data;
|
||||
|
||||
if (!newcat_valid_command(rig, "EX"))
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
||||
if (is_ftdx101d || is_ftdx101mp || is_ftdx10) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX030203%c", cat_term);
|
||||
} else if (is_ft991) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX113%c", cat_term);
|
||||
} else if (is_ft891) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX1203%c", cat_term);
|
||||
} else if (is_ftdx5000) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX114%c", cat_term);
|
||||
} else if (is_ftdx3000 || is_ftdx1200) {
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX109%c", cat_term);
|
||||
} else {
|
||||
RETURNFUNC(-RIG_ENIMPL);
|
||||
}
|
||||
|
||||
if ((err = newcat_get_cmd(rig)) != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
ret_data_len = strlen(priv->ret_data);
|
||||
|
||||
/* skip command */
|
||||
ret_data = priv->ret_data + strlen(priv->cmd_str) - 1;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ret_data='%s'\n", __func__, ret_data);
|
||||
/* chop term */
|
||||
priv->ret_data[ret_data_len - 1] = '\0';
|
||||
|
||||
*width = atoi(ret_data);
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
|
|
@ -226,5 +226,12 @@ int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch);
|
|||
#define TOKEN_BACKEND(t) (t)
|
||||
|
||||
#define TOK_ROOFING_FILTER TOKEN_BACKEND(100)
|
||||
#define TOK_KEYER TOKEN_BACKEND(101)
|
||||
#define TOK_APF_FREQ TOKEN_BACKEND(102)
|
||||
#define TOK_APF_WIDTH TOKEN_BACKEND(103)
|
||||
#define TOK_CONTOUR TOKEN_BACKEND(104)
|
||||
#define TOK_CONTOUR_FREQ TOKEN_BACKEND(105)
|
||||
#define TOK_CONTOUR_LEVEL TOKEN_BACKEND(106)
|
||||
#define TOK_CONTOUR_WIDTH TOKEN_BACKEND(107)
|
||||
|
||||
#endif /* _NEWCAT_H */
|
||||
|
|
21
src/rig.c
21
src/rig.c
|
@ -1859,8 +1859,8 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
|
|||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s: vfo=%s, freq=%.0f\n", __func__, rig_strvfo(vfo),
|
||||
(double)*freq);
|
||||
rig_debug(RIG_DEBUG_CACHE, "%s: vfo=%s, freq=%.0f, mode=%s, width=%d\n", __func__, rig_strvfo(vfo),
|
||||
(double)*freq, rig_strrmode(*mode), (int)*width);
|
||||
|
||||
if (rig_need_debug(RIG_DEBUG_CACHE))
|
||||
{
|
||||
|
@ -4315,7 +4315,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
|||
{
|
||||
const struct rig_caps *caps;
|
||||
int retcode, rc2;
|
||||
vfo_t curr_vfo, tx_vfo;
|
||||
vfo_t curr_vfo, tx_vfo, rx_vfo;
|
||||
|
||||
ELAPSED1;
|
||||
ENTERFUNC;
|
||||
|
@ -4352,12 +4352,15 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
|||
/* Use previously setup TxVFO */
|
||||
if (vfo == RIG_VFO_CURR || vfo == RIG_VFO_TX)
|
||||
{
|
||||
TRACE;
|
||||
tx_vfo = rig->state.tx_vfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE;
|
||||
tx_vfo = vfo;
|
||||
}
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: curr_vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(curr_vfo), rig_strvfo(tx_vfo));
|
||||
|
||||
if (caps->set_mode && (caps->targetable_vfo & RIG_TARGETABLE_MODE))
|
||||
{
|
||||
|
@ -4369,7 +4372,13 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
|||
|
||||
// some rigs exhibit undesirable flashing when swapping vfos in split
|
||||
// so we turn it off, do our thing, and turn split back on
|
||||
rig_set_split_vfo(rig,RIG_VFO_CURR, RIG_SPLIT_OFF, RIG_VFO_CURR);
|
||||
rx_vfo = RIG_VFO_A;
|
||||
if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) rx_vfo = RIG_VFO_A;
|
||||
else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_A) rx_vfo = RIG_VFO_B;
|
||||
else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_MAIN) rx_vfo = RIG_VFO_SUB;
|
||||
else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_SUB) rx_vfo = RIG_VFO_MAIN;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: rx_vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(rx_vfo), rig_strvfo(tx_vfo));
|
||||
rig_set_split_vfo(rig,rx_vfo, RIG_SPLIT_OFF, rx_vfo);
|
||||
if (caps->set_vfo)
|
||||
{
|
||||
TRACE;
|
||||
|
@ -4409,7 +4418,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
|||
if (caps->set_vfo)
|
||||
{
|
||||
TRACE;
|
||||
rc2 = caps->set_vfo(rig, curr_vfo);
|
||||
rc2 = caps->set_vfo(rig, rx_vfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4421,7 +4430,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
|||
/* return the first error code */
|
||||
retcode = rc2;
|
||||
}
|
||||
rig_set_split_vfo(rig,RIG_VFO_CURR, RIG_SPLIT_ON, RIG_VFO_CURR);
|
||||
rig_set_split_vfo(rig,rx_vfo, RIG_SPLIT_ON, tx_vfo);
|
||||
|
||||
ELAPSED2;
|
||||
RETURNFUNC(retcode);
|
||||
|
|
|
@ -568,7 +568,7 @@ int main(int argc, char *argv[])
|
|||
sizeof(host),
|
||||
serv,
|
||||
sizeof(serv),
|
||||
NI_NOFQDN))
|
||||
NI_NUMERICHOST|NI_NUMERICSERV))
|
||||
< 0)
|
||||
{
|
||||
|
||||
|
@ -674,7 +674,7 @@ void *handle_socket(void *arg)
|
|||
sizeof(host),
|
||||
serv,
|
||||
sizeof(serv),
|
||||
NI_NOFQDN))
|
||||
NI_NUMERICHOST|NI_NUMERICSERV))
|
||||
< 0)
|
||||
{
|
||||
|
||||
|
|
|
@ -963,7 +963,7 @@ int main(int argc, char *argv[])
|
|||
sizeof(host),
|
||||
serv,
|
||||
sizeof(serv),
|
||||
NI_NOFQDN))
|
||||
NI_NUMERICHOST|NI_NUMERICSERV))
|
||||
< 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
|
@ -1201,7 +1201,7 @@ void *handle_socket(void *arg)
|
|||
sizeof(host),
|
||||
serv,
|
||||
sizeof(serv),
|
||||
NI_NOFQDN))
|
||||
NI_NUMERICHOST|NI_NUMERICSERV))
|
||||
< 0)
|
||||
{
|
||||
|
||||
|
|
|
@ -598,7 +598,7 @@ int main(int argc, char *argv[])
|
|||
sizeof(host),
|
||||
serv,
|
||||
sizeof(serv),
|
||||
NI_NOFQDN))
|
||||
NI_NUMERICHOST|NI_NUMERICSERV))
|
||||
< 0)
|
||||
{
|
||||
|
||||
|
@ -711,7 +711,7 @@ void *handle_socket(void *arg)
|
|||
sizeof(host),
|
||||
serv,
|
||||
sizeof(serv),
|
||||
NI_NOFQDN))
|
||||
NI_NUMERICHOST|NI_NUMERICSERV))
|
||||
< 0)
|
||||
{
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue