Logo Search packages:      
Sourcecode: hamlib version File versions

const freq_range_t* HAMLIB_API rig_get_range ( const freq_range_t  range_list[],
freq_t  freq,
rmode_t  mode 
)

find the freq_range of freq/mode

Parameters:
range_list The range list to search from
freq The frequency that will be part of this range
mode The mode that will be part of this range
Returns a pointer to the freq_range_t including freq and mode. Works for rx and tx range list as well.

Returns:
the location of the freq_range_t if found, otherwise NULL if not found or if range_list is invalid.

Definition at line 2734 of file rig.c.

Referenced by rig_mW2power(), and rig_power2mW().

{
      int i;

      for (i=0; i<FRQRANGESIZ; i++) {
            if (range_list[i].start == 0 && range_list[i].end == 0) {
                  return NULL;
            }
            if (freq >= range_list[i].start && freq <= range_list[i].end &&
                        (range_list[i].modes & mode)) {
                  return &range_list[i];
            }
      }
      return NULL;
}


Generated by  Doxygen 1.6.0   Back to index