Improve emulation performance and promote TS2000 to stable

pull/31/head
Michael Black W9MDB 2018-05-18 07:29:55 -05:00
rodzic 783ba3edd5
commit ee13edb4e8
3 zmienionych plików z 22 dodań i 2 usunięć

Wyświetl plik

@ -218,6 +218,9 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, size_t datasiz
rs = &rig->state;
rs->hold_decode = 1;
/* Emulators don't need any post_write_delay */
if (priv->is_emulation) rs->rigport.post_write_delay = 0;
cmdtrm[0] = caps->cmdtrm;
cmdtrm[1] = '\0';
@ -496,6 +499,7 @@ int kenwood_init(RIG *rig)
strcpy (priv->verify_cmd, RIG_MODEL_XG3 == rig->caps->rig_model ? ";" : "ID;");
priv->split = RIG_SPLIT_OFF;
priv->trn_state = -1;
priv->curr_mode = 0;
rig->state.priv = priv;
/* default mode_table */
@ -713,6 +717,14 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
return -RIG_EINVAL;
struct kenwood_priv_data *priv = rig->state.priv;
/* Emulations do not need to set VFO since VFOB is a copy of VFOA
* except for frequency. And we can change freq without changing VFOS
* This prevents a 1.8 second delay in PowerSDR when switching VFOs
* We'll do this once if curr_mode has not been set yet
*/
if (priv->is_emulation && priv->curr_mode > 0) return RIG_OK;
char cmdbuf[6];
int retval;
char vfo_function;
@ -1564,6 +1576,12 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
int offs;
int retval;
/* for emulation do not read mode from VFOB as it is copy of VFOA */
/* we avoid the VFO swapping most of the time this way */
/* only need to get it if it has to be initialized */
if (priv->curr_mode > 0 && priv->is_emulation && vfo == RIG_VFO_B) {
return priv->curr_mode;
}
if (RIG_MODEL_TS990S == rig->caps->rig_model)
{
char c;
@ -3345,6 +3363,7 @@ DECLARE_PROBERIG_BACKEND(kenwood)
"with ID %03d, please report to Hamlib "
"developers.\n", k_id);
rig_debug(RIG_DEBUG_TRACE, "%s: post_write_delay=%d\n", __func__, port->post_write_delay);
return RIG_MODEL_NONE;
}

Wyświetl plik

@ -27,7 +27,7 @@
#include <string.h>
#include "token.h"
#define BACKEND_VER "0.9"
#define BACKEND_VER "1.0"
#define EOM_KEN ';'
#define EOM_TH '\r'
@ -80,6 +80,7 @@ struct kenwood_priv_data {
char verify_cmd[4]; /* command used to verify set commands */
int is_emulation; /* flag for TS-2000 emulations */
void * data; /* model specific data */
rmode_t curr_mode; /* used for is_emulation to avoid get_mode on VFOB */
};

Wyświetl plik

@ -126,7 +126,7 @@ const struct rig_caps ts2000_caps = {
.mfg_name = "Kenwood",
.version = BACKEND_VER ".4",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,