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

int HAMLIB_API rig_set_mem ( RIG rig,
vfo_t  vfo,
int  ch 

set the current memory channel number

rig The rig handle
vfo The target VFO
ch The memory channel number
Sets the current memory channel number. It is not mandatory for the radio to be in memory mode. Actually it depends on rigs. YMMV.

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:

Definition at line 71 of file mem.c.

References rig::caps, rig_state::current_vfo, RIG_VFO_CURR, rig_caps::set_mem, rig_caps::set_vfo, rig::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->set_mem == NULL)
            return -RIG_ENAVAIL;

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

      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->set_mem(rig, vfo, ch);
      caps->set_vfo(rig, curr_vfo);
      return retcode;

Generated by  Doxygen 1.6.0   Back to index