From ae67384dafe21bc2bc2fc0f65635ed9f10970732 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 29 May 2022 12:00:03 -0500 Subject: [PATCH] https://github.com/Hamlib/Hamlib/issues/1044 --- include/hamlib/rig.h | 1 + tests/rigctl_parse.c | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 8354ec809..d4e39ed12 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2572,6 +2572,7 @@ struct rig_state { int use_cached_mode; /*state.lock_mode) RETURNFUNC(RIG_OK); RETURNFUNC(rig_set_mode(rig, vfo, mode, width)); } @@ -5208,3 +5213,23 @@ declare_proto_rig(get_separator) fprintf(fout, "%s\n", buf); return RIG_OK; } + +/* '0xa2' */ +declare_proto_rig(set_lock_mode) +{ + int lock; + CHKSCN1ARG(sscanf(arg1, "%d", &lock)); + rig->state.lock_mode = lock != 0; + return RIG_OK; +} +/* '0xa3' */ +declare_proto_rig(get_lock_mode) +{ + if ((interactive && prompt) || (interactive && !prompt && ext_resp)) + { + fprintf(fout, "%s: ", cmd->arg1); + } + + fprintf(fout, "%d\n", rig->state.lock_mode); + return RIG_OK; +}