kopia lustrzana https://github.com/Hamlib/Hamlib
commit
6d5eb2052e
|
@ -2220,64 +2220,61 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
|
||||
// if we already set width we won't update with except during set_vfo or set_mode
|
||||
// reason is we can't get width without swapping vfos -- yuck!!
|
||||
if (width != NULL)
|
||||
if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A |
|
||||
RIG_VFO_CURR))
|
||||
{
|
||||
if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A |
|
||||
RIG_VFO_CURR))
|
||||
// then we get what was asked for
|
||||
if (vfo == RIG_VFO_NONE && rig->state.current_vfo == RIG_VFO_NONE)
|
||||
{
|
||||
// then we get what was asked for
|
||||
if (vfo == RIG_VFO_NONE && rig->state.current_vfo == RIG_VFO_NONE)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): forcing default VFO_A\n", __func__,
|
||||
__LINE__);
|
||||
TRACE;
|
||||
rig_set_vfo(rig, RIG_VFO_A); // force VFOA
|
||||
}
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): forcing default VFO_A\n", __func__,
|
||||
__LINE__);
|
||||
TRACE;
|
||||
rig_set_vfo(rig, RIG_VFO_A); // force VFOA
|
||||
}
|
||||
|
||||
retval = icom_get_dsp_flt(rig, *mode);
|
||||
*width = retval;
|
||||
|
||||
if (retval == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: vfo=%s returning mode=%s, width not available\n", __func__,
|
||||
rig_strvfo(vfo), rig_strrmode(*mode));
|
||||
}
|
||||
}
|
||||
else if (rig->state.cache.widthMainB == 0)
|
||||
{
|
||||
// we need to swap vfos to get the bandwidth -- yuck
|
||||
// so we read it once and will let set_mode and transceive capability (4.3 hamlib) update it
|
||||
vfo_t vfosave = rig->state.current_vfo;
|
||||
|
||||
if (vfosave != vfo)
|
||||
{
|
||||
// right now forcing VFOA/B arrangement -- reverse not supported yet
|
||||
// If VFOB width is ever different than VFOA
|
||||
// we need to figure out how to read VFOB without swapping VFOs
|
||||
//TRACE;
|
||||
//rig_set_vfo(rig, RIG_VFO_B);
|
||||
retval = icom_get_dsp_flt(rig, *mode);
|
||||
*width = retval;
|
||||
|
||||
if (retval == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: vfo=%s returning mode=%s, width not available\n", __func__,
|
||||
rig_strvfo(vfo), rig_strrmode(*mode));
|
||||
}
|
||||
if (*width == 0) { *width = rig->state.cache.widthMainA; } // we'll use VFOA's width
|
||||
|
||||
// dont' really care about cache time here
|
||||
// this is just to prevent vfo swapping while getting width
|
||||
rig->state.cache.widthMainB = retval;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): vfosave=%s, currvfo=%s\n", __func__,
|
||||
__LINE__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
||||
//TRACE;
|
||||
//rig_set_vfo(rig, RIG_VFO_A);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s returning mode=%s, width=%d\n", __func__,
|
||||
rig_strvfo(vfo), rig_strrmode(*mode), (int)*width);
|
||||
}
|
||||
else if (rig->state.cache.widthMainB == 0)
|
||||
else
|
||||
{
|
||||
// we need to swap vfos to get the bandwidth -- yuck
|
||||
// so we read it once and will let set_mode and transceive capability (4.3 hamlib) update it
|
||||
vfo_t vfosave = rig->state.current_vfo;
|
||||
|
||||
if (vfosave != vfo)
|
||||
{
|
||||
// right now forcing VFOA/B arrangement -- reverse not supported yet
|
||||
// If VFOB width is ever different than VFOA
|
||||
// we need to figure out how to read VFOB without swapping VFOs
|
||||
//TRACE;
|
||||
//rig_set_vfo(rig, RIG_VFO_B);
|
||||
retval = icom_get_dsp_flt(rig, *mode);
|
||||
*width = retval;
|
||||
|
||||
if (*width == 0) { *width = rig->state.cache.widthMainA; } // we'll use VFOA's width
|
||||
|
||||
// dont' really care about cache time here
|
||||
// this is just to prevent vfo swapping while getting width
|
||||
rig->state.cache.widthMainB = retval;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): vfosave=%s, currvfo=%s\n", __func__,
|
||||
__LINE__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo));
|
||||
//TRACE;
|
||||
//rig_set_vfo(rig, RIG_VFO_A);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s returning mode=%s, width=%d\n", __func__,
|
||||
rig_strvfo(vfo), rig_strrmode(*mode), (int)*width);
|
||||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s: vfo arrangement not supported yet, vfo=%s, currvfo=%s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strvfo(vfosave));
|
||||
}
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s: vfo arrangement not supported yet, vfo=%s, currvfo=%s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strvfo(vfosave));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -467,10 +467,7 @@ int ft600_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (width != NULL)
|
||||
{
|
||||
*width = RIG_PASSBAND_NORMAL;
|
||||
}
|
||||
*width = RIG_PASSBAND_NORMAL;
|
||||
|
||||
ret = ft600_read_status(rig);
|
||||
|
||||
|
|
|
@ -10080,16 +10080,13 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width)
|
|||
|
||||
ENTERFUNC;
|
||||
|
||||
if (width != NULL)
|
||||
{
|
||||
*width = RIG_PASSBAND_NORMAL;
|
||||
}
|
||||
*width = RIG_PASSBAND_NORMAL;
|
||||
|
||||
for (i = 0; i < sizeof(newcat_mode_conv) / sizeof(newcat_mode_conv[0]); i++)
|
||||
{
|
||||
if (newcat_mode_conv[i].modechar == mode)
|
||||
{
|
||||
if (newcat_mode_conv[i].chk_width == TRUE && width != NULL)
|
||||
if (newcat_mode_conv[i].chk_width == TRUE)
|
||||
{
|
||||
if (newcat_is_rig(rig, RIG_MODEL_FT991)
|
||||
&& mode == 'E') // crude fix because 991 hangs on NA0; command while in C4FM
|
||||
|
|
|
@ -2297,6 +2297,9 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
* The value stored at \a mode location equals RIG_MODE_NONE when the current
|
||||
* mode of the VFO is not defined (e.g. blank memory).
|
||||
*
|
||||
* Note that if either \a mode or \a width is NULL, -RIG_EINVAL is returned.
|
||||
* Both must be given even if only one is actually wanted.
|
||||
*
|
||||
* \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise
|
||||
* a negative value if an error occurred (in which case, cause is
|
||||
* set appropriately).
|
||||
|
|
Ładowanie…
Reference in New Issue