Logo Search packages:      
Sourcecode: hamlib version File versions  Download package

int HAMLIB_API rig_vfo_op ( RIG rig,
vfo_t  vfo,
vfo_op_t  op 
)

perform Memory/VFO operations

Parameters:
rigThe rig handle
vfoThe target VFO
opThe Memory/VFO operation to perform

Performs Memory/VFO operation. See vfo_op_t for more information.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_has_vfo_op()

Definition at line 2560 of file rig.c.

References caps, rig_state::current_vfo, RIG_EINVAL, RIG_ENAVAIL, RIG_ENTARGET, rig_has_vfo_op(), RIG_OK, RIG_VFO_CURR, state, and rig_caps::targetable_vfo.

Referenced by rig_get_channel(), and rig_set_channel().

{
      const struct rig_caps *caps;
      int retcode;
      vfo_t curr_vfo;

      if (CHECK_RIG_ARG(rig))
            return -RIG_EINVAL;

      caps = rig->caps;

      if (caps->vfo_op == NULL || !rig_has_vfo_op(rig,op))
            return -RIG_ENAVAIL;

      if ((caps->targetable_vfo&RIG_TARGETABLE_PURE) ||
                  vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo)
            return caps->vfo_op(rig, vfo, op);

      if (!caps->set_vfo)
            return -RIG_ENTARGET;
      curr_vfo = rig->state.current_vfo;
      retcode = caps->set_vfo(rig, vfo);
      if (retcode != RIG_OK)
            return retcode;

      retcode = caps->vfo_op(rig, vfo, op);
      caps->set_vfo(rig, curr_vfo);
      return retcode;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index