kopia lustrzana https://github.com/Hamlib/Hamlib
Add RIG_PASSBAND_NOCHANGE as possible set_{split_,split_freq_,}mode argument
This change allows the set_mode functions to leave the rig passband unchanged if required. For the few rigs that do not have explcit passband width control either current state is read and rewritten or a "normal" width is chosen e.g. select a normal width when there is a choice like CW and CW-NARROW.Hamlib-3.1
rodzic
22218fed79
commit
222ad74de7
|
@ -2962,10 +2962,12 @@ int adat_set_mode(RIG *pRig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
pPriv->nRIGMode = mode;
|
||||
nRC = adat_vfo_rnr2anr(vfo, &(pPriv->nCurrentVFO));
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(pRig, mode);
|
||||
|
||||
pPriv->nWidth = width;
|
||||
}
|
||||
|
||||
nRC = adat_transaction(pRig, &adat_cmd_list_set_mode);
|
||||
}
|
||||
|
|
|
@ -292,6 +292,8 @@ int alinco_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
if (width == RIG_PASSBAND_NOCHANGE) return retval;
|
||||
|
||||
/*
|
||||
* TODO: please DX77 owners, check this, I'm not sure
|
||||
* which passband is default!
|
||||
|
|
|
@ -311,6 +311,7 @@ int format8k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
|
|||
|
||||
case s_kHz(12): aormode = AR8K_WAM; break;
|
||||
case s_kHz(3): aormode = AR8K_NAM; break;
|
||||
case RIG_PASSBAND_NOCHANGE: aormode = AR8K_AM; break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
"%s: unsupported passband %d %d\n",
|
||||
|
@ -336,6 +337,7 @@ int format8k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
|
|||
case s_kHz(12): aormode = AR8K_NFM; break;
|
||||
|
||||
case s_kHz(9): aormode = AR8K_SFM; break;
|
||||
case RIG_PASSBAND_NOCHANGE: aormode = AR8K_NFM; break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
"%s: unsupported passband %d %d\n",
|
||||
|
|
|
@ -379,9 +379,14 @@ int ar3030_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
mdbuf_len = sprintf(mdbuf, "%c" EOM, aormode);
|
||||
}
|
||||
else {
|
||||
mdbuf_len = sprintf(mdbuf, "%dB%c" EOM,
|
||||
width < rig_passband_normal(rig,mode) ? 1 : 0,
|
||||
aormode);
|
||||
}
|
||||
retval = ar3030_transaction (rig, mdbuf, mdbuf_len, NULL, NULL);
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -414,6 +414,7 @@ int format5k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
@ -432,6 +433,10 @@ int format5k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
|
||||
return sprintf(buf, "MD%c BW%c", aormode, aorwidth);
|
||||
}
|
||||
else {
|
||||
return sprintf(buf, "MD%c", aormode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -364,6 +364,8 @@ static int ar7030_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return RIG_OK;
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ static int ar7030p_set_mode( RIG * rig, vfo_t vfo, rmode_t mode,
|
|||
ar_mode = modeToNative( mode );
|
||||
|
||||
rc = writeByte( rig, WORKING, MODE, ar_mode );
|
||||
if ( RIG_OK == rc )
|
||||
if ( RIG_OK == rc && width != RIG_PASSBAND_NOCHANGE )
|
||||
{
|
||||
if ( RIG_PASSBAND_NORMAL == width )
|
||||
{
|
||||
|
|
18
aor/sr2200.c
18
aor/sr2200.c
|
@ -370,15 +370,21 @@ int sr2200_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
normal_width = rig_passband_normal(rig, mode);
|
||||
|
||||
if (width == 0)
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = normal_width;
|
||||
|
||||
switch (mode) {
|
||||
case RIG_MODE_AM: aormode = width > normal_width ?
|
||||
SR2200_WAM : SR2200_AM; break;
|
||||
case RIG_MODE_FM: aormode = width < normal_width ?
|
||||
SR2200_SFM : SR2200_FM; break;
|
||||
case RIG_MODE_WFM: aormode = SR2200_WFM; break;
|
||||
case RIG_MODE_AM:
|
||||
aormode = width > normal_width ?
|
||||
SR2200_WAM : SR2200_AM;
|
||||
break;
|
||||
case RIG_MODE_FM:
|
||||
aormode = width >= normal_width ?
|
||||
SR2200_FM : SR2200_SFM;
|
||||
break;
|
||||
case RIG_MODE_WFM:
|
||||
aormode = SR2200_WFM;
|
||||
break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unsupported mode %d\n",
|
||||
__FUNCTION__,mode);
|
||||
|
|
|
@ -519,7 +519,9 @@ Set @var{Mode} to one of: @code{USB}, @code{LSB}, @code{CW},
|
|||
@code{SAH}, @code{DSB}.
|
||||
|
||||
Set @var{Passband} frequency in Hertz, or @code{0} for the Hamlib
|
||||
backend default.
|
||||
backend default. A value of @code{-1} may be passed which leaves the
|
||||
rig passband unchanged from the current or default value for the mode
|
||||
as defined by the rig.
|
||||
|
||||
@strong{N.B.} Passing a @kbd{?} (query) as the first argument
|
||||
instead of @var{Mode} will return a space separated list of radio
|
||||
|
@ -677,12 +679,16 @@ Get @var{DCS Sql} code.
|
|||
|
||||
@item I, set_split_freq @var{Tx Frequency}
|
||||
Set @var{TX Frequency}, in Hertz for ``split'' frequency operation.
|
||||
|
||||
See also @command{set_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item i, get_split_freq
|
||||
Get @var{TX Frequency}, in Hertz for ``split'' frequency operation.
|
||||
|
||||
See also @command{get_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
@ -695,19 +701,75 @@ Set @var{TX Mode} to one of: @code{AM}, @code{FM}, @code{CW},
|
|||
@code{SAH}, @code{DSB}.
|
||||
|
||||
The @var{TX Passband} is the exact passband frequency in Hertz, or
|
||||
@code{0} for the Hamlib backend default.
|
||||
@code{0} for the Hamlib backend default. A value of @code{-1} may be
|
||||
passed which leaves the rig passband unchanged from the current or
|
||||
default value for the mode as defined by the rig.
|
||||
|
||||
@strong{N.B.} Passing a @kbd{?} (query) as the first argument instead
|
||||
of @var{TX Mode} will return a space separated list of radio backend
|
||||
supported TX Modes. Use this to determine the supported TX Modes of a
|
||||
given radio backend.
|
||||
|
||||
See also @command{set_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item x, get_split_mode
|
||||
Get @var{TX Mode}, @var{TX Passband}.
|
||||
|
||||
Returns TX mode as a string from @command{set_split_mode} above and TX
|
||||
passband in Hz.
|
||||
|
||||
See also @command{get_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item K, set_split_freq_mode @var{Tx Frequency}, @var{TX Mode}, @var{TX Passband}
|
||||
Set @var{TX Frequency}, in Hertz for ``split'' frequency operation.
|
||||
Set @var{TX Mode} to one of: @code{AM}, @code{FM}, @code{CW},
|
||||
@code{CWR}, @code{USB}, @code{LSB}, @code{RTTY}, @code{RTTYR},
|
||||
@code{WFM}, @code{AMS}, @code{PKTLSB}, @code{PKTUSB}, @code{PKTFM},
|
||||
@code{ECSSUSB}, @code{ECSSLSB}, @code{FAX}, @code{SAM}, @code{SAL},
|
||||
@code{SAH}, @code{DSB}.
|
||||
|
||||
The @var{TX Passband} is the exact passband frequency in Hertz, or
|
||||
@code{0} for the Hamlib backend default. A value of @code{-1} may be
|
||||
passed which leaves the rig passband unchanged from the current or
|
||||
default value for the mode as defined by the rig.
|
||||
|
||||
This is a convenience function that combines the effect of
|
||||
@command{set_split_freq} and @command{set_split_mode}. It should be
|
||||
used when both are required since it allows the back end to optimize
|
||||
the operations. For example on many Icom rigs the current VFO must be
|
||||
changed temporarily while executing these commands and that can
|
||||
disrupt receive or transmit, using this function may minimize that
|
||||
disruption.
|
||||
|
||||
See also @command{set_split_freq} and @command{set_split_mode} above.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item k, get_split_freq_mode
|
||||
Get @var{TX Frequency}, in Hertz for ``split'' frequency operation
|
||||
along with The @var{TX Mode} as a string from @command{set_split_mode}
|
||||
above and @var{TX Passband} in Hz.
|
||||
|
||||
This is a convenience function that combines the effect of
|
||||
@command{get_split_freq} and @command{get_split_mode}. It should be
|
||||
used when both are required since it allows the back end to optimize
|
||||
the operations. For example on many Icom rigs the current VFO must be
|
||||
changed temporarily while executing these commands and that can
|
||||
disrupt receive or transmit, using this function may minimize that
|
||||
disruption.
|
||||
|
||||
See also @command{get_split_freq} and @command{get_split_mode} above.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item S, set_split_vfo @var{Split}, @var{TX VFO}
|
||||
Set @var{Split} mode, @code{0} (off) or @code{1} (on), and @var{TX VFO}
|
||||
from @command{set_vfo} above.
|
||||
|
@ -2104,12 +2166,16 @@ Get @var{DCS Sql} code.
|
|||
|
||||
@item I, set_split_freq @var{Tx Frequency}
|
||||
Set @var{TX Frequency}, in Hertz for ``split'' frequency operation.
|
||||
|
||||
See also @command{set_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item i, get_split_freq
|
||||
Get @var{TX Frequency}, in Hertz for ``split'' frequency operation.
|
||||
|
||||
See also @command{get_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
@ -2122,19 +2188,75 @@ Set @var{TX Mode} to one of: @code{AM}, @code{FM}, @code{CW},
|
|||
@code{SAH}, @code{DSB}.
|
||||
|
||||
The @var{TX Passband} is the exact passband frequency in Hertz, or
|
||||
@code{0} for the Hamlib backend default.
|
||||
@code{0} for the Hamlib backend default. A value of @code{-1} may be
|
||||
passed which leaves the rig passband unchanged from the current or
|
||||
default value for the mode as defined by the rig.
|
||||
|
||||
@strong{N.B.} Passing a @kbd{?} (query) as the first argument instead
|
||||
of @var{TX Mode} will return a space separated list of radio backend
|
||||
supported TX Modes. Use this to determine the supported TX Modes of a
|
||||
given radio backend.
|
||||
|
||||
See also @command{set_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item x, get_split_mode
|
||||
Get @var{TX Mode}, @var{TX Passband}.
|
||||
|
||||
Returns TX mode as a string from @command{set_split_mode} above and TX
|
||||
passband in Hz.
|
||||
|
||||
See also @command{get_split_freq_mode} below.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item K, set_split_freq_mode @var{Tx Frequency}, @var{TX Mode}, @var{TX Passband}
|
||||
Set @var{TX Frequency}, in Hertz for ``split'' frequency operation.
|
||||
Set @var{TX Mode} to one of: @code{AM}, @code{FM}, @code{CW},
|
||||
@code{CWR}, @code{USB}, @code{LSB}, @code{RTTY}, @code{RTTYR},
|
||||
@code{WFM}, @code{AMS}, @code{PKTLSB}, @code{PKTUSB}, @code{PKTFM},
|
||||
@code{ECSSUSB}, @code{ECSSLSB}, @code{FAX}, @code{SAM}, @code{SAL},
|
||||
@code{SAH}, @code{DSB}.
|
||||
|
||||
The @var{TX Passband} is the exact passband frequency in Hertz, or
|
||||
@code{0} for the Hamlib backend default. A value of @code{-1} may be
|
||||
passed which leaves the rig passband unchanged from the current or
|
||||
default value for the mode as defined by the rig.
|
||||
|
||||
This is a convenience function that combines the effect of
|
||||
@command{set_split_freq} and @command{set_split_mode}. It should be
|
||||
used when both are required since it allows the back end to optimize
|
||||
the operations. For example on many Icom rigs the current VFO must be
|
||||
changed temporarily while executing these commands and that can
|
||||
disrupt receive or transmit, using this function may minimize that
|
||||
disruption.
|
||||
|
||||
See also @command{set_split_freq} and @command{set_split_mode} above.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item k, get_split_freq_mode
|
||||
Get @var{TX Frequency}, in Hertz for ``split'' frequency operation
|
||||
along with the @var{TX Mode} as a string from @command{set_split_mode}
|
||||
above and @var{TX Passband} in Hz.
|
||||
|
||||
This is a convenience function that combines the effect of
|
||||
@command{get_split_freq} and @command{get_split_mode}. It should be
|
||||
used when both are required since it allows the back end to optimize
|
||||
the operations. For example on many Icom rigs the current VFO must be
|
||||
changed temporarily while executing these commands and that can
|
||||
disrupt receive or transmit, using this function may minimize that
|
||||
disruption.
|
||||
|
||||
See also @command{get_split_freq} and @command{get_split_mode} above.
|
||||
@ifhtml
|
||||
@*
|
||||
@end ifhtml
|
||||
|
||||
@item S, set_split_vfo @var{Split}, @var{TX VFO}
|
||||
Set @var{Split} mode, @code{0} (off) or @code{1} (on), and @var{TX VFO}
|
||||
from @command{set_vfo} above.
|
||||
|
|
|
@ -290,31 +290,32 @@ int drake_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (mode != RIG_MODE_FM) {
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
switch (width) {
|
||||
case 500: width_sel = '0'; break;
|
||||
|
||||
case 1800: width_sel = '1'; break;
|
||||
|
||||
case 2300: width_sel = '2'; break;
|
||||
|
||||
case 4000: width_sel = '4'; break;
|
||||
|
||||
case 6000: width_sel = '6'; break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "drake_set_mode: "
|
||||
"unsupported width %d\n", width);
|
||||
return -RIG_EINVAL;
|
||||
if (width <= 500) {
|
||||
width_sel = '0';
|
||||
}
|
||||
else if (width <= 1800) {
|
||||
width_sel = '1';
|
||||
}
|
||||
else if (width <= 2300) {
|
||||
width_sel = '2';
|
||||
}
|
||||
else if (width <= 4000) {
|
||||
width_sel = '4';
|
||||
}
|
||||
else {
|
||||
width_sel = '6';
|
||||
}
|
||||
|
||||
mdbuf_len = sprintf((char *) mdbuf, "W%c" EOM, width_sel);
|
||||
retval = drake_transaction(rig, (char *) mdbuf, mdbuf_len, (char *) ackbuf, &ack_len);
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode == RIG_MODE_AMS) || (mode == RIG_MODE_ECSSUSB) || (mode == RIG_MODE_ECSSLSB) ||
|
||||
(mode == RIG_MODE_AM) || (mode == RIG_MODE_USB) || (mode == RIG_MODE_LSB)) {
|
||||
|
|
|
@ -338,6 +338,8 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
curr->mode = mode;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return RIG_OK;
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
curr->width = rig_passband_normal(rig, mode);
|
||||
else
|
||||
|
@ -626,6 +628,8 @@ static int dummy_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t
|
|||
rig_strvfo(vfo), rig_strrmode(tx_mode), buf);
|
||||
|
||||
curr->tx_mode = tx_mode;
|
||||
if (RIG_PASSBAND_NOCHANGE == tx_width) return RIG_OK;
|
||||
|
||||
curr->tx_width = tx_width;
|
||||
|
||||
return RIG_OK;
|
||||
|
|
|
@ -662,6 +662,16 @@ int dttsp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
int ret = RIG_OK;
|
||||
int filter_l, filter_h;
|
||||
|
||||
/* DttSP set mode */
|
||||
|
||||
buf_len = sprintf (buf, "setMode %d\n", rmode2dttsp(mode) );
|
||||
ret = send_command (rig, buf, buf_len);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE,"%s: %s\n",
|
||||
__FUNCTION__, buf);
|
||||
|
||||
if (ret != RIG_OK || RIG_PASSBAND_NOCHANGE == width) return ret;
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
sprintf_freq(buf, width);
|
||||
|
@ -692,11 +702,6 @@ int dttsp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
/* DttSP set mode */
|
||||
|
||||
buf_len = sprintf (buf, "setMode %d\n", rmode2dttsp(mode) );
|
||||
ret = send_command (rig, buf, buf_len);
|
||||
|
||||
buf_len = sprintf (buf, "setFilter %d %d\n", filter_l, filter_h );
|
||||
ret = send_command (rig, buf, buf_len);
|
||||
|
||||
|
|
|
@ -582,7 +582,8 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s %s\n",
|
||||
__FUNCTION__, rig_strvfo(vfo), rig_strrmode(mode), buf);
|
||||
|
||||
if (mode == chan->mode && width == chan->width)
|
||||
if (mode == chan->mode
|
||||
&& (RIG_PASSBAND_NOCHANGE == width || width == chan->width))
|
||||
return RIG_OK;
|
||||
|
||||
|
||||
|
@ -605,7 +606,8 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
pthread_mutex_lock(&priv->mutex_process);
|
||||
|
||||
/* Same mode, but different width */
|
||||
if (mode != RIG_MODE_NONE && mode == chan->mode) {
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& mode != RIG_MODE_NONE && mode == chan->mode) {
|
||||
mod->setWidth(width);
|
||||
chan->width = width;
|
||||
pthread_mutex_unlock(&priv->mutex_process);
|
||||
|
@ -627,13 +629,15 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (mode == RIG_MODE_NONE) {
|
||||
/* ez */
|
||||
chan->mode = mode;
|
||||
chan->width = width;
|
||||
if (width != RIG_PASSBAND_NOCHANGE) chan->width = width;
|
||||
pthread_mutex_unlock(&priv->mutex_process);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
float rf_gain = chan->levels[rig_setting2idx(RIG_LEVEL_RF)].f;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) width = chan->width;
|
||||
|
||||
switch(mode) {
|
||||
case RIG_MODE_LSB:
|
||||
mod = new LSBDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, (freq_t)freq_offset);
|
||||
|
|
|
@ -338,6 +338,7 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
medium_width = rig_passband_normal(rig, mode);
|
||||
if (width == medium_width || width == RIG_PASSBAND_NORMAL)
|
||||
icmode_ext = -1; /* medium, no passband data-> rig default. Is medium always the default? */
|
||||
|
@ -354,6 +355,7 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
|
|||
icmode_ext = PD_WIDE_3; /* default to Wide */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*md = icmode;
|
||||
*pd = icmode_ext;
|
||||
|
|
|
@ -48,10 +48,12 @@ static int ic706_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
|
|||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (*pd == -1)
|
||||
*pd = PD_MEDIUM_2;
|
||||
else
|
||||
(*pd)--;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
12
icom/icom.c
12
icom/icom.c
|
@ -585,7 +585,6 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) {
|
|||
}
|
||||
|
||||
int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) {
|
||||
|
||||
int retval, rfstatus, i;
|
||||
unsigned char ackbuf[MAXFRAMELEN];
|
||||
unsigned char flt_ext;
|
||||
|
@ -593,6 +592,7 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) {
|
|||
int ack_len=sizeof(ackbuf), flt_idx;
|
||||
unsigned char fw_sub_cmd = RIG_MODEL_IC7200 == rig->caps->rig_model ? 0x02 : S_MEM_FILT_WDTH;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return RIG_OK;
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
@ -1715,7 +1715,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
split for certainty */
|
||||
if (RIG_OK != (rc = icom_transaction (rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) return rc;
|
||||
if (ack_len != 1 || ackbuf[0] != ACK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_set_split_freq_mode: ack NG (%#.2x), "
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_set_split_freq: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0],ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
@ -1767,7 +1767,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
|||
split for certainty */
|
||||
if (RIG_OK != (rc = icom_transaction (rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) return rc;
|
||||
if (ack_len != 1 || ackbuf[0] != ACK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_set_split_freq_mode: ack NG (%#.2x), "
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_get_split_freq: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0],ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
@ -1819,7 +1819,7 @@ int icom_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width
|
|||
split for certainty */
|
||||
if (RIG_OK != (rc = icom_transaction (rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) return rc;
|
||||
if (ack_len != 1 || ackbuf[0] != ACK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_set_split_freq_mode: ack NG (%#.2x), "
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_set_split_mode: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0],ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
@ -1872,7 +1872,7 @@ int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_wid
|
|||
split for certainty */
|
||||
if (RIG_OK != (rc = icom_transaction (rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) return rc;
|
||||
if (ack_len != 1 || ackbuf[0] != ACK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_set_split_freq_mode: ack NG (%#.2x), "
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_get_split_mode: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0],ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
@ -1976,7 +1976,7 @@ int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq, rmode_t *tx_m
|
|||
split for certainty */
|
||||
if (RIG_OK != (rc = icom_transaction (rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) return rc;
|
||||
if (ack_len != 1 || ackbuf[0] != ACK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_set_split_freq_mode: ack NG (%#.2x), "
|
||||
rig_debug(RIG_DEBUG_ERR,"icom_get_split_freq_mode: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0],ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
|
|
@ -367,6 +367,7 @@ typedef int vfo_t;
|
|||
|
||||
|
||||
#define RIG_PASSBAND_NORMAL s_Hz(0)
|
||||
#define RIG_PASSBAND_NOCHANGE s_Hz(-1)
|
||||
/**
|
||||
* \brief Passband width, in Hz
|
||||
* \sa rig_passband_normal, rig_passband_narrow, rig_passband_wide
|
||||
|
|
19
jrc/jrc.c
19
jrc/jrc.c
|
@ -175,6 +175,11 @@ static int rig2jrc_mode(RIG *rig, rmode_t mode, pbwidth_t width,
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) {
|
||||
*jwidth = '1';
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
@ -329,10 +334,12 @@ int jrc_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
mdbuf_len = sprintf(mdbuf, "B" "%c" EOM, awidth);
|
||||
retval = jrc_transaction (rig, mdbuf, mdbuf_len, NULL, NULL);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -1158,13 +1165,21 @@ int jrc_set_chan(RIG *rig, const channel_t *chan)
|
|||
char cmdbuf[BUFSZ];
|
||||
int retval, cmd_len;
|
||||
|
||||
/* read first to get current values */
|
||||
channel_t current;
|
||||
current.channel_num = chan->channel_num;
|
||||
if ((retval = jrc_get_chan (rig, ¤t)) != RIG_OK) return retval;
|
||||
|
||||
sprintf(cmdbuf,"K%03d000",chan->channel_num);
|
||||
|
||||
if (chan->levels[rig_setting2idx(RIG_LEVEL_ATT)].i == 20)
|
||||
cmdbuf[4] = '1';
|
||||
|
||||
retval = rig2jrc_mode(rig, chan->mode, chan->width,
|
||||
&cmdbuf[6], &cmdbuf[5]);
|
||||
rmode_t mode = chan->mode;
|
||||
pbwidth_t width = chan->width;
|
||||
if (RIG_MODE_NONE == mode) mode = current.mode;
|
||||
if (RIG_PASSBAND_NOCHANGE == width) width = current.width;
|
||||
retval = rig2jrc_mode(rig, mode, width, &cmdbuf[6], &cmdbuf[5]);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
|
|
|
@ -192,6 +192,8 @@ static int nrd525_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return retval;
|
||||
|
||||
// TODO: width
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -228,14 +228,17 @@ static int flex6k_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
err = flex6k_find_width(mode, width, &idx);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
if ((vfo == RIG_VFO_VFO) || (vfo == RIG_VFO_CURR)) {
|
||||
vfo = rig->state.current_vfo;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: setting VFO to current\n", __func__);
|
||||
}
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return err;
|
||||
|
||||
err = flex6k_find_width(mode, width, &idx);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
/*
|
||||
* The Flex CAT interface does not support FW for reading filter width,
|
||||
* so use the ZZFI or ZZFJ command
|
||||
|
|
10
kenwood/k2.c
10
kenwood/k2.c
|
@ -312,6 +312,7 @@ int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width < 0)
|
||||
width = labs(width);
|
||||
|
||||
|
@ -339,19 +340,21 @@ int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
} else {
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
/* Construct the filter command and set the radio mode and width*/
|
||||
snprintf(fcmd, 8, "FW0000%c", f);
|
||||
}
|
||||
|
||||
/* kenwood_set_mode() ignores width value for K2/K3/TS-570 */
|
||||
err = kenwood_set_mode(rig, vfo, mode, width);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
err = kenwood_transaction(rig, "K22", NULL, 0);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
/* Construct the filter command and set the radio mode and width*/
|
||||
snprintf(fcmd, 8, "FW0000%c", f);
|
||||
|
||||
/* Set the filter slot */
|
||||
err = kenwood_transaction(rig, fcmd, NULL, 0);
|
||||
if (err != RIG_OK)
|
||||
|
@ -360,6 +363,7 @@ int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
err = kenwood_transaction(rig, "K20", NULL, 0);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -377,6 +377,7 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
/* and set the requested bandwidth. On my K3, the bandwidth is rounded
|
||||
* down to the nearest 50 Hz, i.e. sending BW0239; will cause the bandwidth
|
||||
* to be set to 2.350 kHz. As the width must be divided by 10, 10 Hz values
|
||||
|
@ -405,6 +406,7 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
err = kenwood_transaction(rig, cmd_s, NULL, 0);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Now set data sub-mode. K3 needs to be in a DATA mode before setting
|
||||
* the sub-mode.
|
||||
|
@ -639,6 +641,7 @@ int k3_set_split_mode(RIG * rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
|
|||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
if (tx_width != RIG_PASSBAND_NOCHANGE) {
|
||||
/* and set the requested bandwidth. On my K3, the bandwidth is rounded
|
||||
* down to the nearest 50 Hz, i.e. sending BW0239; will cause the bandwidth
|
||||
* to be set to 2.350 kHz. As the width must be divided by 10, 10 Hz values
|
||||
|
@ -667,6 +670,7 @@ int k3_set_split_mode(RIG * rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
|
|||
err = kenwood_transaction(rig, cmd_s, NULL, 0);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Now set data sub-mode. K3 needs to be in a DATA mode before setting
|
||||
* the sub-mode.
|
||||
|
|
|
@ -1437,6 +1437,7 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
}
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return RIG_OK;
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS450S
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS690S
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS850
|
||||
|
|
|
@ -156,6 +156,7 @@ static int ts570_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
retval = kenwood_transaction(rig, buf, NULL, 0);
|
||||
if (retval != RIG_OK) return retval;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return retval;
|
||||
switch (mode)
|
||||
{
|
||||
case RIG_MODE_CW:
|
||||
|
|
|
@ -185,6 +185,7 @@ static int ts870s_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
retval = kenwood_transaction(rig, buf, NULL, 0);
|
||||
if (retval != RIG_OK) return retval;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) {
|
||||
if (RIG_PASSBAND_NORMAL != width) /* leave well alone if default passband requested */
|
||||
{
|
||||
if (RIG_MODE_USB == mode || RIG_MODE_LSB == mode || RIG_MODE_AM == mode)
|
||||
|
@ -212,6 +213,7 @@ static int ts870s_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
retval = kenwood_transaction(rig, buf, NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
|
@ -487,6 +487,7 @@ static int fifisdr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EIO;
|
||||
}
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return ret;
|
||||
/* Set filter width */
|
||||
fifi_width = fifisdr_tole32(width);
|
||||
ret = fifisdr_usb_write(rig, REQUEST_FIFISDR_WRITE, 0,
|
||||
|
|
|
@ -757,6 +757,7 @@ pcr_set_mode(RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
@ -794,9 +795,14 @@ pcr_set_mode(RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
buf_len = sprintf((char *) buf, "K%c%010" PRIll "0%c0%c00",
|
||||
is_sub_rcvr(rig, vfo) ? '1':'0',
|
||||
(int64_t) rcvr->last_freq, pcrmode, pcrfilter);
|
||||
}
|
||||
else {
|
||||
buf_len = sprintf((char *) buf, "K%c%010" PRIll "0%c0%c00",
|
||||
is_sub_rcvr(rig, vfo) ? '1':'0',
|
||||
(int64_t) rcvr->last_freq, pcrmode, rcvr->last_filter);
|
||||
}
|
||||
if (buf_len < 0)
|
||||
return -RIG_ETRUNC;
|
||||
|
||||
err = pcr_transaction(rig, (char *) buf);
|
||||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
|
|
@ -265,10 +265,15 @@ int racal_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
sprintf(buf, "D%dI%.0f", ra_mode, (double)(width/kHz(1)));
|
||||
}
|
||||
else {
|
||||
sprintf(buf, "D%d", ra_mode);
|
||||
}
|
||||
|
||||
return racal_transaction (rig, buf, NULL, NULL);
|
||||
}
|
||||
|
|
3
rs/rs.c
3
rs/rs.c
|
@ -138,7 +138,10 @@ int rs_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
len = sprintf(buf, BOM "DEM %s" EOM, smode);
|
||||
retval = rs_transaction(rig, buf, len, NULL, NULL);
|
||||
if (retval < 0)
|
||||
return retval;
|
||||
|
||||
if (width == RIG_PASSBAND_NOCHANGE) return retval;
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
|
|
@ -176,6 +176,7 @@ int skanti_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return retval;
|
||||
/*
|
||||
* TODO: please sk8000 owners, check this, I'm not sure
|
||||
* which passband is default!
|
||||
|
|
|
@ -299,6 +299,7 @@ int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (ret != RIG_OK)
|
||||
return ret;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return ret;
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
|
17
src/rig.c
17
src/rig.c
|
@ -925,8 +925,11 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
* \param mode The mode to set to
|
||||
* \param width The passband width to set to
|
||||
*
|
||||
* Sets the mode and associated passband of the target VFO.
|
||||
* The passband \a width must be supported by the backend of the rig.
|
||||
* Sets the mode and associated passband of the target VFO. The
|
||||
* passband \a width must be supported by the backend of the rig or
|
||||
* the special value RIG_PASSBAND_NOCHANGE which leaves the passband
|
||||
* unchanged from the current value or default for the mode determined
|
||||
* by the rig.
|
||||
*
|
||||
* \return RIG_OK if the operation has been sucessful, otherwise
|
||||
* a negative value if an error occured (in which case, cause is
|
||||
|
@ -1838,7 +1841,10 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
|||
* \param rig The rig handle
|
||||
* \param vfo The target VFO
|
||||
* \param tx_mode The transmit split mode to set to
|
||||
* \param tx_width The transmit split width to set to
|
||||
* \param tx_width The transmit split width to set to or the special
|
||||
* value RIG_PASSBAND_NOCHANGE which leaves the passband unchanged
|
||||
* from the current value or default for the mode determined by the
|
||||
* rig.
|
||||
*
|
||||
* Sets the split(TX) mode.
|
||||
*
|
||||
|
@ -1998,7 +2004,10 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth
|
|||
* \param vfo The target VFO
|
||||
* \param tx_freq The transmit frequency to set to
|
||||
* \param tx_mode The transmit split mode to set to
|
||||
* \param tx_width The transmit split width to set to
|
||||
* \param tx_width The transmit split width to set to or the special
|
||||
* value RIG_PASSBAND_NOCHANGE which leaves the passband unchanged
|
||||
* from the current value or default for the mode determined by the
|
||||
* rig.
|
||||
*
|
||||
* Sets the split(TX) frequency and mode.
|
||||
*
|
||||
|
|
|
@ -607,14 +607,15 @@ int tt538_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return retval;
|
||||
if (RIG_PASSBAND_NORMAL == width)
|
||||
width = rig_passband_normal (rig, mode);
|
||||
/* Set rx filter bandwidth. */
|
||||
if (width != RIG_PASSBAND_NORMAL) /* leave untouched if normal */
|
||||
{
|
||||
width = tt538_filter_number((int) width);
|
||||
|
||||
cmd_len = sprintf((char *) cmdbuf, "*W%c" EOM, (unsigned char) width);
|
||||
return tt538_transaction (rig, (char *) cmdbuf, cmd_len, NULL, NULL);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -699,12 +699,10 @@ int tt588_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return retval;
|
||||
|
||||
/* Set rx filter bandwidth. */
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = tt588_filter_number(rig_passband_normal(rig, mode));
|
||||
else
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return retval;
|
||||
if (RIG_PASSBAND_NORMAL == width)
|
||||
width = rig_passband_normal (rig, mode);
|
||||
width = tt588_filter_number((int) width);
|
||||
|
||||
cmd_len = sprintf((char *) cmdbuf, "*W%c" EOM, (unsigned char) width);
|
||||
return tt588_transaction (rig, (char *) cmdbuf, cmd_len, NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -424,9 +424,6 @@ int tt585_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
const char *mcmd, *wcmd;
|
||||
int ret;
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
switch(mode) {
|
||||
case RIG_MODE_LSB: mcmd = "N"; break;
|
||||
case RIG_MODE_USB: mcmd = "O"; break;
|
||||
|
@ -444,6 +441,9 @@ int tt585_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return ret;
|
||||
if (RIG_PASSBAND_NORMAL == width)
|
||||
width = rig_passband_normal (rig, mode);
|
||||
if (width <= 250)
|
||||
wcmd = "V";
|
||||
else if (width <= 500)
|
||||
|
|
|
@ -433,6 +433,7 @@ int rx331_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
@ -441,7 +442,13 @@ int rx331_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
*/
|
||||
mdbuf_len = num_sprintf(mdbuf, "$%iD%cI%.02f" EOM, priv->receiver_id,
|
||||
dmode, (float)width/1e3);
|
||||
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* Set DETECTION MODE
|
||||
*/
|
||||
mdbuf_len = num_sprintf(mdbuf, "$%iD%c" EOM, priv->receiver_id, dmode);
|
||||
}
|
||||
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -345,6 +345,7 @@ int rx340_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
@ -353,7 +354,13 @@ int rx340_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
*/
|
||||
mdbuf_len = num_sprintf(mdbuf, "D%cI%.02f" EOM,
|
||||
dmode, (float)width/1e3);
|
||||
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* Set DETECTION MODE
|
||||
*/
|
||||
mdbuf_len = num_sprintf(mdbuf, "D%c" EOM, dmode);
|
||||
}
|
||||
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -272,6 +272,13 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
/* backup current values
|
||||
* in case we fail to write to port
|
||||
*/
|
||||
saved_mode = priv->mode;
|
||||
saved_width = priv->width;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
@ -285,18 +292,14 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
width);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
/* backup current values
|
||||
* in case we fail to write to port
|
||||
*/
|
||||
saved_mode = priv->mode;
|
||||
saved_width = priv->width;
|
||||
priv->width = width;
|
||||
}
|
||||
|
||||
priv->mode = mode;
|
||||
priv->width = width;
|
||||
|
||||
tentec_tuning_factor_calc(rig);
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
mdbuf_len = sprintf(mdbuf, "W%c" EOM
|
||||
"N%c%c%c%c%c%c" EOM
|
||||
"M%c" EOM,
|
||||
|
@ -311,6 +314,21 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
priv->width = saved_width;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
else {
|
||||
mdbuf_len = sprintf(mdbuf,
|
||||
"N%c%c%c%c%c%c" EOM
|
||||
"M%c" EOM,
|
||||
priv->ctf >> 8, priv->ctf & 0xff,
|
||||
priv->ftf >> 8, priv->ftf & 0xff,
|
||||
priv->btf >> 8, priv->btf & 0xff,
|
||||
ttmode);
|
||||
retval = write_block(&rs->rigport, mdbuf, mdbuf_len);
|
||||
if (retval != RIG_OK) {
|
||||
priv->mode = saved_mode;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -363,8 +363,9 @@ int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (ret_len != 2 || mdbuf[0] != 'G')
|
||||
return -RIG_ERJCTED;
|
||||
|
||||
if (RIG_PASSBAND_NORMAL == width) /* with NORMAL we leave width alone */
|
||||
return RIG_OK;
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return retval;
|
||||
if (RIG_PASSBAND_NORMAL == width)
|
||||
width = rig_passband_normal (rig, mode);
|
||||
|
||||
/*
|
||||
* Filter 0: 200
|
||||
|
|
|
@ -705,7 +705,13 @@ tt550_set_rx_mode (RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* backup current values in case we fail to write to port
|
||||
*/
|
||||
saved_mode = priv->rx_mode;
|
||||
saved_width = priv->width;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal (rig, mode);
|
||||
|
||||
|
@ -721,35 +727,35 @@ tt550_set_rx_mode (RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* backup current values in case we fail to write to port
|
||||
*/
|
||||
saved_mode = priv->rx_mode;
|
||||
saved_width = priv->width;
|
||||
priv->width = width;
|
||||
}
|
||||
|
||||
priv->rx_mode = mode;
|
||||
priv->width = width;
|
||||
|
||||
tt550_tuning_factor_calc (rig, RECEIVE);
|
||||
|
||||
mdbuf_len = sprintf (mdbuf, "M%c%c" EOM, ttmode, ttmode);
|
||||
retval = write_block (&rs->rigport, mdbuf, mdbuf_len);
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
priv->rx_mode = saved_mode;
|
||||
priv->width = saved_width;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
mdbuf_len = sprintf (mdbuf, "W%c" EOM
|
||||
"N%c%c%c%c%c%c" EOM,
|
||||
ttfilter,
|
||||
priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8,
|
||||
priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff);
|
||||
retval = write_block (&rs->rigport, mdbuf, mdbuf_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
priv->rx_mode = saved_mode;
|
||||
priv->width = saved_width;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -796,6 +802,13 @@ tt550_set_tx_mode (RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* backup current values in case we fail to write to port
|
||||
*/
|
||||
saved_mode = priv->tx_mode;
|
||||
saved_width = priv->tx_width;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
/*
|
||||
* Limit the transmitter bandwidth - it's not the same as the receiver
|
||||
*/
|
||||
|
@ -829,35 +842,35 @@ tt550_set_tx_mode (RIG * rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
*/
|
||||
|
||||
ttfilter += 7;
|
||||
|
||||
/*
|
||||
* backup current values in case we fail to write to port
|
||||
*/
|
||||
saved_mode = priv->tx_mode;
|
||||
saved_width = priv->tx_width;
|
||||
priv->tx_width = width;
|
||||
}
|
||||
|
||||
priv->tx_mode = mode;
|
||||
priv->tx_width = width;
|
||||
|
||||
tt550_tuning_factor_calc (rig, TRANSMIT);
|
||||
|
||||
mdbuf_len = sprintf (mdbuf, "M%c%c" EOM, ttmode, ttmode);
|
||||
retval = write_block (&rs->rigport, mdbuf, mdbuf_len);
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
priv->tx_mode = saved_mode;
|
||||
priv->tx_width = saved_width;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
mdbuf_len = sprintf (mdbuf, "C%c" EOM
|
||||
"T%c%c%c%c%c%c" EOM,
|
||||
ttfilter,
|
||||
priv->ctf >> 8, priv->ctf & 0xff, priv->ftf >> 8,
|
||||
priv->ftf & 0xff, priv->btf >> 8, priv->btf & 0xff);
|
||||
retval = write_block (&rs->rigport, mdbuf, mdbuf_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
priv->tx_mode = saved_mode;
|
||||
priv->tx_width = saved_width;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
6
wj/wj.c
6
wj/wj.c
|
@ -122,7 +122,7 @@ static int wj_transaction(RIG *rig, int monitor)
|
|||
default:
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
buf[5] |= (wj_width & 0x2)<<3;
|
||||
buf[5] |= (wj_width & 0x7)<<3;
|
||||
|
||||
/* Detection mode */
|
||||
switch (priv->mode) {
|
||||
|
@ -137,7 +137,7 @@ static int wj_transaction(RIG *rig, int monitor)
|
|||
__FUNCTION__, priv->mode);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
buf[5] |= wj_mode & 0x3;
|
||||
buf[5] |= wj_mode & 0x7;
|
||||
|
||||
/* BFO frequency, not sure though */
|
||||
wj_bfo = (priv->ifshift.i/10) + 0x400; /* LSBit is 10Hz, +455kHz */
|
||||
|
@ -293,10 +293,12 @@ int wj_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
priv->mode = mode;
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
priv->width = width;
|
||||
}
|
||||
|
||||
return wj_transaction (rig, 0);
|
||||
}
|
||||
|
|
|
@ -416,22 +416,25 @@ int mode2rig(RIG *rig, rmode_t mode, pbwidth_t width)
|
|||
case RIG_MODE_USB: md = MODE_USB; break;
|
||||
case RIG_MODE_LSB: md = MODE_LSB; break;
|
||||
case RIG_MODE_AM:
|
||||
if (width != RIG_PASSBAND_NORMAL ||
|
||||
width < rig_passband_normal(rig, mode))
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& (width != RIG_PASSBAND_NORMAL ||
|
||||
width < rig_passband_normal(rig, mode)))
|
||||
md = MODE_AMN;
|
||||
else
|
||||
md = MODE_AMW;
|
||||
break;
|
||||
case RIG_MODE_FM:
|
||||
if (width != RIG_PASSBAND_NORMAL ||
|
||||
width < rig_passband_normal(rig, mode))
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& (width != RIG_PASSBAND_NORMAL ||
|
||||
width < rig_passband_normal(rig, mode)))
|
||||
md = MODE_FMN;
|
||||
else
|
||||
md = MODE_FMW;
|
||||
break;
|
||||
case RIG_MODE_CW:
|
||||
if (width != RIG_PASSBAND_NORMAL ||
|
||||
width < rig_passband_normal(rig, mode))
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& (width != RIG_PASSBAND_NORMAL ||
|
||||
width < rig_passband_normal(rig, mode)))
|
||||
md = MODE_CWN;
|
||||
else
|
||||
md = MODE_CWW;
|
||||
|
|
|
@ -216,8 +216,9 @@ int frg8800_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL; /* sorry, wrong MODE */
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NORMAL &&
|
||||
width < rig_passband_normal(rig, mode)) {
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width != RIG_PASSBAND_NORMAL
|
||||
&& width < rig_passband_normal(rig, mode)) {
|
||||
md |= 0x08;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,8 +168,9 @@ int frg9600_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
case RIG_MODE_FM: md = MODE_SET_FMN; break;
|
||||
case RIG_MODE_WFM: md = MODE_SET_WFM; break;
|
||||
case RIG_MODE_AM:
|
||||
if (width != RIG_PASSBAND_NORMAL &&
|
||||
width < rig_passband_normal(rig, mode))
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width != RIG_PASSBAND_NORMAL
|
||||
&& width < rig_passband_normal(rig, mode))
|
||||
md = MODE_SET_AMN;
|
||||
else
|
||||
md = MODE_SET_AMW;
|
||||
|
|
|
@ -533,6 +533,7 @@ int ft100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) {
|
|||
if (ret != RIG_OK)
|
||||
return ret;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return ret;
|
||||
#if 1
|
||||
if (mode != RIG_MODE_FM && mode != RIG_MODE_WFM && width <= kHz(6))
|
||||
{
|
||||
|
|
|
@ -301,8 +301,9 @@ int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL; /* sorry, wrong MODE */
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NORMAL &&
|
||||
width < rig_passband_normal(rig, mode)) {
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width != RIG_PASSBAND_NORMAL
|
||||
&& width < rig_passband_normal(rig, mode)) {
|
||||
md |= 0x80;
|
||||
}
|
||||
|
||||
|
@ -368,8 +369,9 @@ int ft736_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL; /* sorry, wrong MODE */
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NORMAL &&
|
||||
width < rig_passband_normal(rig, mode)) {
|
||||
if (RIG_PASSBAND_NOCHANGE != width
|
||||
&& width != RIG_PASSBAND_NORMAL
|
||||
&& width < rig_passband_normal(rig, mode)) {
|
||||
md |= 0x80;
|
||||
}
|
||||
|
||||
|
|
|
@ -477,13 +477,15 @@ int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
|||
|
||||
switch(mode) {
|
||||
case RIG_MODE_AM:
|
||||
if (width < width_normal)
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width < width_normal)
|
||||
cmd_index = FT_747_NATIVE_MODE_SET_AMN;
|
||||
else
|
||||
cmd_index = FT_747_NATIVE_MODE_SET_AMW;
|
||||
break;
|
||||
case RIG_MODE_CW:
|
||||
if (width < width_normal)
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width < width_normal)
|
||||
cmd_index = FT_747_NATIVE_MODE_SET_CWN;
|
||||
else
|
||||
cmd_index = FT_747_NATIVE_MODE_SET_CWW;
|
||||
|
@ -495,7 +497,8 @@ int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
|||
cmd_index = FT_747_NATIVE_MODE_SET_LSB;
|
||||
break;
|
||||
case RIG_MODE_FM:
|
||||
if (width < width_normal)
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width < width_normal)
|
||||
cmd_index = FT_747_NATIVE_MODE_SET_FMN;
|
||||
else
|
||||
cmd_index = FT_747_NATIVE_MODE_SET_FMW;
|
||||
|
|
|
@ -735,8 +735,9 @@ int mode2rig(RIG *rig, rmode_t mode, pbwidth_t width)
|
|||
break;
|
||||
|
||||
case RIG_MODE_CW:
|
||||
if (width == RIG_PASSBAND_NORMAL ||
|
||||
width >= rig_passband_normal(rig, mode))
|
||||
if (RIG_PASSBAND_NOCHANGE == width
|
||||
|| width == RIG_PASSBAND_NORMAL
|
||||
|| width >= rig_passband_normal(rig, mode))
|
||||
md = MODE_CWW;
|
||||
else
|
||||
md = MODE_CWN;
|
||||
|
|
|
@ -628,6 +628,7 @@ static int ft840_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
* The FT-840 only supports narrow width in AM and CW modes
|
||||
*
|
||||
*/
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == rig_passband_narrow(rig, mode)) {
|
||||
switch(mode) {
|
||||
case RIG_MODE_CW:
|
||||
|
@ -645,6 +646,7 @@ static int ft840_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
return -RIG_EINVAL; /* Invalid width, how can caller know? */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set mode_parm = 0x%02x\n", __func__, mode_parm);
|
||||
|
||||
|
|
|
@ -663,7 +663,7 @@ int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) {
|
|||
/*
|
||||
* Now set width
|
||||
*/
|
||||
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == rig_passband_narrow(rig, mode)) {
|
||||
switch(mode) {
|
||||
case RIG_MODE_AM:
|
||||
|
@ -693,6 +693,8 @@ int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) {
|
|||
return -RIG_EINVAL; /* sorry, wrong MODE/WIDTH combo */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now send the command
|
||||
*/
|
||||
|
|
|
@ -783,7 +783,7 @@ int ft857_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NORMAL)
|
||||
if (width != RIG_PASSBAND_NOCHANGE && width != RIG_PASSBAND_NORMAL)
|
||||
return -RIG_EINVAL;
|
||||
|
||||
rig_force_cache_timeout(&((struct ft857_priv_data *) rig->state.priv)->fm_status_tv);
|
||||
|
|
|
@ -566,6 +566,7 @@ static int ft890_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
* The FT-890 only supports narrow width in AM and CW modes
|
||||
*
|
||||
*/
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == rig_passband_narrow(rig, mode)) {
|
||||
switch(mode) {
|
||||
case RIG_MODE_CW:
|
||||
|
@ -583,6 +584,7 @@ static int ft890_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
return -RIG_EINVAL; /* Invalid width, how can caller know? */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set mode_parm = 0x%02x\n", __func__, mode_parm);
|
||||
|
||||
|
|
|
@ -798,7 +798,7 @@ int ft897_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NORMAL)
|
||||
if (width != RIG_PASSBAND_NOCHANGE && width != RIG_PASSBAND_NORMAL)
|
||||
return -RIG_EINVAL;
|
||||
|
||||
rig_force_cache_timeout(&((struct ft897_priv_data *) rig->state.priv)->fm_status_tv);
|
||||
|
|
|
@ -566,6 +566,7 @@ static int ft900_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
* The FT-900 only supports narrow width in AM and CW modes
|
||||
*
|
||||
*/
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == rig_passband_narrow(rig, mode)) {
|
||||
switch(mode) {
|
||||
case RIG_MODE_CW:
|
||||
|
@ -583,6 +584,7 @@ static int ft900_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
return -RIG_EINVAL; /* Invalid width, how can caller know? */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set mode_parm = 0x%02x\n", __func__, mode_parm);
|
||||
|
||||
|
|
|
@ -723,6 +723,7 @@ static int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
|||
* Yeah, it's ugly... -N0NB
|
||||
*
|
||||
*/
|
||||
if (width != RIG_PASSBAND_NOCHANGE) {
|
||||
if (width == RIG_PASSBAND_NORMAL || width == rig_passband_normal(rig, mode)) {
|
||||
switch(vfo) {
|
||||
case RIG_VFO_A:
|
||||
|
@ -766,6 +767,7 @@ static int ft920_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width ) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set mode_parm = 0x%02x\n", __func__, mode_parm);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set cmd_index = %i\n", __func__, cmd_index);
|
||||
|
|
|
@ -728,7 +728,9 @@ int ft980_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
return -RIG_EINVAL; /* sorry, wrong MODE */
|
||||
}
|
||||
|
||||
if (width != RIG_PASSBAND_NORMAL && width < rig_passband_normal(rig, mode)) {
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width != RIG_PASSBAND_NORMAL
|
||||
&& width < rig_passband_normal(rig, mode)) {
|
||||
switch(md) {
|
||||
case MD_CW: md = MD_CWN; break;
|
||||
case MD_AM: md = MD_AMN; break;
|
||||
|
|
|
@ -1608,6 +1608,7 @@ int ft990_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
ci == FT990_NATIVE_MODE_SET_PKT_FM)
|
||||
return RIG_OK;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return err;
|
||||
switch(width) {
|
||||
case 250:
|
||||
bw = FT990_BW_F250;
|
||||
|
|
|
@ -555,9 +555,6 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
rig_debug(RIG_DEBUG_VERBOSE,"%s: generic mode = %x \n",
|
||||
__func__, mode);
|
||||
|
||||
if (RIG_PASSBAND_NORMAL == width)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
switch(mode) {
|
||||
case RIG_MODE_LSB:
|
||||
priv->cmd_str[3] = '1';
|
||||
|
@ -600,6 +597,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (err != RIG_OK)
|
||||
return err;
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) return err;
|
||||
if (RIG_PASSBAND_NORMAL == width)
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
||||
|
|
|
@ -450,7 +450,9 @@ int mode2rig(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
case RIG_MODE_WFM: md = MODE_WFM; break;
|
||||
case RIG_MODE_FM: md = MODE_FMN; break;
|
||||
case RIG_MODE_AM:
|
||||
if (width != RIG_PASSBAND_NORMAL && width < rig_passband_normal(rig, mode))
|
||||
if (width != RIG_PASSBAND_NOCHANGE
|
||||
&& width != RIG_PASSBAND_NORMAL
|
||||
&& width < rig_passband_normal(rig, mode))
|
||||
md = MODE_AMN;
|
||||
else if (width != RIG_PASSBAND_NORMAL && width > rig_passband_normal(rig, mode))
|
||||
md = MODE_AMW;
|
||||
|
|
Ładowanie…
Reference in New Issue