Add extension parameter handling for K2/K3 RIT/XIT

Implemented kenwood_cfg_params structure to allow RIT/XIT tokens to be
available to all Kenwood backend rigs (Fine Step and Voice announce are
also defined).  K2/K3 rigs can only set/get RIT/XIT.

Updated README.k2/k3 for RIT/XIT functions and prior updates.

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@3031 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.13
Nate Bargmann, N0NB 2011-02-01 00:48:45 +00:00
rodzic 992b0842e4
commit 15615ec467
8 zmienionych plików z 63 dodań i 14 usunięć

Wyświetl plik

@ -20,4 +20,15 @@ it also checks for K2 or K3 extensions and sets a pair of private variables
that may be used later for advanced functions. This way the backend should be that may be used later for advanced functions. This way the backend should be
able to reliably test for either a K2 or K3 (needs more testing with the K2). able to reliably test for either a K2 or K3 (needs more testing with the K2).
This function also probes the K2 for the RTTY option and then installed filters
and bandwidths. This information is stored in a structure and used later. The
probe adds about 10 seconds to the rig_open.
kenwood_get/set_ext_parms()
===========================
These functions are used to get and set RIT/XIT on and off. The special token
names of 'rit' and 'xit' are used with the P/p commands of rigctl[d] for the
'parm'. Set/returned value is 0 or 1 for off or on.

Wyświetl plik

@ -91,3 +91,20 @@ rigctl) will set the bandwidth to 2350 Hz (rounded down by the K3).
The k3_get_mode function will query and return the actual bandwidth in use in The k3_get_mode function will query and return the actual bandwidth in use in
Hertz. Hertz.
k3_get_ext_level()
==================
This function is used to query the K3 for the IF center frequency. Use the 'l'
command with the token name 'ifctr' for 'Level' to read in rigctl[d]. Value
returned is 8210000.0 + queried value from rig (see K3 Programmers Reference,
FI command). Returned type is a floating point value.
kenwood_get/set_ext_parms()
===========================
These functions are used to get and set RIT/XIT on and off. The special token
names of 'rit' and 'xit' are used with the P/p commands of rigctl[d] for the
'parm'. Set/returned value is 0 or 1 for off or on.

Wyświetl plik

@ -23,7 +23,6 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "token.h"
#include "elecraft.h" #include "elecraft.h"
#include "kenwood.h" #include "kenwood.h"

Wyświetl plik

@ -21,8 +21,7 @@
#ifndef _ELECRAFT_H #ifndef _ELECRAFT_H
#define _ELECRAFT_H 1 #define _ELECRAFT_H 1
#include "token.h" #include "hamlib/rig.h"
/* The Elecraft Programmer's Reference details the extension level that /* The Elecraft Programmer's Reference details the extension level that
* a K2 or K3 may have in effect which modify certain commands. * a K2 or K3 may have in effect which modify certain commands.
@ -57,12 +56,4 @@ enum k3_data_submodes_e {
int elecraft_open(RIG *rig); int elecraft_open(RIG *rig);
/* Tokens for Extra Levels and Parameters common to multiple rigs.
* Use token # >= 1 or <= 100. Defined here so they will be available in
* Elecraft name space.
*/
/* Place common tokens here */
#endif /* _ELECRAFT_H */ #endif /* _ELECRAFT_H */

Wyświetl plik

@ -209,6 +209,8 @@ const struct rig_caps k2_caps = {
.get_dcd = kenwood_get_dcd, .get_dcd = kenwood_get_dcd,
.set_func = kenwood_set_func, .set_func = kenwood_set_func,
.get_func = kenwood_get_func, .get_func = kenwood_get_func,
.set_ext_parm = kenwood_set_ext_parm,
.get_ext_parm = kenwood_get_ext_parm,
.set_level = kenwood_set_level, .set_level = kenwood_set_level,
.get_level = kenwood_get_level, .get_level = kenwood_get_level,
.vfo_op = kenwood_vfo_op, .vfo_op = kenwood_vfo_op,

Wyświetl plik

@ -52,7 +52,7 @@
/* Private tokens used for ext_lvl and ext_parm functions in K3 backend. /* Private tokens used for ext_lvl and ext_parm functions in K3 backend.
* Extra parameters and levels which are rig specific should be coded in * Extra parameters and levels which are rig specific should be coded in
* the individual rig files and token #s > 100. * the individual rig files and token #s >= 101.
*/ */
#define TOK_IF_FREQ TOKEN_BACKEND(101) /* K3 FI command */ #define TOK_IF_FREQ TOKEN_BACKEND(101) /* K3 FI command */
@ -61,7 +61,7 @@
* See enum rig_conf_e and struct confparams in rig.h * See enum rig_conf_e and struct confparams in rig.h
*/ */
static const struct confparams k3_ext_levels[] = { static const struct confparams k3_ext_levels[] = {
{ TOK_IF_FREQ, "IFCTR", "IF center frequency", "IF center freq", { TOK_IF_FREQ, "ifctr", "IF center frequency", "IF center freq",
NULL, RIG_CONF_NUMERIC, { .n = { 0, 9990, 10 } } NULL, RIG_CONF_NUMERIC, { .n = { 0, 9990, 10 } }
}, },
{ RIG_CONF_END, NULL, } { RIG_CONF_END, NULL, }
@ -124,6 +124,7 @@ const struct rig_caps k3_caps = {
.level_gran = {}, /* FIXME: granularity */ .level_gran = {}, /* FIXME: granularity */
.parm_gran = {}, .parm_gran = {},
.extlevels = k3_ext_levels, .extlevels = k3_ext_levels,
.extparms = kenwood_cfg_params,
.preamp = { 14, RIG_DBLST_END, }, .preamp = { 14, RIG_DBLST_END, },
.attenuator = { 10, RIG_DBLST_END, }, .attenuator = { 10, RIG_DBLST_END, },
.max_rit = Hz(9990), .max_rit = Hz(9990),
@ -210,6 +211,8 @@ const struct rig_caps k3_caps = {
.get_dcd = kenwood_get_dcd, .get_dcd = kenwood_get_dcd,
.set_func = kenwood_set_func, .set_func = kenwood_set_func,
.get_func = kenwood_get_func, .get_func = kenwood_get_func,
.set_ext_parm = kenwood_set_ext_parm,
.get_ext_parm = kenwood_get_ext_parm,
.set_level = kenwood_set_level, .set_level = kenwood_set_level,
.get_level = kenwood_get_level, .get_level = kenwood_get_level,
.get_ext_level = k3_get_ext_level, .get_ext_level = k3_get_ext_level,
@ -416,7 +419,6 @@ int k3_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
char buf[KENWOOD_MAX_BUF_LEN]; char buf[KENWOOD_MAX_BUF_LEN];
int err; int err;
struct kenwood_priv_data *priv = (struct kenwood_priv_data *)rig->state.priv;
const struct confparams *cfp; const struct confparams *cfp;
cfp = rig_ext_lookup_tok(rig, token); cfp = rig_ext_lookup_tok(rig, token);

Wyświetl plik

@ -131,6 +131,24 @@ const tone_t kenwood38_ctcss_list[] = {
0, 0,
}; };
/* Token definitions for .cfgparams in rig_caps
*
* See enum rig_conf_e and struct confparams in rig.h
*/
const struct confparams kenwood_cfg_params[] = {
{ TOK_FINE, "fine", "Fine", "Fine step mode",
NULL, RIG_CONF_CHECKBUTTON, { } },
{ TOK_VOICE, "voice", "Voice", "Voice recall",
NULL, RIG_CONF_BUTTON, { } },
{ TOK_XIT, "xit", "XIT", "XIT",
NULL, RIG_CONF_CHECKBUTTON, { } },
{ TOK_RIT, "rit", "RIT", "RIT",
NULL, RIG_CONF_CHECKBUTTON, { } },
{ RIG_CONF_END, NULL, }
};
/** /**
* kenwood_transaction * kenwood_transaction
* Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL * Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL

Wyświetl plik

@ -32,11 +32,20 @@
#define KENWOOD_MODE_TABLE_MAX 10 #define KENWOOD_MODE_TABLE_MAX 10
#define KENWOOD_MAX_BUF_LEN 50 /* max answer len, arbitrary */ #define KENWOOD_MAX_BUF_LEN 50 /* max answer len, arbitrary */
/* Tokens for Parameters common to multiple rigs.
* Use token # >= 1 or <= 100. Defined here so they will be
* available in Kenwood name space.
*/
#define TOK_VOICE TOKEN_BACKEND(1) #define TOK_VOICE TOKEN_BACKEND(1)
#define TOK_FINE TOKEN_BACKEND(2) #define TOK_FINE TOKEN_BACKEND(2)
#define TOK_XIT TOKEN_BACKEND(3) #define TOK_XIT TOKEN_BACKEND(3)
#define TOK_RIT TOKEN_BACKEND(4) #define TOK_RIT TOKEN_BACKEND(4)
/* Token structure assigned to .cfgparams in rig_caps */
extern const struct confparams kenwood_cfg_params[];
/* /*
* modes in use by the "MD" command * modes in use by the "MD" command
*/ */