Logo Search packages:      
Sourcecode: hamlib version File versions

int HAMLIB_API rig_get_ctcss_sql ( RIG rig,
vfo_t  vfo,
tone_t tone 

get the current CTCSS squelch

rig The rig handle
vfo The target VFO
tone The location where to store the current tone
Retrieves the current Continuous Tone Controlled Squelch System (CTCSS) sub-audible *squelch* tone.
*tone is NOT in Hz, but in tenth of Hz! This way, if the function rig_get_ctcss_sql() returns a subaudible tone of 885 for example, then the real tone is 88.5 Hz. Also, a value of 0 for tone means the Tone squelch is disabled.
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_ctcss_sql(), rig_get_ctcss_tone()

Definition at line 331 of file tones.c.

References caps, rig_state::current_vfo, rig_caps::get_ctcss_sql, RIG_EINVAL, RIG_ENAVAIL, RIG_ENTARGET, 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) || !tone)
            return -RIG_EINVAL;

      caps = rig->caps;

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

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

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

Generated by  Doxygen 1.6.0   Back to index