Allow rigctl/rigctld to timeout faster on startup

https://github.com/Hamlib/Hamlib/issues/1087
pull/1091/head
Mike Black W9MDB 2022-07-18 09:51:45 -05:00
rodzic 67248edfb8
commit f4f7bc9081
2 zmienionych plików z 16 dodań i 6 usunięć

Wyświetl plik

@ -1316,13 +1316,22 @@ int HAMLIB_API rig_open(RIG *rig)
// prime the freq and mode settings
// don't care about the return here -- if it doesn't work so be it
int retry_save = rs->rigport.retry;
rs->rigport.retry = rs->rigport.retry;
freq_t freq;
rig_get_freq(rig, RIG_VFO_A, &freq);
rig_get_freq(rig, RIG_VFO_B, &freq);
rmode_t mode;
pbwidth_t width;
rig_get_mode(rig, RIG_VFO_A, &mode, &width);
rig_get_mode(rig, RIG_VFO_B, &mode, &width);
if (rig->caps->get_freq)
{
int retval = rig_get_freq(rig, RIG_VFO_A, &freq);
if (retval == RIG_OK)
{
rig_get_freq(rig, RIG_VFO_B, &freq);
rmode_t mode;
pbwidth_t width;
rig_get_mode(rig, RIG_VFO_A, &mode, &width);
rig_get_mode(rig, RIG_VFO_B, &mode, &width);
}
}
rs->rigport.retry = retry_save;
memcpy(&rs->rigport_deprecated, &rs->rigport, sizeof(hamlib_port_t_deprecated));
memcpy(&rs->pttport_deprecated, &rs->pttport, sizeof(hamlib_port_t_deprecated));

Wyświetl plik

@ -1245,6 +1245,7 @@ void *handle_socket(void *arg)
{
rig_get_powerstat(my_rig, &powerstat);
rig_powerstat = powerstat;
if (powerstat == RIG_POWER_OFF) retcode = -RIG_EPOWER;
}
}
else