From a9c2569b69959fadb099801773ad65fa72dc34e2 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 2 Jun 2024 23:00:47 -0500 Subject: [PATCH] Change Orion 1 get_ptt to use cached ptt. Orion 1 does not have ptt query --- rigs/tentec/orion.c | 26 +++++++------------------- rigs/tentec/orion.h | 5 +++-- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/rigs/tentec/orion.c b/rigs/tentec/orion.c index 2455561f2..39081b48b 100644 --- a/rigs/tentec/orion.c +++ b/rigs/tentec/orion.c @@ -941,8 +941,12 @@ int tt565_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) */ int tt565_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { - return write_block(RIGPORT(rig), + struct tt565_priv_data *priv = (struct tt565_priv_data *)rig->state.priv; + int retval = write_block(RIGPORT(rig), (unsigned char *)(ptt == RIG_PTT_ON ? "*TK" EOM : "*TU" EOM), 4); + if (retval == RIG_OK) + priv->ptt = ptt; + return retval; } /** @@ -954,25 +958,9 @@ int tt565_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) */ int tt565_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { - int resp_len, retval; - char respbuf[TT565_BUFSIZE]; + struct tt565_priv_data *priv = (struct tt565_priv_data *)rig->state.priv; - resp_len = sizeof(respbuf); - retval = tt565_transaction(rig, "?S" EOM, 3, respbuf, &resp_len); - - if (retval != RIG_OK) - { - return retval; - } - - if (respbuf[1] != 'S' || resp_len < 5) - { - rig_debug(RIG_DEBUG_ERR, "%s: unexpected answer '%s'\n", - __func__, respbuf); - return -RIG_EPROTO; - } - - *ptt = respbuf[2] == 'T' ? RIG_PTT_ON : RIG_PTT_OFF ; + *ptt = priv->ptt; return RIG_OK; } diff --git a/rigs/tentec/orion.h b/rigs/tentec/orion.h index f138c8d3d..95f17378a 100644 --- a/rigs/tentec/orion.h +++ b/rigs/tentec/orion.h @@ -36,7 +36,7 @@ #include "rig.h" #include "riglist.h" -#define BACKEND_VER "20220614" +#define BACKEND_VER "20240602" #define TRUE 1 #define FALSE 0 @@ -91,6 +91,7 @@ static int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_ struct tt565_priv_data { int ch; /*!< memory channel */ vfo_t vfo_curr; /*!< Currently selected VFO */ + int ptt; }; /** \brief Orion Supported Modes */ @@ -198,7 +199,7 @@ struct tt565_priv_data { */ struct rig_caps tt565_caps = { RIG_MODEL(RIG_MODEL_TT565), -.model_name = "TT-565 Orion", +.model_name = "TT-565 Orion 1", .mfg_name = "Ten-Tec", .version = BACKEND_VER ".0", .copyright = "LGPL",