Added two new commands to rigctl_parse.c, \chk_blk and \chk_vfo to allow

clients to query the state of the -b|--block or -o|--vfo options from rigctld

Cleaned up strings in dumpcaps.c to remove duplicates to facilite
their use as key:value pairs

Updated rigctld man page for new commands



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2820 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.11
Nate Bargmann, N0NB 2010-02-04 00:53:56 +00:00
rodzic 5d539dcb02
commit 5e47dcf8d3
4 zmienionych plików z 252 dodań i 199 usunięć

Wyświetl plik

@ -58,7 +58,7 @@ int dumpcaps (RIG* rig, FILE *fout)
caps = rig->caps; caps = rig->caps;
fprintf(fout, "Caps dump for model %d\n",caps->rig_model); fprintf(fout, "Caps dump for model: %d\n", caps->rig_model);
fprintf(fout, "Model name:\t%s\n", caps->model_name); fprintf(fout, "Model name:\t%s\n", caps->model_name);
fprintf(fout, "Mfg name:\t%s\n", caps->mfg_name); fprintf(fout, "Mfg name:\t%s\n", caps->mfg_name);
fprintf(fout, "Backend version:\t%s\n", caps->version); fprintf(fout, "Backend version:\t%s\n", caps->version);
@ -104,16 +104,16 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "PTT type:\t"); fprintf(fout, "PTT type:\t");
switch (caps->ptt_type) { switch (caps->ptt_type) {
case RIG_PTT_RIG: case RIG_PTT_RIG:
fprintf(fout, "rig capable\n"); fprintf(fout, "Rig capable\n");
break; break;
case RIG_PTT_PARALLEL: case RIG_PTT_PARALLEL:
fprintf(fout, "thru parallel port (DATA0)\n"); fprintf(fout, "Parallel port (DATA0)\n");
break; break;
case RIG_PTT_SERIAL_RTS: case RIG_PTT_SERIAL_RTS:
fprintf(fout, "thru serial port (CTS/RTS)\n"); fprintf(fout, "Serial port (CTS/RTS)\n");
break; break;
case RIG_PTT_SERIAL_DTR: case RIG_PTT_SERIAL_DTR:
fprintf(fout, "thru serial port (DTR/DSR)\n"); fprintf(fout, "Serial port (DTR/DSR)\n");
break; break;
case RIG_PTT_NONE: case RIG_PTT_NONE:
fprintf(fout, "None\n"); fprintf(fout, "None\n");
@ -126,19 +126,19 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "DCD type:\t"); fprintf(fout, "DCD type:\t");
switch (caps->dcd_type) { switch (caps->dcd_type) {
case RIG_DCD_RIG: case RIG_DCD_RIG:
fprintf(fout, "rig capable\n"); fprintf(fout, "Rig capable\n");
break; break;
case RIG_DCD_PARALLEL: case RIG_DCD_PARALLEL:
fprintf(fout, "thru parallel port (DATA1? STROBE?)\n"); fprintf(fout, "Parallel port (DATA1? STROBE?)\n");
break; break;
case RIG_DCD_SERIAL_CTS: case RIG_DCD_SERIAL_CTS:
fprintf(fout, "thru serial port (CTS/RTS)\n"); fprintf(fout, "Serial port (CTS/RTS)\n");
break; break;
case RIG_DCD_SERIAL_DSR: case RIG_DCD_SERIAL_DSR:
fprintf(fout, "thru serial port (DTR/DSR)\n"); fprintf(fout, "Serial port (DTR/DSR)\n");
break; break;
case RIG_DCD_SERIAL_CAR: case RIG_DCD_SERIAL_CAR:
fprintf(fout, "thru serial port (CD)\n"); fprintf(fout, "Serial port (CD)\n");
break; break;
case RIG_DCD_NONE: case RIG_DCD_NONE:
fprintf(fout, "None\n"); fprintf(fout, "None\n");
@ -157,13 +157,13 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "Parallel\n"); fprintf(fout, "Parallel\n");
break; break;
case RIG_PORT_DEVICE: case RIG_PORT_DEVICE:
fprintf(fout, "device driver\n"); fprintf(fout, "Device driver\n");
break; break;
case RIG_PORT_USB: case RIG_PORT_USB:
fprintf(fout, "USB\n"); fprintf(fout, "USB\n");
break; break;
case RIG_PORT_NETWORK: case RIG_PORT_NETWORK:
fprintf(fout, "network link\n"); fprintf(fout, "Network link\n");
break; break;
case RIG_PORT_NONE: case RIG_PORT_NONE:
fprintf(fout, "None\n"); fprintf(fout, "None\n");
@ -182,16 +182,16 @@ int dumpcaps (RIG* rig, FILE *fout)
(caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS") (caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
); );
fprintf(fout, "Write delay %dms, timeout %dms, %d retry\n", fprintf(fout, "Write delay: %dms, timeout %dms, %d retry\n",
caps->write_delay, caps->timeout, caps->retry); caps->write_delay, caps->timeout, caps->retry);
fprintf(fout, "Post Write delay %dms\n", fprintf(fout, "Post Write delay: %dms\n",
caps->post_write_delay); caps->post_write_delay);
fprintf(fout, "Has targetable VFO: %s\n", fprintf(fout, "Has targetable VFO: %s\n",
caps->targetable_vfo?"yes":"no"); caps->targetable_vfo ? "Y" : "N");
fprintf(fout, "Has transceive: %s\n", fprintf(fout, "Has transceive: %s\n",
caps->transceive?"yes":"no"); caps->transceive ? "Y" : "N");
fprintf(fout, "Announce: 0x%x\n", caps->announces); fprintf(fout, "Announce: 0x%x\n", caps->announces);
fprintf(fout, "Max RIT: -%ld.%ldkHz/+%ld.%ldkHz\n", fprintf(fout, "Max RIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
@ -210,13 +210,13 @@ int dumpcaps (RIG* rig, FILE *fout)
for(i = 0; i < MAXDBLSTSIZ && caps->preamp[i] != 0; i++) for(i = 0; i < MAXDBLSTSIZ && caps->preamp[i] != 0; i++)
fprintf(fout, " %ddB", caps->preamp[i]); fprintf(fout, " %ddB", caps->preamp[i]);
if (i == 0) if (i == 0)
fprintf(fout, " none"); fprintf(fout, " None");
fprintf(fout, "\n"); fprintf(fout, "\n");
fprintf(fout, "Attenuator:"); fprintf(fout, "Attenuator:");
for(i = 0; i < MAXDBLSTSIZ && caps->attenuator[i] != 0; i++) for(i = 0; i < MAXDBLSTSIZ && caps->attenuator[i] != 0; i++)
fprintf(fout, " %ddB",caps->attenuator[i]); fprintf(fout, " %ddB",caps->attenuator[i]);
if (i == 0) if (i == 0)
fprintf(fout, " none"); fprintf(fout, " None");
fprintf(fout, "\n"); fprintf(fout, "\n");
fprintf(fout, "CTCSS:"); fprintf(fout, "CTCSS:");
@ -224,7 +224,7 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, " %d.%1d", caps->ctcss_list[i] / 10, caps->ctcss_list[i] % 10); fprintf(fout, " %d.%1d", caps->ctcss_list[i] / 10, caps->ctcss_list[i] % 10);
} }
if (i == 0) if (i == 0)
fprintf(fout, " none"); fprintf(fout, " None");
else else
fprintf(fout, " Hz, %d tones", i); fprintf(fout, " Hz, %d tones", i);
fprintf(fout, "\n"); fprintf(fout, "\n");
@ -234,7 +234,7 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, " %d", caps->dcs_list[i]); fprintf(fout, " %d", caps->dcs_list[i]);
} }
if (i == 0) if (i == 0)
fprintf(fout, " none"); fprintf(fout, " None");
else else
fprintf(fout, ", %d codes", i); fprintf(fout, ", %d codes", i);
fprintf(fout, "\n"); fprintf(fout, "\n");
@ -249,22 +249,24 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "Get level: %s\n", prntbuf); fprintf(fout, "Get level: %s\n", prntbuf);
if ((caps->has_get_level & RIG_LEVEL_SQLSTAT)) { if ((caps->has_get_level & RIG_LEVEL_SQLSTAT)) {
fprintf(fout, "Warning: backend uses deprecated SQLSTAT level!\n"); fprintf(fout, "Warning--backend uses deprecated SQLSTAT level!\n");
backend_warnings++; backend_warnings++;
} }
if ((caps->has_get_level & RIG_LEVEL_RAWSTR) && if ((caps->has_get_level & RIG_LEVEL_RAWSTR) &&
caps->str_cal.size == 0) { caps->str_cal.size == 0) {
fprintf(fout, "Warning: backend has get RAWSTR, but not calibration data\n"); fprintf(fout, "Warning--backend has get RAWSTR, but not calibration data\n");
backend_warnings++; backend_warnings++;
} }
sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran); sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran);
fprintf(fout, "Set level: %s\n", prntbuf); fprintf(fout, "Set level: %s\n", prntbuf);
if (caps->has_set_level & RIG_LEVEL_READONLY_LIST) { if (caps->has_set_level & RIG_LEVEL_READONLY_LIST) {
fprintf(fout, "Warning: backend can set readonly levels!\n"); fprintf(fout, "Warning--backend can set readonly levels!\n");
backend_warnings++; backend_warnings++;
} }
fprintf(fout, "Extra levels:"); fprintf(fout, "Extra levels:");
rig_ext_level_foreach(rig, print_ext, fout); rig_ext_level_foreach(rig, print_ext, fout);
fprintf(fout, "\n"); fprintf(fout, "\n");
@ -275,7 +277,7 @@ int dumpcaps (RIG* rig, FILE *fout)
sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran); sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran);
fprintf(fout, "Set parameters: %s\n", prntbuf); fprintf(fout, "Set parameters: %s\n", prntbuf);
if (caps->has_set_parm & RIG_PARM_READONLY_LIST) { if (caps->has_set_parm & RIG_PARM_READONLY_LIST) {
fprintf(fout, "Warning: backend can set readonly parms!\n"); fprintf(fout, "Warning--backend can set readonly parms!\n");
backend_warnings++; backend_warnings++;
} }
fprintf(fout, "Extra parameters:"); fprintf(fout, "Extra parameters:");
@ -286,7 +288,7 @@ int dumpcaps (RIG* rig, FILE *fout)
if (rig->state.vfo_list != 0) if (rig->state.vfo_list != 0)
sprintf_vfo(prntbuf, rig->state.vfo_list); sprintf_vfo(prntbuf, rig->state.vfo_list);
else else
strcpy(prntbuf," none! This backend might be bogus!\n"); strcpy(prntbuf,"None. This backend might be bogus!\n");
fprintf(fout, "VFO list: %s\n", prntbuf); fprintf(fout, "VFO list: %s\n", prntbuf);
sprintf_vfop(prntbuf, caps->vfo_ops); sprintf_vfop(prntbuf, caps->vfo_ops);
@ -303,11 +305,11 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "\n\t%d..%d: \t%s", caps->chan_list[i].start, fprintf(fout, "\n\t%d..%d: \t%s", caps->chan_list[i].start,
caps->chan_list[i].end, caps->chan_list[i].end,
rig_strmtype(caps->chan_list[i].type)); rig_strmtype(caps->chan_list[i].type));
fprintf(fout, "\n\t mem caps: "); fprintf(fout, "\n\t Mem caps: ");
dump_chan_caps(&caps->chan_list[i].mem_caps, fout); dump_chan_caps(&caps->chan_list[i].mem_caps, fout);
} }
if (i == 0) if (i == 0)
fprintf(fout, " none"); fprintf(fout, " None");
fprintf(fout, "\n"); fprintf(fout, "\n");
/* TODO: print rx/tx ranges here */ /* TODO: print rx/tx ranges here */
@ -328,14 +330,15 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "Tuning steps:"); fprintf(fout, "Tuning steps:");
for (i = 0; i < TSLSTSIZ && !RIG_IS_TS_END(caps->tuning_steps[i]); i++) { for (i = 0; i < TSLSTSIZ && !RIG_IS_TS_END(caps->tuning_steps[i]); i++) {
if (caps->tuning_steps[i].ts == RIG_TS_ANY) if (caps->tuning_steps[i].ts == RIG_TS_ANY)
strcpy(freqbuf, "ANY"); strcpy(freqbuf, "ANY"); /* strcpy! Looks safe for now */
else else
sprintf_freq(freqbuf, caps->tuning_steps[i].ts); sprintf_freq(freqbuf, caps->tuning_steps[i].ts);
sprintf_mode(prntbuf, caps->tuning_steps[i].modes); sprintf_mode(prntbuf, caps->tuning_steps[i].modes);
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf); fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
} }
if (i == 0) { if (i == 0) {
fprintf(fout, " none! This backend might be bogus!"); fprintf(fout, " None! This backend might be bogus!");
backend_warnings++; backend_warnings++;
} }
fprintf(fout, "\n"); fprintf(fout, "\n");
@ -353,7 +356,7 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf); fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
} }
if (i == 0) { if (i == 0) {
fprintf(fout, " none! This backend might be bogus!"); fprintf(fout, " None. This backend might be bogus!");
backend_warnings++; backend_warnings++;
} }
fprintf(fout, "\n"); fprintf(fout, "\n");
@ -366,13 +369,13 @@ int dumpcaps (RIG* rig, FILE *fout)
continue; continue;
sprintf_freq(freqbuf, pbnorm); sprintf_freq(freqbuf, pbnorm);
fprintf(fout, "\n\t%s\tnormal: %s,\t", rig_strrmode(i), freqbuf); fprintf(fout, "\n\t%s\tNormal: %s,\t", rig_strrmode(i), freqbuf);
sprintf_freq(freqbuf, rig_passband_narrow(rig, i)); sprintf_freq(freqbuf, rig_passband_narrow(rig, i));
fprintf(fout, "narrow: %s,\t", freqbuf); fprintf(fout, "Narrow: %s,\t", freqbuf);
sprintf_freq(freqbuf, rig_passband_wide(rig, i)); sprintf_freq(freqbuf, rig_passband_wide(rig, i));
fprintf(fout, "wide: %s", freqbuf); fprintf(fout, "Wide: %s", freqbuf);
} }
fprintf(fout, "\n"); fprintf(fout, "\n");

Wyświetl plik

@ -1,8 +1,9 @@
/* /*
* rigctl_parse.c - (C) Stephane Fillod 2000-2009 * rigctl_parse.c - (C) Stephane Fillod 2000-2009
* (C) Terry Embry 2008-2009 * (C) Terry Embry 2008-2009
* (C) The Hamlib Group 2010
* *
* This program test/control a radio using Hamlib. * This program tests/controls a radio using Hamlib.
* It takes commands in interactive mode as well as * It takes commands in interactive mode as well as
* from command line options. * from command line options.
* *
@ -149,6 +150,8 @@ declare_proto_rig(set_powerstat);
declare_proto_rig(get_powerstat); declare_proto_rig(get_powerstat);
declare_proto_rig(send_dtmf); declare_proto_rig(send_dtmf);
declare_proto_rig(recv_dtmf); declare_proto_rig(recv_dtmf);
declare_proto_rig(chk_blk);
declare_proto_rig(chk_vfo);
/* /*
@ -223,6 +226,8 @@ static struct test_table test_list[] = {
{ '1', "dump_caps", dump_caps, ARG_NOVFO }, { '1', "dump_caps", dump_caps, ARG_NOVFO },
{ '3', "dump_conf", dump_conf, ARG_NOVFO }, { '3', "dump_conf", dump_conf, ARG_NOVFO },
{ 0x8f,"dump_state", dump_state, ARG_OUT|ARG_NOVFO }, { 0x8f,"dump_state", dump_state, ARG_OUT|ARG_NOVFO },
{ 0xf0,"chk_blk", chk_blk, ARG_NOVFO }, /* rigctld only--check for block protocol */
{ 0xf1,"chk_vfo", chk_vfo, ARG_NOVFO }, /* rigctld only--check for VFO mode */
{ 0x00, "", NULL }, { 0x00, "", NULL },
}; };
@ -461,8 +466,11 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc)
rig_debug(RIG_DEBUG_TRACE, "rigctl(d): %c '%s' '%s' '%s'\n", rig_debug(RIG_DEBUG_TRACE, "rigctl(d): %c '%s' '%s' '%s'\n",
cmd, p1, p2, p3); cmd, p1, p2, p3);
/* Block protocol: output received command name and arguments response */ /*
if (interactive && opt_block) { * Block protocol: output received command name and arguments response
* Don't send response on '\chk_blk' command
*/
if (interactive && opt_block && (cmd != 0xf0 && cmd != 0xf1)) {
char a1[MAXARGSZ+1]; char a1[MAXARGSZ+1];
char a2[MAXARGSZ+1]; char a2[MAXARGSZ+1];
char a3[MAXARGSZ+1]; char a3[MAXARGSZ+1];
@ -481,18 +489,22 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc)
pthread_mutex_unlock(&rig_mutex); pthread_mutex_unlock(&rig_mutex);
#endif #endif
if (retcode != RIG_OK) { if (retcode != RIG_OK) {
if (interactive && !prompt && opt_block) if ((interactive && !prompt && opt_block) || (interactive && !prompt))
fprintf(fout, NETRIGCTL_RET "%d\n", retcode); /* only for rigctld */ fprintf(fout, NETRIGCTL_RET "%d\n", retcode); /* only for rigctld */
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 {
// rig_debug(RIG_DEBUG_TRACE, "rigctld: %d %s\n", cmd, cmd_entry->name);
if (interactive && !prompt) { /* only for rigctld */ if (interactive && !prompt) { /* only for rigctld */
if (!(cmd_entry->flags & ARG_OUT) && !opt_end) /* netrigctl RIG_OK */ if (!(cmd_entry->flags & ARG_OUT)
&& !opt_end && !opt_block && (cmd != 0xf0 && cmd != 0xf1)) /* netrigctl RIG_OK */
fprintf(fout, NETRIGCTL_RET "0\n"); fprintf(fout, NETRIGCTL_RET "0\n");
else if ((cmd_entry->flags & ARG_OUT) && opt_end) /* Nate's protocol */ else if ((cmd_entry->flags & ARG_OUT) && opt_end) /* Nate's protocol */
fprintf(fout, "END\n"); fprintf(fout, "END\n");
else if (opt_block) /* block marker protocol */ else if (opt_block && (cmd != 0xf0 && cmd != 0xf1)) /* block marker protocol */
fprintf(fout, NETRIGCTL_RET "0\n"); fprintf(fout, NETRIGCTL_RET "0\n");
} }
} }
@ -2040,3 +2052,19 @@ declare_proto_rig(send_cmd)
return retval; return retval;
} }
/* '0xf0'--test if rigctld called with -b|--block option */
declare_proto_rig(chk_blk)
{
fprintf(fout, "CHKBLK %d\n", opt_block);
return RIG_OK;
}
/* '0xf1'--test if rigctld called with -o|--vfo option */
declare_proto_rig(chk_vfo)
{
fprintf(fout, "CHKVFO %d\n", vfo_mode);
return RIG_OK;
}

Wyświetl plik

@ -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" "January 24, 2010" "Hamlib" "Rig Control Daemon" .TH RIGCTLD "8" "February 3, 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:
@ -117,10 +117,12 @@ Dump capabilities for the radio defined with -m above and exit.
.TP .TP
.B \-o, --vfo .B \-o, --vfo
Set vfo mode, requiring an extra VFO argument in front of each appropriate Set vfo mode, requiring an extra VFO argument in front of each appropriate
command. Otherwise, VFO_CURR is assumed when this option is not set. command (except \fI\\set_vfo\fP!). Otherwise, 'currVFO' is assumed when this
option is not set and an extra VFO argument is not used. See \fI\\chk_vfo\fP
below.
.TP .TP
.B \-b, --block .B \-b, --block
Use the block rigctld protocol. \fIEXPERIMENTAL\fP Use the block rigctld protocol. See \fI\\chk_blk\fP below. \fIEXPERIMENTAL\fP
.TP .TP
.B \-e, --end-marker .B \-e, --end-marker
Use END marker in rigctld protocol. Use END marker in rigctld protocol.
@ -160,9 +162,9 @@ escaped with a preceding '\\' so that even though two backslash characters
appear in the code, only one will be passed to \fBrigctld\fP. This is a appear in the code, only one will be passed to \fBrigctld\fP. This is a
possible bug!). possible bug!).
.PP .PP
Please note that the backend for the radio to be controlled, Please note that the backend for the radio to be controlled, or the radio itself
or the radio itself may not support some commands. In that case, may not support some commands. In that case, the operation will fail with a
the operation will fail with a \fBHamlib\fP error message. \fBHamlib\fP error message.
.PP .PP
Here is a summary of the supported commands (In the case of "set" commands the Here is a summary of the supported commands (In the case of "set" commands the
quoted string is replaced by the value in the description. In the case of "get" quoted string is replaced by the value in the description. In the case of "get"
@ -185,7 +187,8 @@ Get 'Mode' 'Passband'. Returns Mode as a string from \fIset_mode\fP above
and Passband in Hz. and Passband in Hz.
.TP .TP
.B V, set_vfo 'VFO' .B V, set_vfo 'VFO'
Set 'VFO': VFOA, VFOB, VFOC, currVFO, VFO, MEM, Main, Sub, TX, RX. Set 'VFO': VFOA, VFOB, VFOC, currVFO, VFO, MEM, Main, Sub, TX, RX. In VFO mode
only a single VFO parameter is required.
.TP .TP
.B v, get_vfo .B v, get_vfo
Get current 'VFO'. Returns VFO as a string from \fIset_vfo\fP above. Get current 'VFO'. Returns VFO as a string from \fIset_vfo\fP above.
@ -369,7 +372,8 @@ Get misc information about the rig (no value is passed).
.B 1, dump_caps .B 1, dump_caps
Not a real rig remote command, it just dumps capabilities, i.e. what the Not a real rig remote command, it just dumps capabilities, i.e. what the
backend knows about this model, and what it can do. TODO: Ensure this is backend knows about this model, and what it can do. TODO: Ensure this is
in a consistent format so it can be read into a hash, dictionary, etc. in a consistent format so it can be read into a hash, dictionary, etc. Bug
reports requested.
.TP .TP
.B 2, power2mW .B 2, power2mW
Converts a power value in a range of \fI0.0 ... 1.0\fP to the real transmit Converts a power value in a range of \fI0.0 ... 1.0\fP to the real transmit
@ -381,6 +385,20 @@ Send raw command string to rig.
.br .br
For binary protocols enter values as \\0xAA\\0xBB. Expect a 'Reply' from the For binary protocols enter values as \\0xAA\\0xBB. Expect a 'Reply' from the
rig which will likely be a binary block or an ASCII string. rig which will likely be a binary block or an ASCII string.
.TP
.B chk_blk
Returns "CHKBLK 1\\n" (single line only) if \fBrigctld\fP was invoked with the
\fI-b\fP or \fI--block\fP option, "CHKBLK 0\\n" if not.
.br
.TP
.B chk_vfo
Returns "CHKVFO 1\\n" (single line only) if \fBrigctld\fP was invoked with the
\fI-o\fP or \fI--vfo\fP option, "CHKVFO 0\\n" if not.
.br
When in VFO mode client will need to pass 'VFO' as the first parameter to
\fI\\set\fP or \fI\\get\fP commands. 'VFO' is one of the strings defined
for \fI\\set_vfo\fP above.
.br
.SH PROTOCOL .SH PROTOCOL
\fBDefault Protocol\fP \fBDefault Protocol\fP
.br .br
@ -456,11 +474,13 @@ only of the long command name. The final line shows that the command was
processed successfully by the rig backend. processed successfully by the rig backend.
.PP .PP
The following commands have been tested with the Block protocol and the included The following commands have been tested with the Block protocol and the included
`testctld.pl' script: \fBtestctld.pl\fP script:
.br .br
\fI\\set_freq\fP \fI\\get-freq\fP \fI\\set_freq\fP \fI\\get-freq\fP
.br .br
\fI\\set_mode\fP \fI\\get_mode\fP \fI\\set_mode\fP \fI\\get_mode\fP
.br
\fI\\set_vfo\fP \fI\\get_vfo\fP
.SH EXAMPLES .SH EXAMPLES
Start \fBrigctld\fP for a Yaesu FT-920 using an USB-to-serial adapter and Start \fBrigctld\fP for a Yaesu FT-920 using an USB-to-serial adapter and
backgrounding: backgrounding:
@ -468,13 +488,14 @@ backgrounding:
$ rigctld -m 114 -r /dev/ttyUSB1 & $ rigctld -m 114 -r /dev/ttyUSB1 &
.PP .PP
Start \fBrigctld\fP for a Yaesu FT-920 using a USB to serial adapter while Start \fBrigctld\fP for a Yaesu FT-920 using a USB to serial adapter while
setting baud rate and stop bits and backgrounding: setting baud rate and stop bits, invoking block protocol, and backgrounding:
.PP .PP
$ rigctld -m 114 -r /dev/ttyUSB1 -s 4800 -C stop_bits=2 & $ rigctld -m 114 -r /dev/ttyUSB1 -s 4800 -C stop_bits=2 --block &
.PP .PP
Connect to the already running \fBrigctld\fP, and set current frequency to 14.266 MHz: Connect to the already running \fBrigctld\fP, and set current frequency to
14.266 MHz with a 1 second read timeout:
.PP .PP
$ echo "\\set_freq 14266000" | nc localhost 4532 $ echo "\\set_freq 14266000" | nc -w 1 localhost 4532
.SH DIAGNOSTICS .SH DIAGNOSTICS
The \fB-v\fP, \fB--verbose\fP, option allows different levels of diagnostics The \fB-v\fP, \fB--verbose\fP, option allows different levels of diagnostics
to be output to \fBstderr\fP and correspond to -v for BUG, -vv for ERR, to be output to \fBstderr\fP and correspond to -v for BUG, -vv for ERR,
@ -498,11 +519,11 @@ Report bugs to <hamlib-developer@lists.sourceforge.net>.
.br .br
We are already aware of the bugs in the previous section :-) We are already aware of the bugs in the previous section :-)
.SH AUTHORS .SH AUTHORS
Written by Stephane Fillod and the Hamlib Group Written by Stephane Fillod, Nate Bargmann, and the Hamlib Group
.br .br
<http://www.hamlib.org>. <http://www.hamlib.org>.
.SH COPYRIGHT .SH COPYRIGHT
Copyright \(co 2000-2010 Stephane Fillod and the Hamlib Group. Copyright \(co 2000-2010 Stephane Fillod, Nate Bargmann, and the Hamlib Group.
.PP .PP
This is free software; see the source for copying conditions. This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY There is NO warranty; not even for MERCHANTABILITY

Wyświetl plik

@ -108,7 +108,7 @@ int interactive = 1; /* no cmd because of daemon */
int prompt = 0; /* Daemon mode for rigparse return string */ int prompt = 0; /* Daemon mode for rigparse return string */
int opt_end = 0; /* END marker for rigctld */ int opt_end = 0; /* END marker for rigctld */
int opt_block = 0; /* Block markers for rigctld */ int opt_block = 0; /* Block markers for rigctld */
int vfo_mode; /* vfo_mode=0 means target VFO is current VFO */ int vfo_mode = 0; /* vfo_mode=0 means target VFO is current VFO */
char send_cmd_term = '\r'; /* send_cmd termination char */ char send_cmd_term = '\r'; /* send_cmd termination char */
@ -278,10 +278,11 @@ int main (int argc, char *argv[])
dump_caps_opt++; dump_caps_opt++;
break; break;
case 'e': case 'e':
opt_end = 1; opt_end++;
fprintf(stderr, "-e|--end-marker option is deprecated. Please consider -b|--block instead.\n");
break; break;
case 'b': case 'b':
opt_block = 1; opt_block++;
break; break;
default: default:
usage(); /* unknown option? */ usage(); /* unknown option? */
@ -339,7 +340,7 @@ int main (int argc, char *argv[])
} }
/* /*
* print out conf parameters, and exists immediately * print out conf parameters, and exits immediately
* We may be interested only in only caps, and rig_open may fail. * We may be interested only in only caps, and rig_open may fail.
*/ */
if (dump_caps_opt) { if (dump_caps_opt) {