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

int HAMLIB_API rig_get_func ( RIG rig,
vfo_t  vfo,
setting_t  func,
int *  status 
)

get the status of functions of the radio

Parameters:
rig The rig handle
vfo The target VFO
func The functions to get the status
status The location where to store the function status
Retrieves the status (on/off) of a function of the radio. Upon return, status will hold the status of the function, The value pointer to by the status argument is a non null value for "on", "off" otherwise, much as TRUE/FALSE definitions in C language.

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_set_func()

Definition at line 447 of file settings.c.

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

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

      if (CHECK_RIG_ARG(rig) || !func)
            return -RIG_EINVAL;

      caps = rig->caps;

      if (caps->get_func == NULL || !rig_has_get_func(rig,func))
            return -RIG_ENAVAIL;

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

      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->get_func(rig, vfo, func, status);
      caps->set_vfo(rig, curr_vfo);
      return retcode;
}


Generated by  Doxygen 1.6.0   Back to index