Logo Search packages:      
Sourcecode: hamlib version File versions

static int tt565_vfo_op ( RIG rig,
vfo_t  vfo,
vfo_op_t  op 
)

perform a RIG_OP operation

Parameters:
rig != NULL
vfo 
op Operation to perform, a RIG_OP token
Returns:
RIG_OK or < 0 Supported operations:
RIG_OP_TO_VFO memory channel to VFO (includes bw, mode, etc)
RIG_OP_FROM_VFO stores VFO (& other data) to memory channel
RIG_OP_TUNE initiates a tuner cycle (if tuner present) MAY BE BROKEN
RIG_OP_UP increment VFO freq by tuning step
RIG_OP_DOWN decrement VFO freq by tuning step

Definition at line 1484 of file orion.c.

References tt565_priv_data::ch, EOM, rig_state::priv, rig_debug(), RIG_DEBUG_ERR, RIG_EINVAL, RIG_OP_DOWN, RIG_OP_FROM_VFO, RIG_OP_TO_VFO, RIG_OP_TUNE, RIG_OP_UP, rig::state, tt565_transaction(), and which_vfo().

{
      struct tt565_priv_data *priv = (struct tt565_priv_data *)rig->state.priv;
      char cmdbuf[TT565_BUFSIZE];
      int retval;
      int cmd_len;

      switch (op) {
      case RIG_OP_TO_VFO:
      case RIG_OP_FROM_VFO:
            cmd_len = sprintf (cmdbuf, "*K%c%c%d" EOM, 
                  op == RIG_OP_TO_VFO ? 'R' : 'W',
                  which_vfo(rig, vfo),
                  priv->ch);
            break;

      case RIG_OP_TUNE:
            strcpy(cmdbuf, "*TTT" EOM);
            cmd_len = 5;
            break;

      case RIG_OP_UP:
      case RIG_OP_DOWN:
            cmd_len = sprintf (cmdbuf, "*%cS%c1" EOM, 
                  which_vfo(rig, vfo),
                  op == RIG_OP_UP ? '+' : '-');
            break;

      default:
            rig_debug(RIG_DEBUG_ERR,"%s: Unsupported op %d\n", 
                        __FUNCTION__, op);
            return -RIG_EINVAL;
      }

      retval = tt565_transaction (rig, cmdbuf, cmd_len, NULL, NULL);
      return retval;
}


Generated by  Doxygen 1.6.0   Back to index