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

shortfreq_t HAMLIB_API rig_get_resolution ( RIG rig,
rmode_t  mode 
)

get the best frequency resolution of the rig

Parameters:
rigThe rig handle
modeThe mode where the conversion should take place

Returns the best frequency resolution of the rig, for a given mode.

Returns:
the frequency resolution in Hertz if the operation h has been sucessful, otherwise a negative value if an error occured.

Definition at line 2294 of file rig.c.

References caps, tuning_step_list::modes, RIG_EINVAL, state, tuning_step_list::ts, and rig_state::tuning_steps.

{
      const struct rig_state *rs;
      int i;

      if (!rig || !rig->caps || !mode)
            return -RIG_EINVAL;

      rs = &rig->state;

      for (i=0; i<TSLSTSIZ && rs->tuning_steps[i].ts; i++) {
            if (rs->tuning_steps[i].modes & mode)
                  return rs->tuning_steps[i].ts;
      }

      return -RIG_EINVAL;
}

Generated by  Doxygen 1.6.0   Back to index