From 76a3ab19eb78ef2df4ae4e65dff2e33274ac6a70 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Tue, 24 Jan 2023 11:23:47 -0600 Subject: [PATCH] Update NEWS --- NEWS | 1 + rigs/dummy/netrigctl.c | 3 +++ rigs/yaesu/newcat.c | 2 +- simulators/simft991.c | 6 ++++-- src/rig.c | 2 ++ tests/rigctl_parse.c | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 378ee2923..7f618af64 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix QRP QDX PTT to new TQ command * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index b69e04b68..c4e90efb3 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2065,6 +2065,9 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status) // also a problem with Flex 6xxx and Log4OM not working due to lack of PS command rig_debug(RIG_DEBUG_VERBOSE, "%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret); + if (ret == -RIG_EPOWER) + *status = RIG_POWER_OFF; + else *status = RIG_POWER_ON; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 10ea9b1fa..b491a1c9f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3622,7 +3622,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) // 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); + write_block(&state->rigport, (unsigned char *) ";;;", 3); hl_usleep(1200000); SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); diff --git a/simulators/simft991.c b/simulators/simft991.c index 965deb4f2..49f61d17b 100644 --- a/simulators/simft991.c +++ b/simulators/simft991.c @@ -104,11 +104,11 @@ int main(int argc, char *argv[]) while (1) { + start: if (getmyline(fd, buf)) { printf("Cmd:%s\n", buf); } - else { continue; } if (strcmp(buf, "RM5;") == 0) { @@ -172,8 +172,10 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "PS;") == 0) { - SNPRINTF(buf, sizeof(buf), "PS1;"); +#if 0 + SNPRINTF(buf, sizeof(buf), "PS0;"); n = write(fd, buf, strlen(buf)); +#endif } else if (strcmp(buf, "AI;") == 0) { diff --git a/src/rig.c b/src/rig.c index 65927287e..68104894e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6079,6 +6079,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) if (rig->caps->get_powerstat == NULL) { + rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig does not have get_powerstat to assume RIG_POWER_ON\n", __func__); *status = RIG_POWER_ON; // default to power if not available RETURNFUNC(RIG_OK); } @@ -6086,6 +6087,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) *status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat HAMLIB_TRACE; retcode = rig->caps->get_powerstat(rig, status); + if (retcode == -RIG_ETIMEOUT) status = RIG_POWER_OFF; RETURNFUNC(retcode); } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 02c801951..9cefcb0a8 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4741,7 +4741,7 @@ declare_proto_rig(get_powerstat) if (status != RIG_OK) { - RETURNFUNC(status); + stat = status; } if ((interactive && prompt) || (interactive && !prompt && ext_resp))