Attempt to allow PS; query for Yaeus rigs when powered off

https://github.com/Hamlib/Hamlib/issues/1220
pull/1242/head
Mike Black W9MDB 2023-01-15 22:22:14 -06:00
rodzic c3ff7e134f
commit 0ad5a4b742
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -3602,6 +3602,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
int newcat_get_powerstat(RIG *rig, powerstat_t *status)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
struct rig_state *state = &rig->state;
int err;
char ps;
char command[] = "PS";
@ -3615,6 +3616,11 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status)
RETURNFUNC(-RIG_ENAVAIL);
}
// when not powered on need a dummy byte to wake it up
// then sleep from 1 to 2 seconds so we'll do 1.5 secs
write_block(&state->rigport, (unsigned char *) "PS;", 3);
hl_usleep(1200000);
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term);
/* Get Power status */