astyle rigctl_parse.c

pull/1330/head
Mike Black W9MDB 2023-05-30 16:10:52 -05:00
rodzic bdd16c8f20
commit c85cf58235
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -4721,10 +4721,12 @@ declare_proto_rig(set_powerstat)
CHKSCN1ARG(sscanf(arg1, "%d", &stat)); CHKSCN1ARG(sscanf(arg1, "%d", &stat));
retval = rig_set_powerstat(rig, (powerstat_t) stat); retval = rig_set_powerstat(rig, (powerstat_t) stat);
if (retval == RIG_OK) if (retval == RIG_OK)
{ {
rig_powerstat = stat; // update our global so others can see powerstat rig_powerstat = stat; // update our global so others can see powerstat
} }
fflush(fin); fflush(fin);
RETURNFUNC2(retval); RETURNFUNC2(retval);
} }
@ -4860,6 +4862,7 @@ declare_proto_rig(send_cmd)
{ {
int nbytes = 0; int nbytes = 0;
int n = sscanf(arg2, "%d", &nbytes); int n = sscanf(arg2, "%d", &nbytes);
if (n == 1) {SNPRINTF(bufcmd, sizeof(bufcmd), "%c %s %d\n", cmd->cmd, arg1, nbytes);} if (n == 1) {SNPRINTF(bufcmd, sizeof(bufcmd), "%c %s %d\n", cmd->cmd, arg1, nbytes);}
else {SNPRINTF(bufcmd, sizeof(bufcmd), "%c %s %s\n", cmd->cmd, arg1, arg2);} else {SNPRINTF(bufcmd, sizeof(bufcmd), "%c %s %s\n", cmd->cmd, arg1, arg2);}
} }
@ -4900,7 +4903,7 @@ declare_proto_rig(send_cmd)
if (simulate) if (simulate)
{ {
rig_debug(RIG_DEBUG_VERBOSE, "%s: simulating response for model %s\n", rig_debug(RIG_DEBUG_VERBOSE, "%s: simulating response for model %s\n",
__func__, rig->caps->model_name); __func__, rig->caps->model_name);
} }
else else
{ {
@ -4928,6 +4931,7 @@ declare_proto_rig(send_cmd)
} }
retval = 0; retval = 0;
do do
{ {
if (arg2) { sscanf(arg2, "%d", &rxbytes); } if (arg2) { sscanf(arg2, "%d", &rxbytes); }
@ -5299,7 +5303,7 @@ declare_proto_rig(set_clock)
rig_debug(RIG_DEBUG_VERBOSE, "%s: utc_offset=%d\n", __func__, utc_offset); rig_debug(RIG_DEBUG_VERBOSE, "%s: utc_offset=%d\n", __func__, utc_offset);
RETURNFUNC2(rig_set_clock(rig, year, mon, day, hour, min, sec, msec, RETURNFUNC2(rig_set_clock(rig, year, mon, day, hour, min, sec, msec,
utc_offset)); utc_offset));
} }
/* '0xf9' */ /* '0xf9' */
@ -5492,7 +5496,9 @@ declare_proto_rig(send_raw)
rig_debug(RIG_DEBUG_TRACE, "%s:\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s:\n", __func__);
result = rig_send_raw(rig, (unsigned char *)sendp, arg2_len, buf,buf_len, term); result = rig_send_raw(rig, (unsigned char *)sendp, arg2_len, buf, buf_len,
term);
if (result < 0) if (result < 0)
{ {
return result; return result;