diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 4b3150699..149b20f32 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -944,6 +944,10 @@ Get DTMF Get misc information about the rig (no VFO in 'VFO mode' or value is passed). . .TP +.B dump_state +Return certain state information about the radio backend. +. +.TP .BR 1 ", " dump_caps Not a real rig remote command, it just dumps capabilities, i.e. what the backend knows about this model, and what it can do. diff --git a/doc/man1/rotctl.1 b/doc/man1/rotctl.1 index 8d7c862da..e6b3412bf 100644 --- a/doc/man1/rotctl.1 +++ b/doc/man1/rotctl.1 @@ -428,6 +428,15 @@ Returns \(lqModel Name\(rq at present. . .TP +.B dump_state +Return certain state information about the rotator backend. +. +.TP +.BR 1 ", " dump_caps +Not a real rot remote command, it just dumps capabilities, i.e. what the +backend knows about this model, and what it can do. +. +.TP .BR w ", " send_cmd " \(aq" \fICmd\fP \(aq Send a raw command string to the rotator. .IP diff --git a/doc/man1/rotctld.1 b/doc/man1/rotctld.1 index f62bfaf47..528908af9 100644 --- a/doc/man1/rotctld.1 +++ b/doc/man1/rotctld.1 @@ -170,6 +170,12 @@ Use the option above for a list of configuration parameters for a given model number. . .TP +.BR \-u ", " \-\-dump\-state +Dump state for the rotator defined with +.B -m +above and exit. +. +.TP .BR \-u ", " \-\-dump\-caps Dump capabilities for the rotator defined with .B -m @@ -363,6 +369,15 @@ Returns \(lqModel Name\(rq. . .TP +.B dump_state +Return certain state information about the rotator backend. +. +.TP +.BR 1 ", " dump_caps +Not a real rot remote command, it just dumps capabilities, i.e. what the +backend knows about this model, and what it can do. +. +.TP .BR w ", " send_cmd " \(aq" \fICmd\fP \(aq Send a raw command string to the rotator. .IP diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index c188af91f..2bc74ad8a 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1388,12 +1388,12 @@ typedef int (* confval_cb_t)(RIG *, #define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg struct rig_caps { rig_model_t rig_model; /*!< Rig model. */ - const char *macro_name; /*!< Rig model macro name */ const char *model_name; /*!< Model name. */ const char *mfg_name; /*!< Manufacturer. */ const char *version; /*!< Driver version. */ const char *copyright; /*!< Copyright info. */ enum rig_status_e status; /*!< Driver status. */ + const char *macro_name; /*!< Rig model macro name */ int rig_type; /*!< Rig type. */ ptt_type_t ptt_type; /*!< Type of the PTT port. */ diff --git a/src/conf.c b/src/conf.c index 4f1170da3..db1ee59a8 100644 --- a/src/conf.c +++ b/src/conf.c @@ -73,9 +73,14 @@ static const struct confparams frontend_cfg_params[] = "0", RIG_CONF_NUMERIC, { .n = { 0, 10, 1 } } }, { - TOK_ITU_REGION, "itu_region", "ITU region", - "ITU region this rig has been manufactured for (freq. band plan)", - "0", RIG_CONF_NUMERIC, { .n = { 1, 3, 1 } } + TOK_RANGE_SELECTED, "Selected range list", "Range list#", + "The tx/rx range list in use", + "0", RIG_CONF_NUMERIC, { .n = { 1, 5, 1 } } + }, + { + TOK_RANGE_NAME, "Selected range list", "Range list name", + "The tx/rx range list name", + "Default", RIG_CONF_STRING }, { @@ -371,7 +376,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) break; - case TOK_ITU_REGION: + case TOK_RANGE_SELECTED: if (1 != sscanf(val, "%d", &val_i)) { return -RIG_EINVAL;//value format error @@ -394,23 +399,23 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) break; case 3: - memcpy(rs->tx_range_list, caps->tx_range_list2, + memcpy(rs->tx_range_list, caps->tx_range_list3, sizeof(struct freq_range_list)*FRQRANGESIZ); - memcpy(rs->rx_range_list, caps->rx_range_list2, + memcpy(rs->rx_range_list, caps->rx_range_list3, sizeof(struct freq_range_list)*FRQRANGESIZ); break; case 4: - memcpy(rs->tx_range_list, caps->tx_range_list2, + memcpy(rs->tx_range_list, caps->tx_range_list4, sizeof(struct freq_range_list)*FRQRANGESIZ); - memcpy(rs->rx_range_list, caps->rx_range_list2, + memcpy(rs->rx_range_list, caps->rx_range_list4, sizeof(struct freq_range_list)*FRQRANGESIZ); break; case 5: - memcpy(rs->tx_range_list, caps->tx_range_list2, + memcpy(rs->tx_range_list, caps->tx_range_list5, sizeof(struct freq_range_list)*FRQRANGESIZ); - memcpy(rs->rx_range_list, caps->rx_range_list2, + memcpy(rs->rx_range_list, caps->rx_range_list5, sizeof(struct freq_range_list)*FRQRANGESIZ); break; diff --git a/src/rig.c b/src/rig.c index 98990c1e8..91caf97cd 100644 --- a/src/rig.c +++ b/src/rig.c @@ -406,7 +406,15 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) rs->transceive = RIG_TRN_OFF; rs->poll_interval = 500; rs->lo_freq = 0; - + + // We are using range_list1 as the default + // Eventually we will have separate model number for different rig variations + // So range_list1 will become just range_list (per model) + // See ic9700.c for a 5-model example + memcpy(rs->tx_range_list, caps->tx_range_list1, + sizeof(struct freq_range_list)*FRQRANGESIZ); + memcpy(rs->rx_range_list, caps->rx_range_list1, + sizeof(struct freq_range_list)*FRQRANGESIZ); #if 0 // this is no longer applicable -- replace it with something? // we need to be able to figure out what model radio we have diff --git a/src/token.h b/src/token.h index a2323c510..0461caf68 100644 --- a/src/token.h +++ b/src/token.h @@ -98,8 +98,10 @@ #define TOK_POLL_INTERVAL TOKEN_FRONTEND(111) /** \brief rig: lo frequency of any transverters */ #define TOK_LO_FREQ TOKEN_FRONTEND(112) -/** \brief rig: International Telecommunications Union region no. */ -#define TOK_ITU_REGION TOKEN_FRONTEND(120) +/** \brief rig: Range index 1-5 */ +#define TOK_RANGE_SELECTED TOKEN_FRONTEND(121) +/** \brief rig: Range Name */ +#define TOK_RANGE_NAME TOKEN_FRONTEND(122) /* * rotator specific tokens * (strictly, should be documented as rotator_internal)