Logo Search packages:      
Sourcecode: hamlib version File versions

pbwidth_t HAMLIB_API rig_passband_narrow ( RIG rig,
rmode_t  mode 

get the narrow passband of a mode

rig The rig handle
mode The mode to get the passband
Returns the narrow (closest) passband for the given mode. EXAMPLE: rig_set_mode(my_rig, RIG_MODE_LSB, rig_passband_narrow(my_rig, RIG_MODE_LSB) );

the passband in Hz if the operation has been sucessful, or a 0 if an error occured (passband not found, whatever).
See also:
rig_passband_normal(), rig_passband_wide()

Definition at line 985 of file rig.c.

References rig_state::filters, filter_list::modes, state, and filter_list::width.

      const struct rig_state *rs;
      pbwidth_t normal;
      int i;

      if (!rig)
            return 0;   /* huhu! */

      rs = &rig->state;

      for (i=0; i<FLTLSTSIZ-1 && rs->filters[i].modes; i++) {
            if (rs->filters[i].modes & mode) {
                  normal = rs->filters[i].width;
                  for (i++; i<FLTLSTSIZ && rs->filters[i].modes; i++) {
                        if ((rs->filters[i].modes & mode) &&
                                    (rs->filters[i].width < normal)) {
                              return rs->filters[i].width;
                  return 0;

      return 0;

Generated by  Doxygen 1.6.0   Back to index