From ea9257db45231d8fef6a64b7e7086f63b996af2a Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 15 Jul 2022 23:59:18 -0500 Subject: [PATCH] Add get_powerstat when rigctld gets an error in case rig gets powered off --- tests/rigctld.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/rigctld.c b/tests/rigctld.c index b92fe0cf8..af5a98af7 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -1225,6 +1225,7 @@ void *handle_socket(void *arg) if (rig_opened) // only do this if rig is open { + powerstat_t powerstat; rig_debug(RIG_DEBUG_TRACE, "%s: doing rigctl_parse vfo_mode=%d, secure=%d\n", __func__, handle_data_arg->vfo_mode, handle_data_arg->use_password); @@ -1234,6 +1235,8 @@ void *handle_socket(void *arg) handle_data_arg->use_password); if (retcode != 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rigctl_parse retcode=%d\n", __func__, retcode); } + // update our power stat in case power gets turned off + rig_get_powerstat(my_rig, &powerstat); } else {