Change rigctl_powerstat message to only show when powerstat shows off and promote to error

pull/1161/head
Mike Black W9MDB 2022-11-26 16:13:41 -06:00
rodzic 58f2549a99
commit 6995986880
1 zmienionych plików z 19 dodań i 12 usunięć

Wyświetl plik

@ -1728,15 +1728,18 @@ readline_repeat:
else
{
if (my_rig->caps->set_powerstat && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY))
if (my_rig->caps->set_powerstat && (rig_powerstat == RIG_POWER_OFF
|| rig_powerstat == RIG_POWER_STANDBY))
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_powerstat is not on = %d\n", __func__,
rig_powerstat);
// Update power status
powerstat_t stat = RIG_POWER_ON;
retcode = rig_get_powerstat(my_rig, &stat);
if (retcode == RIG_OK) { rig_powerstat = stat; }
if (rig_powerstat != RIG_POWER_ON) { rig_debug(RIG_DEBUG_ERR,
"%s: rig_powerstat is not on = %d\n", __func__,
rig_powerstat); }
}
// Allow only certain commands when the rig is powered off
@ -5378,15 +5381,19 @@ declare_proto_rig(send_raw)
int buf_len = sizeof(buf);
int val = 0;
if (strcmp(arg1, ";")==0) term[0] = ';';
else if (strcasecmp(arg1, "CR")) term[0] = 0x0d;
else if (strcasecmp(arg1, "LF")) term[0] = 0x0a;
else if (strcasecmp(arg1, "ICOM")) term[0] = 0xfd;
if (strcmp(arg1, ";") == 0) { term[0] = ';'; }
else if (strcasecmp(arg1, "CR")) { term[0] = 0x0d; }
else if (strcasecmp(arg1, "LF")) { term[0] = 0x0a; }
else if (strcasecmp(arg1, "ICOM")) { term[0] = 0xfd; }
else if (sscanf(arg1, "%d", &val) == 1) { term[0] = 0; buf_len = val;}
else {
rig_debug(RIG_DEBUG_ERR, "%s: unknown arg1 val=%s, expected ';' 'CR' 'LF' 'ICOM' or # of bytes where 0 means no reply and -1 means unknown", __func__, arg1);
else
{
rig_debug(RIG_DEBUG_ERR,
"%s: unknown arg1 val=%s, expected ';' 'CR' 'LF' 'ICOM' or # of bytes where 0 means no reply and -1 means unknown",
__func__, arg1);
return -RIG_EINVAL;
}
if (strncmp(arg2, "0x", 2) == 0)
{
arg2_len = parse_hex(arg2, send, sizeof(send));