From c4e37ef27728ae6d0ff1be9f052242d324140b96 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 9 Apr 2021 15:35:30 -0500 Subject: [PATCH] Add timeout to dump_state so rigctld will use the rig's timeout value plus 200ms for additional network delays --- rigs/dummy/netrigctl.c | 8 +++++++- tests/rigctl_parse.c | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 5d37ed831..00d17590f 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -612,6 +612,12 @@ static int netrigctl_open(RIG *rig) if (!has) { rig->caps->get_freq = NULL; } } + else if (strcmp(setting, "timeout") == 0) + { + // use the rig's timeout value pluse 200ms for potential network delays + rig->caps->timeout = strtol(value, NULL, 0) + 200; + rig_debug(RIG_DEBUG_TRACE, "%s: timeout value = '%s', final timeout=%d\n", __func__, value, rig->caps->timeout); + } else { // not an error -- just a warning for backward compatibility @@ -2288,7 +2294,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20210326.0", + .version = "20210409.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index af3989650..900498828 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4319,6 +4319,7 @@ declare_proto_rig(dump_state) fprintf(fout, "has_get_vfo=%d\n", rig->caps->get_vfo != NULL); fprintf(fout, "has_set_freq=%d\n", rig->caps->set_freq != NULL); fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq != NULL); + fprintf(fout, "timeout=%d\n", rig->caps->timeout); fprintf(fout, "done\n"); }