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

int HAMLIB_API rig_set_split_freq ( RIG rig,
vfo_t  vfo,
freq_t  tx_freq 

set the split frequencies

rigThe rig handle
vfoThe target VFO
tx_freqThe transmit split frequency to set to

Sets the split(TX) frequency.

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_get_split_freq(), rig_set_split_vfo()

Definition at line 1532 of file rig.c.

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

      const struct rig_caps *caps;
      int retcode;
      vfo_t curr_vfo, tx_vfo;

      if (CHECK_RIG_ARG(rig))
            return -RIG_EINVAL;

      caps = rig->caps;

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

      /* Assisted mode */

      curr_vfo = rig->state.current_vfo;

      /* Use previously setup TxVFO */
      if (vfo == RIG_VFO_CURR || vfo == RIG_VFO_TX)
            tx_vfo = rig->state.tx_vfo;
            tx_vfo = vfo;

      if (caps->set_freq && (caps->targetable_vfo&RIG_TARGETABLE_FREQ))
            return caps->set_freq(rig, tx_vfo, tx_freq);

      if (caps->set_vfo) {
            retcode = caps->set_vfo(rig, tx_vfo);
      } else if (rig_has_vfo_op(rig, RIG_OP_TOGGLE) && caps->vfo_op) {
            retcode = caps->vfo_op(rig, vfo, RIG_OP_TOGGLE);
      } else {
            return -RIG_ENAVAIL;
      if (retcode != RIG_OK)
            return retcode;

      if (caps->set_split_freq)
            retcode = caps->set_split_freq(rig, vfo, tx_freq);
            retcode = caps->set_freq(rig, RIG_VFO_CURR, tx_freq);

      if (caps->set_vfo) {
            caps->set_vfo(rig, curr_vfo);
      } else {
            caps->vfo_op(rig, vfo, RIG_OP_TOGGLE);
      return retcode;

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index