kopia lustrzana https://github.com/Hamlib/Hamlib
Reserve '#' for comments in Extended Response Protocol
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2842 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.11
rodzic
44e5abe225
commit
b261cea22e
|
@ -316,12 +316,12 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd != '\\' && cmd != '_' && ispunct(cmd) && !prompt) {
|
if (cmd != '\\' && cmd != '_' && cmd != '#' && ispunct(cmd) && !prompt) {
|
||||||
ext_resp = 1;
|
ext_resp = 1;
|
||||||
resp_sep = cmd;
|
resp_sep = cmd;
|
||||||
if (scanfc(fin, "%c", &cmd) < 0)
|
if (scanfc(fin, "%c", &cmd) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
} else if (cmd != '\\' && cmd != '?' && cmd != '_' && ispunct(cmd) && prompt) {
|
} else if (cmd != '\\' && cmd != '?' && cmd != '_' && cmd != '#' && ispunct(cmd) && prompt) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc)
|
||||||
last_was_ret = 0;
|
last_was_ret = 0;
|
||||||
|
|
||||||
/* comment line */
|
/* comment line */
|
||||||
if (cmd == '#' || cmd == ';') {
|
if (cmd == '#') {
|
||||||
while( cmd != '\n' && cmd != '\r')
|
while( cmd != '\n' && cmd != '\r')
|
||||||
if (scanfc(fin, "%c", &cmd) < 0)
|
if (scanfc(fin, "%c", &cmd) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.\" First parameter, NAME, should be all caps
|
.\" First parameter, NAME, should be all caps
|
||||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||||
.\" other parameters are allowed: see man(7), man(1)
|
.\" other parameters are allowed: see man(7), man(1)
|
||||||
.TH RIGCTLD "8" "February 17, 2010" "Hamlib" "Rig Control Daemon"
|
.TH RIGCTLD "8" "March 1, 2010" "Hamlib" "Rig Control Daemon"
|
||||||
.\" Please adjust this date whenever revising the manpage.
|
.\" Please adjust this date whenever revising the manpage.
|
||||||
.\"
|
.\"
|
||||||
.\" Some roff macros, for reference:
|
.\" Some roff macros, for reference:
|
||||||
|
@ -563,6 +563,10 @@ Reserved for 'help' in rigctl short command
|
||||||
.B '_'
|
.B '_'
|
||||||
.br
|
.br
|
||||||
Reserved for \\get_info short command
|
Reserved for \\get_info short command
|
||||||
|
.TP
|
||||||
|
.B '#'
|
||||||
|
.br
|
||||||
|
Reserved for comments when reading a command file script
|
||||||
.sp
|
.sp
|
||||||
Other punctuation characters have not been tested! Use at your own risk.
|
Other punctuation characters have not been tested! Use at your own risk.
|
||||||
.PP
|
.PP
|
||||||
|
|
|
@ -210,7 +210,8 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Extended response protocol requested with leading '+' on command
|
/* Extended response protocol requested with leading '+' on command
|
||||||
* string -- rotctld only! */
|
* string--rotctld only!
|
||||||
|
*/
|
||||||
if (cmd == '+' && !prompt) {
|
if (cmd == '+' && !prompt) {
|
||||||
ext_resp = 1;
|
ext_resp = 1;
|
||||||
if (scanfc(fin, "%c", &cmd) < 0)
|
if (scanfc(fin, "%c", &cmd) < 0)
|
||||||
|
@ -219,13 +220,12 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd != '\\' && cmd != '_' && ispunct(cmd) && !prompt) {
|
if (cmd != '\\' && cmd != '_' && cmd != '#' && ispunct(cmd) && !prompt) {
|
||||||
ext_resp = 1;
|
ext_resp = 1;
|
||||||
resp_sep = cmd;
|
resp_sep = cmd;
|
||||||
if (scanfc(fin, "%c", &cmd) < 0)
|
if (scanfc(fin, "%c", &cmd) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
continue;
|
} else if (cmd != '\\' && cmd != '?' && cmd != '_' && cmd != '#' && ispunct(cmd) && prompt) {
|
||||||
} else if (cmd != '\\' && cmd != '?' && cmd != '_' && ispunct(cmd) && prompt) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc)
|
||||||
last_was_ret = 0;
|
last_was_ret = 0;
|
||||||
|
|
||||||
/* comment line */
|
/* comment line */
|
||||||
if (cmd == '#' || cmd == ';') {
|
if (cmd == '#') {
|
||||||
while( cmd != '\n' && cmd != '\r')
|
while( cmd != '\n' && cmd != '\r')
|
||||||
if (scanfc(fin, "%c", &cmd) < 0)
|
if (scanfc(fin, "%c", &cmd) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -418,29 +418,30 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc)
|
||||||
if (retcode != RIG_OK) {
|
if (retcode != RIG_OK) {
|
||||||
/* only for rotctld */
|
/* only for rotctld */
|
||||||
if (interactive && !prompt) {
|
if (interactive && !prompt) {
|
||||||
fprintf(fout, NETROTCTL_RET "%d\n", retcode);
|
fprintf(fout, NETROTCTL_RET "%d\n", retcode);
|
||||||
ext_resp = 0;
|
ext_resp = 0;
|
||||||
resp_sep = '\n';
|
resp_sep = '\n';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
||||||
} else {
|
} else {
|
||||||
/* only for rotctld */
|
/* only for rotctld */
|
||||||
if (interactive && !prompt) {
|
if (interactive && !prompt) {
|
||||||
/* netrotctl RIG_OK */
|
/* netrotctl RIG_OK */
|
||||||
if (!(cmd_entry->flags & ARG_OUT)
|
if (!(cmd_entry->flags & ARG_OUT) && !opt_end && !ext_resp)
|
||||||
&& !opt_end && !ext_resp && cmd != 0xf0)
|
|
||||||
fprintf(fout, NETROTCTL_RET "0\n");
|
fprintf(fout, NETROTCTL_RET "0\n");
|
||||||
/* block marker protocol */
|
|
||||||
else if (ext_resp && cmd != 0xf0) {
|
/* Extended Response protocol */
|
||||||
|
else if (ext_resp && cmd != 0xf0) {
|
||||||
fprintf(fout, NETROTCTL_RET "0\n");
|
fprintf(fout, NETROTCTL_RET "0\n");
|
||||||
ext_resp = 0;
|
ext_resp = 0;
|
||||||
resp_sep = '\n';
|
resp_sep = '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nate's protocol (obsolete) */
|
/* Nate's protocol (obsolete) */
|
||||||
else if ((cmd_entry->flags & ARG_OUT) && opt_end)
|
else if ((cmd_entry->flags & ARG_OUT) && opt_end)
|
||||||
fprintf(fout, "END\n");
|
fprintf(fout, "END\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush(fout);
|
fflush(fout);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.\" First parameter, NAME, should be all caps
|
.\" First parameter, NAME, should be all caps
|
||||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||||
.\" other parameters are allowed: see man(7), man(1)
|
.\" other parameters are allowed: see man(7), man(1)
|
||||||
.TH ROTCTLD "8" "February 17, 2010" "Hamlib" "Rotator Control Daemon"
|
.TH ROTCTLD "8" "March 1, 2010" "Hamlib" "Rotator Control Daemon"
|
||||||
.\" Please adjust this date whenever revising the manpage.
|
.\" Please adjust this date whenever revising the manpage.
|
||||||
.\"
|
.\"
|
||||||
.\" Some roff macros, for reference:
|
.\" Some roff macros, for reference:
|
||||||
|
@ -372,6 +372,10 @@ Reserved for 'help' in rotctl short command
|
||||||
.B '_'
|
.B '_'
|
||||||
.br
|
.br
|
||||||
Reserved for \\get_info short command
|
Reserved for \\get_info short command
|
||||||
|
.TP
|
||||||
|
.B '#'
|
||||||
|
.br
|
||||||
|
Reserved for comments when reading a command file script
|
||||||
.sp
|
.sp
|
||||||
Other punctuation characters have not been tested! Use at your own risk.
|
Other punctuation characters have not been tested! Use at your own risk.
|
||||||
.PP
|
.PP
|
||||||
|
|
Ładowanie…
Reference in New Issue