Remember filter setting from icom_get_mode so we can refer to it later on set_mode

https://github.com/Hamlib/Hamlib/issues/448

(cherry picked from commit 915666add2)
Hamlib-4.0
Michael Black W9MDB 2020-12-12 12:21:54 -06:00 zatwierdzone przez Nate Bargmann
rodzic ada663f55e
commit 178208714f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F72625E2EDBED598
1 zmienionych plików z 16 dodań i 3 usunięć

Wyświetl plik

@ -1857,16 +1857,29 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
unsigned char modebuf[MAXFRAMELEN];
const struct icom_priv_caps *priv_caps;
struct icom_priv_data *priv_data;
int mode_len, retval;
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo));
priv_caps = (const struct icom_priv_caps *) rig->caps->priv;
priv_data = (struct icom_priv_data *) rig->state.priv;
retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len);
rig_debug(RIG_DEBUG_TRACE,
"%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0],
modebuf[1], mode_len);
if (mode_len == 3)
{
priv_data->filter = modebuf[2] - '0';
rig_debug(RIG_DEBUG_TRACE,
"%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, modebuf[2]=0x%02x, mode_len=%d, filter=%d\n",
__func__, modebuf[0],
modebuf[1], modebuf[2], mode_len, priv_data->filter);
}
else
{
rig_debug(RIG_DEBUG_TRACE,
"%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0],
modebuf[1], mode_len);
}
if (retval != RIG_OK)
{