Try to reopen rig on hard error

https://github.com/Hamlib/Hamlib/issues/1282
pull/1289/head
Mike Black W9MDB 2023-04-29 16:58:18 -05:00
rodzic fdf1c3cdab
commit e4acbac647
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -6130,6 +6130,13 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
HAMLIB_TRACE;
retcode = rig->caps->get_powerstat(rig, status);
if(retcode == RIG_EIO)
{
rig_debug(RIG_DEBUG_ERR, "%s: hard error, reopening rig\n");
rig_close(rig);
rig_open(rig);
}
if (retcode != RIG_OK) { *status = RIG_POWER_ON; } // if failed assume power is on
if (*status == RIG_POWER_OFF && rig->state.auto_power_on) rig->caps->set_powerstat(rig, RIG_POWER_ON);