Rigs will only power up once if needed

https://github.com/Hamlib/Hamlib/issues/297
pull/312/head
Michael Black W9MDB 2020-06-14 17:14:24 -05:00
rodzic 15ac0bbc99
commit 8fd58e211d
6 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -727,9 +727,10 @@ icom_rig_open(RIG *rig)
rig->caps->version);
retval = icom_get_usb_echo_off(rig);
if (retval != RIG_OK)
if (retval != RIG_OK && priv->poweron == 0)
{
priv->poweron = 1;
// maybe we need power on?
rig_debug(RIG_DEBUG_VERBOSE, "%s trying power on\n", __func__);
retval = abs(rig_set_powerstat(rig, 1));

Wyświetl plik

@ -190,6 +190,7 @@ struct icom_priv_data
freq_t vfob_freq; // track last setting of vfob -- used to return last freq when ptt is asserted
int x25cmdfails; // This will get set if the 0x25 command fails so we try just once
int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once
int poweron; // to prevent powering on more than once
};
extern const struct ts_sc_list r8500_ts_sc_list[];

Wyświetl plik

@ -719,8 +719,9 @@ int kenwood_open(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: got ID so try PS\n", __func__);
err = rig_get_powerstat(rig, &powerstat);
if (err == RIG_OK && powerstat == 0)
if (err == RIG_OK && powerstat == 0 && priv->poweron == 0)
{
priv->poweron = 1;
rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__);
rig_set_powerstat(rig, 1);
}

Wyświetl plik

@ -27,7 +27,7 @@
#include <string.h>
#include "token.h"
#define BACKEND_VER "20200601"
#define BACKEND_VER "20200614"
#define EOM_KEN ';'
#define EOM_TH '\r'
@ -126,6 +126,7 @@ struct kenwood_priv_data
int is_950;
struct timespec cache_start;
char last_if_response[KENWOOD_MAX_BUF_LEN];
int poweron; /* to avoid powering on more than once */
};

Wyświetl plik

@ -366,7 +366,10 @@ int newcat_open(RIG *rig)
__func__, rig_s->rigport.post_write_delay);
/* Ensure rig is powered on */
rig_set_powerstat(rig, 1);
if (priv->poweron == 0) {
priv->poweron = 1;
rig_set_powerstat(rig, 1);
}
/* get current AI state so it can be restored */
priv->trn_state = -1;

Wyświetl plik

@ -95,6 +95,7 @@ struct newcat_priv_data
int width_frequency; /* found at startup */
struct timespec cache_start;
char last_if_response[NEWCAT_DATA_LEN];
int poweron; /* to prevent powering on more than once */
};