TS-450S/690S does not have PS cmd so we will disable have_ps when 1st call to PS times out for Kenwood rigs

https://github.com/Hamlib/Hamlib/issues/1114
pull/1119/head
Mike Black W9MDB 2022-09-13 09:26:04 -05:00
rodzic 098d1d8dbb
commit f58ca95c9c
2 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -754,6 +754,7 @@ int kenwood_init(RIG *rig)
priv->curr_mode = 0;
priv->micgain_min = -1;
priv->micgain_max = -1;
priv->has_ps = 1; // until proven otherwise
/* default mode_table */
if (caps->mode_table == NULL)
@ -812,7 +813,7 @@ int kenwood_open(RIG *rig)
err = kenwood_get_id(rig, id);
}
if (err == RIG_OK) // some rigs give ID while in standby
if (err == RIG_OK && priv->has_ps) // some rigs give ID while in standby
{
powerstat_t powerstat = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: got ID so try PS\n", __func__);
@ -821,9 +822,14 @@ int kenwood_open(RIG *rig)
if (err == RIG_OK && powerstat == 0 && priv->poweron == 0
&& rig->state.auto_power_on)
{
priv->has_ps = 1;
rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__);
rig_set_powerstat(rig, 1);
}
else if (err == -RIG_ETIMEOUT) // Some rigs like TS-450 dont' have PS cmd
{
priv->has_ps = 0;
}
priv->poweron = 1;

Wyświetl plik

@ -28,7 +28,7 @@
#include "token.h"
#include "misc.h"
#define BACKEND_VER "20220726"
#define BACKEND_VER "20220913"
#define EOM_KEN ';'
#define EOM_TH '\r'
@ -155,6 +155,7 @@ struct kenwood_priv_data
struct timespec cache_start;
char last_if_response[KENWOOD_MAX_BUF_LEN];
int poweron; /* to avoid powering on more than once */
int has_ps; /* rig has PS cmd */
int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/
int has_rit2; /* rig has set 2 rit command -- can set rit 0-99999 directly */
int micgain_min, micgain_max; /* varies by rig so we figure it out automagically */