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

int HAMLIB_API rig_set_conf ( RIG rig,
token_t  token,
const char *  val 
)

set a radio configuration parameter

Parameters:
rig The rig handle
token The parameter
val The value to set the parameter to
Sets a configuration parameter.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_conf()

Definition at line 552 of file conf.c.

References caps, IS_TOKEN_FRONTEND, confparams::name, rig_confparam_lookup(), rig_debug(), RIG_DEBUG_VERBOSE, RIG_EINVAL, RIG_ENAVAIL, rig_need_debug(), and rig_caps::set_conf.

{
      if (!rig || !rig->caps)
            return -RIG_EINVAL;

    if (rig_need_debug(RIG_DEBUG_VERBOSE)) {
          const struct confparams *cfp;
        char tokenstr[12];
        sprintf(tokenstr, "%ld", token);
        cfp = rig_confparam_lookup(rig, tokenstr);
        if (!cfp)
            return -RIG_EINVAL;
        rig_debug(RIG_DEBUG_VERBOSE, "%s: %s='%s'\n", __func__, cfp->name, val);
    }

      if (IS_TOKEN_FRONTEND(token))
            return frontend_set_conf(rig, token, val);

      if (rig->caps->set_conf == NULL)
            return -RIG_ENAVAIL;

      return rig->caps->set_conf(rig, token, val);
}


Generated by  Doxygen 1.6.0   Back to index