diff --git a/icom/ic746.c b/icom/ic746.c index d1f8599d0..0cabaf419 100644 --- a/icom/ic746.c +++ b/icom/ic746.c @@ -2,7 +2,7 @@ * Hamlib CI-V backend - description of IC-746 and variations * Copyright (c) 2000-2003 by Stephane Fillod * - * $Id: ic746.c,v 1.9 2006-11-07 12:21:39 n0nb Exp $ + * $Id: ic746.c,v 1.10 2007-02-28 08:50:19 mardigras Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -313,7 +313,7 @@ const struct rig_caps ic746_caps = { }; - /*IC-746Pro Rig parameters Only available in this namespace*/ + /* IC-746Pro Rig parameters Only available in this namespace. This is a partial list */ #define S_MEM_SC_LEN 2 /* 756PRO S_MEM subcmd length */ #define S_MEM_LCD_CONT 0x501 /* LCD Contrast 0-256/0-100% */ #define S_MEM_BKLIT 0x502 /* Backlight 0-256/0-100% */ @@ -348,7 +348,7 @@ static const struct confparams ic746pro_ext_parms[] = { NULL, RIG_CONF_COMBO, { .c = {{ "Auto", "Sql", "RF+Sql", NULL }} } }, { TOK_RTTY_FLTR, "rttyfltr", "RTTY Fltr Width preset", "Set/Read RTTY preset filter width", - "3", RIG_CONF_COMBO, { .c = {{"250", "300", "350", "500", "1000", NULL }} } + "350", RIG_CONF_COMBO, { .c = {{"250", "300", "350", "500", "1000", NULL }} } }, { RIG_CONF_END, NULL, } }; @@ -356,7 +356,7 @@ static const struct confparams ic746pro_ext_parms[] = { /* * NUMERIC: val.f - * COMBO: val.i, starting from 0 + * COMBO: val.i, starting from 0 Index to a string table. * STRING: val.cs for set, val.s for get * CHECKBUTTON: val.i 0/1 */ @@ -574,9 +574,9 @@ static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val) icom_val = val.i; break; case TOK_RTTY_FLTR: /* RTTY filter mode 0 - 4 = 250, 300, 350, 500, 1000 */ - if (val.f < 0 || val.f > 4) return -RIG_EINVAL; + if (val.i < 0 || val.i > 4) return -RIG_EINVAL; ep_sc = S_MEM_RTTY_FL_PB; - icom_val = val.f; + icom_val = val.i; break; default: return -RIG_EINVAL; @@ -664,6 +664,7 @@ static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val) case RIG_CONF_STRING: memcpy(val->s, resbuf, res_len); break; + case RIG_CONF_CHECKBUTTON: case RIG_CONF_COMBO: val->i = from_bcd_be(resbuf+cmdhead, res_len*2); break; @@ -675,9 +676,6 @@ static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val) "len=%d\n", __FUNCTION__,resbuf[0],res_len); return -RIG_EPROTO; - /* The examples of code usage for RIG_CONF_NUMERIC types seems to be restricted to raw floating - point values. Although the Val definitions allow both integer and floating point types The combo - types appear to be left in undecoded form*/ } rig_debug(RIG_DEBUG_TRACE,"%s: %d %d %d %f\n", __FUNCTION__, res_len, icom_val, val->i, val->f); diff --git a/icom/ic756.c b/icom/ic756.c index b5245fc77..3e159f83d 100644 --- a/icom/ic756.c +++ b/icom/ic756.c @@ -2,7 +2,7 @@ * Hamlib CI-V backend - description of IC-756 and variations * Copyright (c) 2000-2004 by Stephane Fillod * - * $Id: ic756.c,v 1.15 2006-10-07 20:13:21 csete Exp $ + * $Id: ic756.c,v 1.16 2007-02-28 08:50:20 mardigras Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -397,7 +397,7 @@ static const struct confparams ic756pro2_ext_parms[] = { NULL, RIG_CONF_STRING, { } }, { TOK_RTTY_FLTR, "rttyfltr", "RTTY Fltr Width preset", "Set/Read RTTY preset filter width", - "3", RIG_CONF_COMBO, { .c = {{"250", "300", "350", "500", "1000", NULL }} } + "350", RIG_CONF_COMBO, { .c = {{"250", "300", "350", "500", "1000", NULL }} } }, { RIG_CONF_END, NULL, } }; @@ -618,7 +618,7 @@ static int ic756pro2_set_ext_parm(RIG *rig, token_t token, value_t val) case TOK_RTTY_FLTR: /* RTTY filter mode 0 - 4 = 250, 300, 350, 500, 1000 */ if (val.i < 0 || val.i > 4) return -RIG_EINVAL; ep_sc = S_MEM_RTTY_FL_PB; - icom_val = val.f; + icom_val = val.i; break; default: return -RIG_EINVAL; @@ -712,6 +712,7 @@ static int ic756pro2_get_ext_parm(RIG *rig, token_t token, value_t *val) case RIG_CONF_STRING: memcpy(val->s, resbuf, res_len); break; + case RIG_CONF_CHECKBUTTON: case RIG_CONF_COMBO: val->i = from_bcd_be(resbuf+cmdhead, res_len*2); break; @@ -723,9 +724,6 @@ static int ic756pro2_get_ext_parm(RIG *rig, token_t token, value_t *val) "len=%d\n", __FUNCTION__,resbuf[0],res_len); return -RIG_EPROTO; - /* The examples of code usage for RIG_CONF_NUMERIC types seems to be restricted to raw floating - point values. Although the Val definitions allow both integer and floating point types The combo - types appear to be left in undecoded form*/ } rig_debug(RIG_DEBUG_TRACE,"%s: %d %d %d %f\n", __FUNCTION__, res_len, icom_val, val->i, val->f); diff --git a/icom/icom.c b/icom/icom.c index 21016a4f4..11af8558b 100644 --- a/icom/icom.c +++ b/icom/icom.c @@ -2,7 +2,7 @@ * Hamlib CI-V backend - main file * Copyright (c) 2000-2005 by Stephane Fillod * - * $Id: icom.c,v 1.100 2007-01-27 23:50:13 n0nb Exp $ + * $Id: icom.c,v 1.101 2007-02-28 08:50:20 mardigras Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -578,7 +578,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) /* Most rigs return 1-wide, 2-normal,3-narrow For DSP rigs these are presets, can be programmed for 30 - 41 bandwidths, depending on mode Lets check for dsp filters */ - if ((retval = icom_get_dsp_flt(rig, *mode))) + if ((retval = icom_get_dsp_flt(rig, *mode)) !=0) *width = retval; return RIG_OK; diff --git a/icom/icom.h b/icom/icom.h index 1854eb24c..cef42f809 100644 --- a/icom/icom.h +++ b/icom/icom.h @@ -2,7 +2,7 @@ * Hamlib CI-V backend - main header * Copyright (c) 2000-2004 by Stephane Fillod * - * $Id: icom.h,v 1.74 2006-11-07 12:21:39 n0nb Exp $ + * $Id: icom.h,v 1.75 2007-02-28 08:50:20 mardigras Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -122,7 +122,7 @@ extern const struct ts_sc_list ic7000_ts_sc_list[]; extern const struct ts_sc_list ic910_ts_sc_list[]; extern const struct ts_sc_list ic718_ts_sc_list[]; -extern const pbwidth_t rtty_fil[]; /* rtty filter passband width; available on pro rigs */ +extern const pbwidth_t rtty_fil[]; /* rtty filter passband width; available on 746pro and 756pro rigs */ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode); diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 0659b2547..cfe786be0 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2,7 +2,7 @@ * Hamlib Interface - API header * Copyright (c) 2000-2005 by Stephane Fillod and Frank Singleton * - * $Id: rig.h,v 1.120 2006-11-07 12:21:39 n0nb Exp $ + * $Id: rig.h,v 1.121 2007-02-28 08:52:49 mardigras Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -439,8 +439,8 @@ typedef enum { RIG_OP_FROM_VFO = (1<<2), /*!< VFO->MEM */ RIG_OP_TO_VFO = (1<<3), /*!< MEM->VFO */ RIG_OP_MCL = (1<<4), /*!< Memory clear */ - RIG_OP_UP = (1<<5), /*!< UP */ - RIG_OP_DOWN = (1<<6), /*!< DOWN */ + RIG_OP_UP = (1<<5), /*!< UP increment VFO freq by tuning step*/ + RIG_OP_DOWN = (1<<6), /*!< DOWN decrement VFO freq by tuning step*/ RIG_OP_BAND_UP = (1<<7), /*!< Band UP */ RIG_OP_BAND_DOWN = (1<<8), /*!< Band DOWN */ RIG_OP_LEFT = (1<<9), /*!< LEFT */ @@ -473,13 +473,23 @@ typedef long token_t; #define RIG_CONF_END 0 /** - * \brief Configuration parameter types + * \brief parameter types + * + * Used with configuration, parameter and extra-parm tables. + * + * Current internal implementation + * NUMERIC: val.f or val.i + * COMBO: val.i, starting from 0. Points to a table of strings or asci stored values. + * STRING: val.s or val.cs + * CHECKBUTTON: val.i 0/1 */ + /* strongly inspired from soundmedem. Thanks Thomas! */ + enum rig_conf_e { RIG_CONF_STRING, /*!< String type */ RIG_CONF_COMBO, /*!< Combo type */ - RIG_CONF_NUMERIC, /*!< Numeric type (integer or real) */ + RIG_CONF_NUMERIC, /*!< Numeric type integer or real */ RIG_CONF_CHECKBUTTON /*!< on/off type */ };