Only do close functions when comm_state is true

https://github.com/Hamlib/Hamlib/issues/1282
pull/1289/head^2
Mike Black W9MDB 2023-05-10 23:27:40 -05:00
rodzic 5f55b0ea48
commit bdecc7f73e
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -689,7 +689,7 @@ int newcat_close(RIG *rig)
ENTERFUNC;
if (!no_restore_ai && priv->trn_state >= 0)
if (!no_restore_ai && priv->trn_state >= 0 && rig_s->comm_state)
{
/* restore AI state */
newcat_set_trn(rig, priv->trn_state); /* ignore status in
@ -697,7 +697,7 @@ int newcat_close(RIG *rig)
supported */
}
if (priv->poweron != 0 && rig_s->auto_power_off)
if (priv->poweron != 0 && rig_s->auto_power_off && rig_s->comm_state)
{
rig_set_powerstat(rig, 0);
priv->poweron = 0;