Logo Search packages:      
Sourcecode: hamlib version File versions

static int tt565_set_mode ( RIG rig,
vfo_t  vfo,
rmode_t  mode,
pbwidth_t  width 
)

Set operating mode to RIG_MODE_x with indicated passband width.

Parameters:
rig must != NULL
vfo 
mode 
width passband in Hz or = RIG_PASSBAND_NORMAL (=0) which gives a nominal value Supported modes x= USB, LSB, CW, CWR, AM, FM, RTTY
This applies to currently selected receiver (Main Rx=Tx or Sub Rx)
See also:
tt565_set_vfo
Remarks:
Note widespread confusion between "VFO" and "Receiver". The Orion has VFOs A and B which may be mapped to Main and Sub Receivers independently. But Hamlib may have different ideas!

Definition at line 532 of file orion.c.

References EOM, rig_debug(), RIG_DEBUG_ERR, RIG_EINVAL, RIG_MODE_AM, RIG_MODE_CW, RIG_MODE_CWR, RIG_MODE_FM, RIG_MODE_LSB, RIG_MODE_RTTY, RIG_MODE_USB, rig_passband_normal(), rig_state::rigport, rig::state, TT565_AM, TT565_CW, TT565_CWR, TT565_FM, TT565_LSB, TT565_RTTY, TT565_USB, which_receiver(), and write_block().

{
      struct rig_state *rs = &rig->state;
      char ttmode, ttreceiver;
      int mdbuf_len, retval;
      char mdbuf[TT565_BUFSIZE];

      switch (mode) {
      case RIG_MODE_USB:      ttmode = TT565_USB; break;
      case RIG_MODE_LSB:      ttmode = TT565_LSB; break;
      case RIG_MODE_CW: ttmode = TT565_CW; break;
      case RIG_MODE_CWR:      ttmode = TT565_CWR; break;
      case RIG_MODE_AM: ttmode = TT565_AM; break;
      case RIG_MODE_FM: ttmode = TT565_FM; break;
      case RIG_MODE_RTTY:     ttmode = TT565_RTTY; break;
      default:
            rig_debug(RIG_DEBUG_ERR, "%s: unsupported mode %d\n",
                              __FUNCTION__, mode);
            return -RIG_EINVAL;
      }

      if (width == RIG_PASSBAND_NORMAL)
            width = rig_passband_normal(rig, mode);

      ttreceiver = which_receiver(rig, vfo);

      mdbuf_len = sprintf(mdbuf, "*R%cM%c" EOM "*R%cF%d" EOM,
                                    ttreceiver,
                                    ttmode,
                                    ttreceiver,
                                    (int)width
                                    );

      retval = write_block(&rs->rigport, mdbuf, mdbuf_len);

      return retval;
}


Generated by  Doxygen 1.6.0   Back to index