Re: [Hamlib-developer] rig not supporting target VFO
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Frank S. <vk...@ix...> - 2001-01-06 06:20:46
|
Stephane Fillod wrote:
>
<snip>
>
> int rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
> {
> int retcode;
> vfo_t curr_vfo;
>
> if (!rig || !rig->caps)
> return -RIG_EINVAL;
>
> if (rig->caps->set_mode == NULL)
> return -RIG_ENAVAIL;
>
> if (rig->caps->targetable_vfo || vfo == RIG_VFO_CURR ||
> vfo == rig->state.current_vfo)
> return rig->caps->set_mode(rig, vfo, mode, width);
>
> if (!rig->caps->set_vfo)
> return -RIG_ENTARGET;
> curr_vfo = rig->state.current_vfo;
^
|
+--------- what is initial value ?
If _set_mode called on a rig that has targetable_vfo = 0, then
we send #%$ if no VFO has been set.
TODO: Think of initial values. This was in backend for my FT747,
but now its a frontend responsibility (or app ?)
Should we change it change this to
int rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
int retcode;
vfo_t curr_vfo;
if (!rig || !rig->caps)
return -RIG_EINVAL;
if (rig->caps->set_mode == NULL)
return -RIG_ENAVAIL;
if (rig->caps->targetable_vfo || vfo == RIG_VFO_CURR ||
vfo ==
rig->state.current_vfo)
return rig->caps->set_mode(rig, vfo, mode,
width);
if (!rig->caps->set_vfo)
return -RIG_ENTARGET;
#if 1
if (rig->state.current_vfo = NULL)
return -RIG_ENCURRVFO;
#endif
curr_vfo = rig->state.current_vfo;
retcode = rig->caps->set_vfo(rig, vfo);
if (retcode != RIG_OK)
return retcode;
retcode = rig->caps->set_mode(rig, vfo, mode, width);
rig->caps->set_vfo(rig, curr_vfo);
return retcode;
}
The frontend initially sets rig->state.current_vfo = ZNULLVFO
during initialsation.
Comments ??
--
Cheers / Frank
73's de vk3fcs & km5ws
|