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

int HAMLIB_API rig_get_split_vfo ( RIG rig,
vfo_t  vfo,
split_t split,
vfo_t tx_vfo 
)

get the current split mode

Parameters:
rigThe rig handle
vfoThe target VFO
splitThe location where to store the current split mode
tx_vfoThe transmit VFO

Retrieves the current split mode.

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

Definition at line 1873 of file rig.c.

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

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

      if (CHECK_RIG_ARG(rig) || !split || !tx_vfo)
            return -RIG_EINVAL;

      caps = rig->caps;

      if (caps->get_split_vfo == NULL)
            return -RIG_ENAVAIL;

      /* overidden by backend at will */
      *tx_vfo = rig->state.tx_vfo;

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

      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_split_vfo(rig, vfo, split, tx_vfo);
      caps->set_vfo(rig, curr_vfo);
      return retcode;
}

Generated by  Doxygen 1.6.0   Back to index