kopia lustrzana https://github.com/Hamlib/Hamlib
Change Orion 1 get_ptt to use cached ptt.
Orion 1 does not have ptt querypull/1562/head
rodzic
4058b021d4
commit
a9c2569b69
|
@ -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)
|
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);
|
(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 tt565_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||||
{
|
{
|
||||||
int resp_len, retval;
|
struct tt565_priv_data *priv = (struct tt565_priv_data *)rig->state.priv;
|
||||||
char respbuf[TT565_BUFSIZE];
|
|
||||||
|
|
||||||
resp_len = sizeof(respbuf);
|
*ptt = priv->ptt;
|
||||||
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 ;
|
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "rig.h"
|
#include "rig.h"
|
||||||
#include "riglist.h"
|
#include "riglist.h"
|
||||||
|
|
||||||
#define BACKEND_VER "20220614"
|
#define BACKEND_VER "20240602"
|
||||||
|
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#define FALSE 0
|
#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 {
|
struct tt565_priv_data {
|
||||||
int ch; /*!< memory channel */
|
int ch; /*!< memory channel */
|
||||||
vfo_t vfo_curr; /*!< Currently selected VFO */
|
vfo_t vfo_curr; /*!< Currently selected VFO */
|
||||||
|
int ptt;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \brief Orion Supported Modes */
|
/** \brief Orion Supported Modes */
|
||||||
|
@ -198,7 +199,7 @@ struct tt565_priv_data {
|
||||||
*/
|
*/
|
||||||
struct rig_caps tt565_caps = {
|
struct rig_caps tt565_caps = {
|
||||||
RIG_MODEL(RIG_MODEL_TT565),
|
RIG_MODEL(RIG_MODEL_TT565),
|
||||||
.model_name = "TT-565 Orion",
|
.model_name = "TT-565 Orion 1",
|
||||||
.mfg_name = "Ten-Tec",
|
.mfg_name = "Ten-Tec",
|
||||||
.version = BACKEND_VER ".0",
|
.version = BACKEND_VER ".0",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
|
|
Ładowanie…
Reference in New Issue