Mike Black W9MDB 2022-05-29 12:00:03 -05:00
rodzic 3eab223a47
commit ae67384daf
2 zmienionych plików z 27 dodań i 1 usunięć

Wyświetl plik

@ -2572,6 +2572,7 @@ struct rig_state {
int use_cached_mode; /*<! flag instructing rig_get_mode to use cached values when asyncio is in use */
int use_cached_ptt; /*<! flag instructing rig_get_ptt to use cached values when asyncio is in use */
int depth; /*<! a depth counter to use for debug indentation and such */
int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
};
//! @cond Doxygen_Suppress

Wyświetl plik

@ -252,6 +252,8 @@ declare_proto_rig(set_clock);
declare_proto_rig(get_clock);
declare_proto_rig(set_separator);
declare_proto_rig(get_separator);
declare_proto_rig(set_lock_mode);
declare_proto_rig(get_lock_mode);
/*
@ -361,7 +363,9 @@ static struct test_table test_list[] =
// { 0x99, "set_password", ACTION(set_password), ARG_IN | ARG_NOVFO, "Password" },
{ 0xf7, "get_mode_bandwidths", ACTION(get_mode_bandwidths), ARG_IN | ARG_NOVFO, "Mode" },
{ 0xa0, "set_separator", ACTION(set_separator), ARG_IN | ARG_NOVFO, "Separator" },
{ 0xa1, "get_separator", ACTION(get_separator), ARG_OUT | ARG_NOVFO, "Separator" },
{ 0xa1, "get_separator", ACTION(get_separator), ARG_NOVFO, "Separator" },
{ 0xa2, "set_lock_mode", ACTION(set_lock_mode), ARG_IN | ARG_NOVFO, "Locked" },
{ 0xa3, "get_lock_mode", ACTION(get_lock_mode), ARG_NOVFO, "Locked" },
{ 0x00, "", NULL },
};
@ -2172,6 +2176,7 @@ declare_proto_rig(set_mode)
mode = rig_parse_mode(arg1);
CHKSCN1ARG(sscanf(arg2, "%ld", &width));
if (rig->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;
}