kopia lustrzana https://github.com/Hamlib/Hamlib
set_trn/get_trn: more helpful/coherent args
* set_trn: Added help "?" * get_trn: Returns OFF/RIG/POLL rather than 0/1/2, so that it matches Author: Nirgal Vourgère <contact_hamlib@nirgal.com>Hamlib-1.2.14
rodzic
bf1b3b982d
commit
0bfec55f10
|
@ -1774,6 +1774,10 @@ declare_proto_rig(set_trn)
|
||||||
{
|
{
|
||||||
int trn;
|
int trn;
|
||||||
|
|
||||||
|
if (!strcmp(arg1, "?")) {
|
||||||
|
fprintf(fout, "OFF RIG POLL\n");
|
||||||
|
return RIG_OK;
|
||||||
|
}
|
||||||
if (!strcmp(arg1, "OFF"))
|
if (!strcmp(arg1, "OFF"))
|
||||||
trn = RIG_TRN_OFF;
|
trn = RIG_TRN_OFF;
|
||||||
else if (!strcmp(arg1, "RIG") || !strcmp(arg1, "ON"))
|
else if (!strcmp(arg1, "RIG") || !strcmp(arg1, "ON"))
|
||||||
|
@ -1799,13 +1803,18 @@ declare_proto_rig(get_trn)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
int trn;
|
int trn;
|
||||||
|
static const char* trn_txt[] = {
|
||||||
|
"OFF",
|
||||||
|
"RIG",
|
||||||
|
"POLL"};
|
||||||
|
|
||||||
status = rig_get_trn(rig, &trn);
|
status = rig_get_trn(rig, &trn);
|
||||||
if (status != RIG_OK)
|
if (status != RIG_OK)
|
||||||
return status;
|
return status;
|
||||||
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
|
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
|
||||||
fprintf(fout, "%s: ", cmd->arg1);
|
fprintf(fout, "%s: ", cmd->arg1);
|
||||||
fprintf(fout, "%d%c", trn, resp_sep);
|
if (trn>=0 && trn<=2)
|
||||||
|
fprintf(fout, "%s%c", trn_txt[trn], resp_sep);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue