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

static int tt565_set_func ( RIG rig,
vfo_t  vfo,
setting_t  func,
int  status 
)

Set an Orion "function".

Parameters:
rig!= NULL
vfo
funcIdentifier for function to be performed
statusdata for function
Returns:
RIG_OK or < 0 Note that vfo must == RIG_VFO_CURR

Supported functions & data
RIG_FUNC_TUNER, off/on, 0/1
RIG_FUNC_VOX, off/on, 0/1
RIG_FUNC_LOCK, unlock/lock, 0/1
RIG_FUNC_NB, off/on, 0/1 (sets Orion NB=0 or =4), compare RIG_LEVEL_NR

Definition at line 1593 of file orion.c.

References EOM, rig_debug(), RIG_DEBUG_ERR, RIG_EINVAL, RIG_FUNC_LOCK, RIG_FUNC_NB, RIG_FUNC_TUNER, RIG_FUNC_VOX, RIG_OK, RIG_VFO_CURR, tt565_transaction(), which_receiver(), and which_vfo().

{
      char fcmdbuf[TT565_BUFSIZE];
      int retval, fcmdlen;

      if (vfo != RIG_VFO_CURR)
            return -RIG_EINVAL;

      switch (func) {
      case RIG_FUNC_TUNER:
            fcmdlen = sprintf(fcmdbuf,"*TT%c" EOM, !status ? 0:1);
            break;

      case RIG_FUNC_VOX:
            fcmdlen = sprintf(fcmdbuf,"*TV%c" EOM, !status ? 0:1);
            break;

      case RIG_FUNC_LOCK:
            fcmdlen = sprintf(fcmdbuf,"*%c%c" EOM,
                  which_vfo(rig, vfo),
                  !status ? 'U' : 'L' );
            break;

      case RIG_FUNC_NB:
            /* NB "on" sets Orion NB=4; "off" -> NB=0.  See also
            RIG_LEVEL_NR which maps to NB setting due to firmware
            limitation.
            */
            fcmdlen = sprintf(fcmdbuf,"*R%cNB%c" EOM,
                  which_receiver(rig, vfo),
                  !status ? '0' : '4' );
            break;

      default:
                rig_debug(RIG_DEBUG_ERR,"Unsupported set_func %#x", func);
                return -RIG_EINVAL;
      }     
        retval = tt565_transaction(rig, fcmdbuf, fcmdlen, NULL, NULL);

        if (retval != RIG_OK)
                return retval;
      return RIG_OK;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index