kopia lustrzana https://github.com/Hamlib/Hamlib
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-79ac388436b8Hamlib-1.2.11
rodzic
5d539dcb02
commit
5e47dcf8d3
349
tests/dumpcaps.c
349
tests/dumpcaps.c
|
@ -3,23 +3,23 @@
|
|||
* This programs dumps the capabilities of a backend rig.
|
||||
*
|
||||
*
|
||||
* $Id: dumpcaps.c,v 1.52 2009-01-28 22:49:58 fillods Exp $
|
||||
* $Id: dumpcaps.c,v 1.52 2009-01-28 22:49:58 fillods Exp $
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -45,12 +45,12 @@ static void dump_chan_caps(const channel_cap_t *chan, FILE *fout);
|
|||
* the rig may be in rig_init state, but not openned
|
||||
*/
|
||||
int dumpcaps (RIG* rig, FILE *fout)
|
||||
{
|
||||
{
|
||||
const struct rig_caps *caps;
|
||||
int status,i;
|
||||
int can_esplit,can_echannel;
|
||||
int status, i;
|
||||
int can_esplit, can_echannel;
|
||||
char freqbuf[20];
|
||||
int backend_warnings=0;
|
||||
int backend_warnings = 0;
|
||||
static char prntbuf[1024]; /* a malloc would be better.. */
|
||||
|
||||
if (!rig || !rig->caps)
|
||||
|
@ -58,11 +58,11 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
|
||||
caps = rig->caps;
|
||||
|
||||
fprintf(fout, "Caps dump for model %d\n",caps->rig_model);
|
||||
fprintf(fout, "Model name:\t%s\n",caps->model_name);
|
||||
fprintf(fout, "Mfg name:\t%s\n",caps->mfg_name);
|
||||
fprintf(fout, "Backend version:\t%s\n",caps->version);
|
||||
fprintf(fout, "Backend copyright:\t%s\n",caps->copyright);
|
||||
fprintf(fout, "Caps dump for model: %d\n", caps->rig_model);
|
||||
fprintf(fout, "Model name:\t%s\n", caps->model_name);
|
||||
fprintf(fout, "Mfg name:\t%s\n", caps->mfg_name);
|
||||
fprintf(fout, "Backend version:\t%s\n", caps->version);
|
||||
fprintf(fout, "Backend copyright:\t%s\n", caps->copyright);
|
||||
fprintf(fout, "Backend status:\t%s\n", rig_strstatus(caps->status));
|
||||
fprintf(fout, "Rig type:\t");
|
||||
switch (caps->rig_type & RIG_TYPE_MASK) {
|
||||
|
@ -104,16 +104,16 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
fprintf(fout, "PTT type:\t");
|
||||
switch (caps->ptt_type) {
|
||||
case RIG_PTT_RIG:
|
||||
fprintf(fout, "rig capable\n");
|
||||
fprintf(fout, "Rig capable\n");
|
||||
break;
|
||||
case RIG_PTT_PARALLEL:
|
||||
fprintf(fout, "thru parallel port (DATA0)\n");
|
||||
fprintf(fout, "Parallel port (DATA0)\n");
|
||||
break;
|
||||
case RIG_PTT_SERIAL_RTS:
|
||||
fprintf(fout, "thru serial port (CTS/RTS)\n");
|
||||
fprintf(fout, "Serial port (CTS/RTS)\n");
|
||||
break;
|
||||
case RIG_PTT_SERIAL_DTR:
|
||||
fprintf(fout, "thru serial port (DTR/DSR)\n");
|
||||
fprintf(fout, "Serial port (DTR/DSR)\n");
|
||||
break;
|
||||
case RIG_PTT_NONE:
|
||||
fprintf(fout, "None\n");
|
||||
|
@ -126,19 +126,19 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
fprintf(fout, "DCD type:\t");
|
||||
switch (caps->dcd_type) {
|
||||
case RIG_DCD_RIG:
|
||||
fprintf(fout, "rig capable\n");
|
||||
fprintf(fout, "Rig capable\n");
|
||||
break;
|
||||
case RIG_DCD_PARALLEL:
|
||||
fprintf(fout, "thru parallel port (DATA1? STROBE?)\n");
|
||||
fprintf(fout, "Parallel port (DATA1? STROBE?)\n");
|
||||
break;
|
||||
case RIG_DCD_SERIAL_CTS:
|
||||
fprintf(fout, "thru serial port (CTS/RTS)\n");
|
||||
fprintf(fout, "Serial port (CTS/RTS)\n");
|
||||
break;
|
||||
case RIG_DCD_SERIAL_DSR:
|
||||
fprintf(fout, "thru serial port (DTR/DSR)\n");
|
||||
fprintf(fout, "Serial port (DTR/DSR)\n");
|
||||
break;
|
||||
case RIG_DCD_SERIAL_CAR:
|
||||
fprintf(fout, "thru serial port (CD)\n");
|
||||
fprintf(fout, "Serial port (CD)\n");
|
||||
break;
|
||||
case RIG_DCD_NONE:
|
||||
fprintf(fout, "None\n");
|
||||
|
@ -157,13 +157,13 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
fprintf(fout, "Parallel\n");
|
||||
break;
|
||||
case RIG_PORT_DEVICE:
|
||||
fprintf(fout, "device driver\n");
|
||||
fprintf(fout, "Device driver\n");
|
||||
break;
|
||||
case RIG_PORT_USB:
|
||||
fprintf(fout, "USB\n");
|
||||
break;
|
||||
case RIG_PORT_NETWORK:
|
||||
fprintf(fout, "network link\n");
|
||||
fprintf(fout, "Network link\n");
|
||||
break;
|
||||
case RIG_PORT_NONE:
|
||||
fprintf(fout, "None\n");
|
||||
|
@ -174,67 +174,67 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
}
|
||||
|
||||
fprintf(fout, "Serial speed: %d..%d bauds, %d%c%d %s\n", caps->serial_rate_min,
|
||||
caps->serial_rate_max,caps->serial_data_bits,
|
||||
caps->serial_parity==RIG_PARITY_NONE?'N':
|
||||
(caps->serial_parity==RIG_PARITY_ODD?'O':'E'),
|
||||
caps->serial_rate_max, caps->serial_data_bits,
|
||||
caps->serial_parity == RIG_PARITY_NONE ? 'N':
|
||||
(caps->serial_parity == RIG_PARITY_ODD ? 'O' : 'E'),
|
||||
caps->serial_stop_bits,
|
||||
caps->serial_handshake==RIG_HANDSHAKE_NONE?"":
|
||||
(caps->serial_handshake==RIG_HANDSHAKE_XONXOFF?"XONXOFF":"CTS/RTS")
|
||||
caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
|
||||
(caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
|
||||
);
|
||||
|
||||
fprintf(fout, "Write delay %dms, timeout %dms, %d retry\n",
|
||||
caps->write_delay,caps->timeout,caps->retry);
|
||||
fprintf(fout, "Post Write delay %dms\n",
|
||||
fprintf(fout, "Write delay: %dms, timeout %dms, %d retry\n",
|
||||
caps->write_delay, caps->timeout, caps->retry);
|
||||
fprintf(fout, "Post Write delay: %dms\n",
|
||||
caps->post_write_delay);
|
||||
|
||||
fprintf(fout, "Has targetable VFO: %s\n",
|
||||
caps->targetable_vfo?"yes":"no");
|
||||
caps->targetable_vfo ? "Y" : "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, "Max RIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
||||
caps->max_rit/1000, caps->max_rit%1000,
|
||||
caps->max_rit/1000, caps->max_rit%1000);
|
||||
fprintf(fout, "Max RIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
||||
caps->max_rit / 1000, caps->max_rit % 1000,
|
||||
caps->max_rit / 1000, caps->max_rit % 1000);
|
||||
|
||||
fprintf(fout, "Max XIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
||||
caps->max_xit/1000, caps->max_xit%1000,
|
||||
caps->max_xit/1000, caps->max_xit%1000);
|
||||
fprintf(fout, "Max XIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
||||
caps->max_xit / 1000, caps->max_xit % 1000,
|
||||
caps->max_xit / 1000, caps->max_xit % 1000);
|
||||
|
||||
fprintf(fout, "Max IF-SHIFT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
||||
caps->max_ifshift/1000, caps->max_ifshift%1000,
|
||||
caps->max_ifshift/1000, caps->max_ifshift%1000);
|
||||
fprintf(fout, "Max IF-SHIFT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
||||
caps->max_ifshift / 1000, caps->max_ifshift % 1000,
|
||||
caps->max_ifshift / 1000, caps->max_ifshift % 1000);
|
||||
|
||||
fprintf(fout, "Preamp:");
|
||||
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]);
|
||||
if (i == 0)
|
||||
fprintf(fout, " none");
|
||||
fprintf(fout, " None");
|
||||
fprintf(fout, "\n");
|
||||
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]);
|
||||
if (i == 0)
|
||||
fprintf(fout, " none");
|
||||
fprintf(fout, " None");
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "CTCSS:");
|
||||
for(i=0; caps->ctcss_list && i<60 && caps->ctcss_list[i] != 0; i++) {
|
||||
fprintf(fout, " %d.%1d",caps->ctcss_list[i]/10,caps->ctcss_list[i]%10);
|
||||
for(i = 0; caps->ctcss_list && i < 60 && caps->ctcss_list[i] != 0; i++) {
|
||||
fprintf(fout, " %d.%1d", caps->ctcss_list[i] / 10, caps->ctcss_list[i] % 10);
|
||||
}
|
||||
if (i == 0)
|
||||
fprintf(fout, " none");
|
||||
fprintf(fout, " None");
|
||||
else
|
||||
fprintf(fout, " Hz, %d tones", i);
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "DCS:");
|
||||
for(i=0; caps->dcs_list && i<128 && caps->dcs_list[i] != 0; i++) {
|
||||
fprintf(fout, " %d",caps->dcs_list[i]);
|
||||
for(i = 0; caps->dcs_list && i < 128 && caps->dcs_list[i] != 0; i++) {
|
||||
fprintf(fout, " %d", caps->dcs_list[i]);
|
||||
}
|
||||
if (i == 0)
|
||||
fprintf(fout, " none");
|
||||
fprintf(fout, " None");
|
||||
else
|
||||
fprintf(fout, ", %d codes", i);
|
||||
fprintf(fout, "\n");
|
||||
|
@ -248,23 +248,25 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
sprintf_level_gran(prntbuf, caps->has_get_level, caps->level_gran);
|
||||
fprintf(fout, "Get level: %s\n", prntbuf);
|
||||
|
||||
if ((caps->has_get_level&RIG_LEVEL_SQLSTAT)) {
|
||||
fprintf(fout, "Warning: backend uses deprecated SQLSTAT level!\n");
|
||||
if ((caps->has_get_level & RIG_LEVEL_SQLSTAT)) {
|
||||
fprintf(fout, "Warning--backend uses deprecated SQLSTAT level!\n");
|
||||
backend_warnings++;
|
||||
}
|
||||
|
||||
if ((caps->has_get_level&RIG_LEVEL_RAWSTR) &&
|
||||
if ((caps->has_get_level & RIG_LEVEL_RAWSTR) &&
|
||||
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++;
|
||||
}
|
||||
|
||||
sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran);
|
||||
fprintf(fout, "Set level: %s\n", prntbuf);
|
||||
if (caps->has_set_level&RIG_LEVEL_READONLY_LIST) {
|
||||
fprintf(fout, "Warning: backend can set readonly levels!\n");
|
||||
|
||||
if (caps->has_set_level & RIG_LEVEL_READONLY_LIST) {
|
||||
fprintf(fout, "Warning--backend can set readonly levels!\n");
|
||||
backend_warnings++;
|
||||
}
|
||||
|
||||
fprintf(fout, "Extra levels:");
|
||||
rig_ext_level_foreach(rig, print_ext, fout);
|
||||
fprintf(fout, "\n");
|
||||
|
@ -274,8 +276,8 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
|
||||
sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran);
|
||||
fprintf(fout, "Set parameters: %s\n", prntbuf);
|
||||
if (caps->has_set_parm&RIG_PARM_READONLY_LIST) {
|
||||
fprintf(fout, "Warning: backend can set readonly parms!\n");
|
||||
if (caps->has_set_parm & RIG_PARM_READONLY_LIST) {
|
||||
fprintf(fout, "Warning--backend can set readonly parms!\n");
|
||||
backend_warnings++;
|
||||
}
|
||||
fprintf(fout, "Extra parameters:");
|
||||
|
@ -283,10 +285,10 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
fprintf(fout, "\n");
|
||||
|
||||
|
||||
if (rig->state.vfo_list!=0)
|
||||
if (rig->state.vfo_list != 0)
|
||||
sprintf_vfo(prntbuf, rig->state.vfo_list);
|
||||
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);
|
||||
|
||||
sprintf_vfop(prntbuf, caps->vfo_ops);
|
||||
|
@ -299,44 +301,45 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
fprintf(fout, "Memory name desc size:\t%d\n", caps->chan_desc_sz);
|
||||
|
||||
fprintf(fout, "Memories:");
|
||||
for (i=0; i<CHANLSTSIZ && caps->chan_list[i].type; i++) {
|
||||
for (i = 0; i < CHANLSTSIZ && caps->chan_list[i].type; i++) {
|
||||
fprintf(fout, "\n\t%d..%d: \t%s", caps->chan_list[i].start,
|
||||
caps->chan_list[i].end,
|
||||
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);
|
||||
}
|
||||
if (i == 0)
|
||||
fprintf(fout, " none");
|
||||
fprintf(fout, " None");
|
||||
fprintf(fout, "\n");
|
||||
|
||||
/* TODO: print rx/tx ranges here */
|
||||
status = range_sanity_check(caps->tx_range_list1,0);
|
||||
fprintf(fout, "TX ranges status, region 1:\t%s (%d)\n",status?"Bad":"OK",status);
|
||||
status = range_sanity_check(caps->tx_range_list1, 0);
|
||||
fprintf(fout, "TX ranges status, region 1:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
||||
if (status) backend_warnings++;
|
||||
status = range_sanity_check(caps->rx_range_list1,1);
|
||||
fprintf(fout, "RX ranges status, region 1:\t%s (%d)\n",status?"Bad":"OK",status);
|
||||
status = range_sanity_check(caps->rx_range_list1, 1);
|
||||
fprintf(fout, "RX ranges status, region 1:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
||||
if (status) backend_warnings++;
|
||||
|
||||
status = range_sanity_check(caps->tx_range_list2,0);
|
||||
fprintf(fout, "TX ranges status, region 2:\t%s (%d)\n",status?"Bad":"OK",status);
|
||||
status = range_sanity_check(caps->tx_range_list2, 0);
|
||||
fprintf(fout, "TX ranges status, region 2:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
||||
if (status) backend_warnings++;
|
||||
status = range_sanity_check(caps->rx_range_list2,1);
|
||||
fprintf(fout, "RX ranges status, region 2:\t%s (%d)\n",status?"Bad":"OK",status);
|
||||
status = range_sanity_check(caps->rx_range_list2, 1);
|
||||
fprintf(fout, "RX ranges status, region 2:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
||||
if (status) backend_warnings++;
|
||||
|
||||
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)
|
||||
strcpy(freqbuf, "ANY");
|
||||
strcpy(freqbuf, "ANY"); /* strcpy! Looks safe for now */
|
||||
else
|
||||
sprintf_freq(freqbuf,caps->tuning_steps[i].ts);
|
||||
sprintf_mode(prntbuf,caps->tuning_steps[i].modes);
|
||||
sprintf_freq(freqbuf, caps->tuning_steps[i].ts);
|
||||
|
||||
sprintf_mode(prntbuf, caps->tuning_steps[i].modes);
|
||||
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
|
||||
}
|
||||
if (i==0) {
|
||||
fprintf(fout, " none! This backend might be bogus!");
|
||||
backend_warnings++;
|
||||
if (i == 0) {
|
||||
fprintf(fout, " None! This backend might be bogus!");
|
||||
backend_warnings++;
|
||||
}
|
||||
fprintf(fout, "\n");
|
||||
status = ts_sanity_check(caps->tuning_steps);
|
||||
|
@ -352,114 +355,114 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
sprintf_mode(prntbuf,caps->filters[i].modes);
|
||||
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
|
||||
}
|
||||
if (i==0) {
|
||||
fprintf(fout, " none! This backend might be bogus!");
|
||||
backend_warnings++;
|
||||
if (i == 0) {
|
||||
fprintf(fout, " None. This backend might be bogus!");
|
||||
backend_warnings++;
|
||||
}
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "Bandwidths:");
|
||||
for (i=1; i < RIG_MODE_TESTS_MAX; i<<=1) {
|
||||
fprintf(fout, "Bandwidths:");
|
||||
for (i = 1; i < RIG_MODE_TESTS_MAX; i <<= 1) {
|
||||
pbwidth_t pbnorm = rig_passband_normal(rig, i);
|
||||
|
||||
if (pbnorm == 0)
|
||||
continue;
|
||||
|
||||
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));
|
||||
fprintf(fout, "narrow: %s,\t", freqbuf);
|
||||
fprintf(fout, "Narrow: %s,\t", freqbuf);
|
||||
|
||||
sprintf_freq(freqbuf, rig_passband_wide(rig, i));
|
||||
fprintf(fout, "wide: %s", freqbuf);
|
||||
fprintf(fout, "Wide: %s", freqbuf);
|
||||
}
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "Has priv data:\t%c\n",caps->priv!=NULL?'Y':'N');
|
||||
fprintf(fout, "Has priv data:\t%c\n", caps->priv != NULL ? 'Y' : 'N');
|
||||
/*
|
||||
* Status is either 'Y'es, 'E'mulated, 'N'o
|
||||
*
|
||||
* TODO: keep me up-to-date with API call list!
|
||||
*/
|
||||
fprintf(fout, "Has init:\t%c\n",caps->rig_init!=NULL?'Y':'N');
|
||||
fprintf(fout, "Has cleanup:\t%c\n",caps->rig_cleanup!=NULL?'Y':'N');
|
||||
fprintf(fout, "Has open:\t%c\n",caps->rig_open!=NULL?'Y':'N');
|
||||
fprintf(fout, "Has close:\t%c\n",caps->rig_close!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set conf:\t%c\n",caps->set_conf!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get conf:\t%c\n",caps->get_conf!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set frequency:\t%c\n",caps->set_freq!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get frequency:\t%c\n",caps->get_freq!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set mode:\t%c\n",caps->set_mode!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get mode:\t%c\n",caps->get_mode!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set vfo:\t%c\n",caps->set_vfo!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get vfo:\t%c\n",caps->get_vfo!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set ptt:\t%c\n",caps->set_ptt!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get ptt:\t%c\n",caps->get_ptt!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get dcd:\t%c\n",caps->get_dcd!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set repeater duplex:\t%c\n",caps->set_rptr_shift!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get repeater duplex:\t%c\n",caps->get_rptr_shift!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set repeater offset:\t%c\n",caps->set_rptr_offs!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get repeater offset:\t%c\n",caps->get_rptr_offs!=NULL?'Y':'N');
|
||||
fprintf(fout, "Has init:\t%c\n", caps->rig_init != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Has cleanup:\t%c\n", caps->rig_cleanup != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Has open:\t%c\n", caps->rig_open != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Has close:\t%c\n", caps->rig_close != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set conf:\t%c\n", caps->set_conf != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get conf:\t%c\n", caps->get_conf != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set frequency:\t%c\n", caps->set_freq != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get frequency:\t%c\n", caps->get_freq != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set mode:\t%c\n", caps->set_mode != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get mode:\t%c\n", caps->get_mode != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set vfo:\t%c\n", caps->set_vfo != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get vfo:\t%c\n", caps->get_vfo != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set ptt:\t%c\n", caps->set_ptt != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get ptt:\t%c\n", caps->get_ptt != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get dcd:\t%c\n", caps->get_dcd != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set repeater duplex:\t%c\n", caps->set_rptr_shift != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get repeater duplex:\t%c\n", caps->get_rptr_shift != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set repeater offset:\t%c\n", caps->set_rptr_offs != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get repeater offset:\t%c\n", caps->get_rptr_offs != NULL ? 'Y' : 'N');
|
||||
|
||||
can_esplit = caps->set_vfo ||
|
||||
can_esplit = caps->set_vfo ||
|
||||
(rig_has_vfo_op(rig, RIG_OP_TOGGLE) && caps->vfo_op);
|
||||
fprintf(fout, "Can set split freq:\t%c\n",caps->set_split_freq!=NULL?'Y':
|
||||
(can_esplit&&caps->set_freq?'E':'N'));
|
||||
fprintf(fout, "Can get split freq:\t%c\n",caps->get_split_freq!=NULL?'Y':
|
||||
(can_esplit&&caps->get_freq?'E':'N'));
|
||||
fprintf(fout, "Can set split mode:\t%c\n",caps->set_split_mode!=NULL?'Y':
|
||||
(can_esplit&&caps->set_mode?'E':'N'));
|
||||
fprintf(fout, "Can get split mode:\t%c\n",caps->get_split_mode!=NULL?'Y':
|
||||
(can_esplit&&caps->get_mode?'E':'N'));
|
||||
fprintf(fout, "Can set split freq:\t%c\n", caps->set_split_freq != NULL ? 'Y' :
|
||||
(can_esplit && caps->set_freq ? 'E' : 'N'));
|
||||
fprintf(fout, "Can get split freq:\t%c\n", caps->get_split_freq != NULL ? 'Y' :
|
||||
(can_esplit && caps->get_freq ? 'E' : 'N'));
|
||||
fprintf(fout, "Can set split mode:\t%c\n", caps->set_split_mode != NULL ? 'Y' :
|
||||
(can_esplit && caps->set_mode ? 'E' : 'N'));
|
||||
fprintf(fout, "Can get split mode:\t%c\n", caps->get_split_mode != NULL ? 'Y' :
|
||||
(can_esplit && caps->get_mode ? 'E' : 'N'));
|
||||
|
||||
fprintf(fout, "Can set split vfo:\t%c\n",caps->set_split_vfo!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get split vfo:\t%c\n",caps->get_split_vfo!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set tuning step:\t%c\n",caps->set_ts!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get tuning step:\t%c\n",caps->get_ts!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set RIT:\t%c\n",caps->set_rit!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get RIT:\t%c\n",caps->get_rit!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set XIT:\t%c\n",caps->set_xit!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get XIT:\t%c\n",caps->get_xit!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set CTCSS:\t%c\n",caps->set_ctcss_tone!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get CTCSS:\t%c\n",caps->get_ctcss_tone!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set DCS:\t%c\n",caps->set_dcs_code!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get DCS:\t%c\n",caps->get_dcs_code!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set CTCSS squelch:\t%c\n",caps->set_ctcss_sql!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get CTCSS squelch:\t%c\n",caps->get_ctcss_sql!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set DCS squelch:\t%c\n",caps->set_dcs_sql!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get DCS squelch:\t%c\n",caps->get_dcs_sql!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set power stat:\t%c\n",caps->set_powerstat!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get power stat:\t%c\n",caps->get_powerstat!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can reset:\t%c\n",caps->reset!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get ant:\t%c\n",caps->get_ant!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set ant:\t%c\n",caps->set_ant!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set transceive:\t%c\n",caps->set_trn!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get transceive:\t%c\n",caps->get_trn!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set func:\t%c\n",caps->set_func!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get func:\t%c\n",caps->get_func!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set level:\t%c\n",caps->set_level!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get level:\t%c\n",caps->get_level!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set param:\t%c\n",caps->set_parm!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get param:\t%c\n",caps->get_parm!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can send DTMF:\t%c\n",caps->send_dtmf!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can recv DTMF:\t%c\n",caps->recv_dtmf!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can send Morse:\t%c\n",caps->send_morse!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can decode events:\t%c\n",caps->decode_event!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set bank:\t%c\n",caps->set_bank!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set mem:\t%c\n",caps->set_mem!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get mem:\t%c\n",caps->get_mem!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can set split vfo:\t%c\n", caps->set_split_vfo != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get split vfo:\t%c\n", caps->get_split_vfo != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set tuning step:\t%c\n", caps->set_ts != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get tuning step:\t%c\n", caps->get_ts != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set RIT:\t%c\n", caps->set_rit != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get RIT:\t%c\n", caps->get_rit != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set XIT:\t%c\n", caps->set_xit != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get XIT:\t%c\n", caps->get_xit != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set CTCSS:\t%c\n", caps->set_ctcss_tone != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get CTCSS:\t%c\n", caps->get_ctcss_tone != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set DCS:\t%c\n", caps->set_dcs_code != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get DCS:\t%c\n", caps->get_dcs_code != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set CTCSS squelch:\t%c\n", caps->set_ctcss_sql != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get CTCSS squelch:\t%c\n", caps->get_ctcss_sql != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set DCS squelch:\t%c\n", caps->set_dcs_sql != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get DCS squelch:\t%c\n", caps->get_dcs_sql != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set power stat:\t%c\n", caps->set_powerstat != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get power stat:\t%c\n", caps->get_powerstat != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can reset:\t%c\n", caps->reset != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get ant:\t%c\n", caps->get_ant != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set ant:\t%c\n", caps->set_ant != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set transceive:\t%c\n", caps->set_trn != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get transceive:\t%c\n", caps->get_trn != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set func:\t%c\n", caps->set_func != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get func:\t%c\n", caps->get_func != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set level:\t%c\n", caps->set_level != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get level:\t%c\n", caps->get_level != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set param:\t%c\n", caps->set_parm != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get param:\t%c\n", caps->get_parm != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can send DTMF:\t%c\n", caps->send_dtmf != NULL ? 'Y ': 'N');
|
||||
fprintf(fout, "Can recv DTMF:\t%c\n", caps->recv_dtmf != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can send Morse:\t%c\n", caps->send_morse != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can decode events:\t%c\n", caps->decode_event != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set bank:\t%c\n", caps->set_bank != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can set mem:\t%c\n", caps->set_mem != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can get mem:\t%c\n", caps->get_mem != NULL ? 'Y' : 'N');
|
||||
|
||||
can_echannel = caps->set_mem && caps->set_vfo;
|
||||
fprintf(fout, "Can set channel:\t%c\n",caps->set_channel!=NULL?'Y':
|
||||
(can_echannel?'E':'N'));
|
||||
fprintf(fout, "Can get channel:\t%c\n",caps->get_channel!=NULL?'Y':
|
||||
(can_echannel?'E':'N'));
|
||||
fprintf(fout, "Can set channel:\t%c\n", caps->set_channel != NULL ? 'Y' :
|
||||
(can_echannel ? 'E' : 'N'));
|
||||
fprintf(fout, "Can get channel:\t%c\n", caps->get_channel != NULL ? 'Y' :
|
||||
(can_echannel ? 'E' : 'N'));
|
||||
|
||||
fprintf(fout, "Can ctl mem/vfo:\t%c\n", caps->vfo_op != NULL ? 'Y' : 'N');
|
||||
fprintf(fout, "Can scan:\t%c\n", caps->scan != NULL ? 'Y' :' N');
|
||||
fprintf(fout, "Can get info:\t%c\n", caps->get_info != NULL ? 'Y' : 'N');
|
||||
|
||||
fprintf(fout, "Can ctl mem/vfo:\t%c\n",caps->vfo_op!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can scan:\t%c\n",caps->scan!=NULL?'Y':'N');
|
||||
fprintf(fout, "Can get info:\t%c\n",caps->get_info!=NULL?'Y':'N');
|
||||
|
||||
|
||||
fprintf(fout, "\nOverall backend warnings: %d\n", backend_warnings);
|
||||
|
||||
|
@ -469,20 +472,20 @@ int dumpcaps (RIG* rig, FILE *fout)
|
|||
|
||||
static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr)
|
||||
{
|
||||
fprintf((FILE*)ptr, " %s", cfp->name);
|
||||
fprintf((FILE *)ptr, " %s", cfp->name);
|
||||
|
||||
return 1; /* process them all */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* check for:
|
||||
* - start_freq<end_freq return_code=-1
|
||||
* - modes are not 0 return_code=-2
|
||||
* - if(rx), low_power,high_power set to -1 return_code=-3
|
||||
* else, power is >0
|
||||
* - array is ended by a {0,0,0,0,0} element (before boundary) rc=-4
|
||||
* - ranges with same modes do not overlap rc=-5
|
||||
* - start_freq < end_freq return_code = -1
|
||||
* - modes are not 0 return_code = -2
|
||||
* - if(rx), low_power, high_power set to -1 return_code = -3
|
||||
* else, power is > 0
|
||||
* - array is ended by a {0,0,0,0,0} element (before boundary) rc = -4
|
||||
* - ranges with same modes do not overlap rc = -5
|
||||
* ->fprintf(stderr,)!
|
||||
*
|
||||
* TODO: array is sorted in ascending freq order
|
||||
|
@ -491,7 +494,7 @@ int range_sanity_check(const struct freq_range_list range_list[], int rx)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<FRQRANGESIZ; i++) {
|
||||
for (i = 0; i < FRQRANGESIZ; i++) {
|
||||
if (range_list[i].start == 0 && range_list[i].end == 0)
|
||||
break;
|
||||
if (range_list[i].start > range_list[i].end)
|
||||
|
@ -514,7 +517,7 @@ int range_sanity_check(const struct freq_range_list range_list[], int rx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* check for:
|
||||
* - steps sorted in ascending order return_code=-1
|
||||
* - modes are not 0 return_code=-2
|
||||
|
@ -533,7 +536,7 @@ int ts_sanity_check(const struct tuning_step_list tuning_step[])
|
|||
for (i=0; i<TSLSTSIZ; i++) {
|
||||
if (RIG_IS_TS_END(tuning_step[i]))
|
||||
break;
|
||||
if (tuning_step[i].ts != RIG_TS_ANY && tuning_step[i].ts < last_ts &&
|
||||
if (tuning_step[i].ts != RIG_TS_ANY && tuning_step[i].ts < last_ts &&
|
||||
last_modes == tuning_step[i].modes)
|
||||
return -1;
|
||||
if (tuning_step[i].modes == 0)
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/*
|
||||
* rigctl_parse.c - (C) Stephane Fillod 2000-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
|
||||
* from command line options.
|
||||
*
|
||||
|
@ -149,6 +150,8 @@ declare_proto_rig(set_powerstat);
|
|||
declare_proto_rig(get_powerstat);
|
||||
declare_proto_rig(send_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 },
|
||||
{ '3', "dump_conf", dump_conf, 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 },
|
||||
|
||||
};
|
||||
|
@ -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",
|
||||
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 a2[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);
|
||||
#endif
|
||||
|
||||
|
||||
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 */
|
||||
else
|
||||
fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
|
||||
} else {
|
||||
// rig_debug(RIG_DEBUG_TRACE, "rigctld: %d %s\n", cmd, cmd_entry->name);
|
||||
|
||||
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");
|
||||
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");
|
||||
else if (opt_block) /* block marker protocol */
|
||||
else if (opt_block && (cmd != 0xf0 && cmd != 0xf1)) /* block marker protocol */
|
||||
fprintf(fout, NETRIGCTL_RET "0\n");
|
||||
}
|
||||
}
|
||||
|
@ -2040,3 +2052,19 @@ declare_proto_rig(send_cmd)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" 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.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
|
@ -117,10 +117,12 @@ Dump capabilities for the radio defined with -m above and exit.
|
|||
.TP
|
||||
.B \-o, --vfo
|
||||
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
|
||||
.B \-b, --block
|
||||
Use the block rigctld protocol. \fIEXPERIMENTAL\fP
|
||||
Use the block rigctld protocol. See \fI\\chk_blk\fP below. \fIEXPERIMENTAL\fP
|
||||
.TP
|
||||
.B \-e, --end-marker
|
||||
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
|
||||
possible bug!).
|
||||
.PP
|
||||
Please note that the backend for the radio to be controlled,
|
||||
or the radio itself may not support some commands. In that case,
|
||||
the operation will fail with a \fBHamlib\fP error message.
|
||||
Please note that the backend for the radio to be controlled, or the radio itself
|
||||
may not support some commands. In that case, the operation will fail with a
|
||||
\fBHamlib\fP error message.
|
||||
.PP
|
||||
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"
|
||||
|
@ -185,7 +187,8 @@ Get 'Mode' 'Passband'. Returns Mode as a string from \fIset_mode\fP above
|
|||
and Passband in Hz.
|
||||
.TP
|
||||
.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
|
||||
.B v, get_vfo
|
||||
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
|
||||
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
|
||||
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
|
||||
.B 2, power2mW
|
||||
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
|
||||
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.
|
||||
.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
|
||||
\fBDefault Protocol\fP
|
||||
.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.
|
||||
.PP
|
||||
The following commands have been tested with the Block protocol and the included
|
||||
`testctld.pl' script:
|
||||
\fBtestctld.pl\fP script:
|
||||
.br
|
||||
\fI\\set_freq\fP \fI\\get-freq\fP
|
||||
.br
|
||||
\fI\\set_mode\fP \fI\\get_mode\fP
|
||||
.br
|
||||
\fI\\set_vfo\fP \fI\\get_vfo\fP
|
||||
.SH EXAMPLES
|
||||
Start \fBrigctld\fP for a Yaesu FT-920 using an USB-to-serial adapter and
|
||||
backgrounding:
|
||||
|
@ -468,13 +488,14 @@ backgrounding:
|
|||
$ rigctld -m 114 -r /dev/ttyUSB1 &
|
||||
.PP
|
||||
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
|
||||
$ 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
|
||||
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
|
||||
$ echo "\\set_freq 14266000" | nc localhost 4532
|
||||
$ echo "\\set_freq 14266000" | nc -w 1 localhost 4532
|
||||
.SH 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,
|
||||
|
@ -498,11 +519,11 @@ Report bugs to <hamlib-developer@lists.sourceforge.net>.
|
|||
.br
|
||||
We are already aware of the bugs in the previous section :-)
|
||||
.SH AUTHORS
|
||||
Written by Stephane Fillod and the Hamlib Group
|
||||
Written by Stephane Fillod, Nate Bargmann, and the Hamlib Group
|
||||
.br
|
||||
<http://www.hamlib.org>.
|
||||
.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
|
||||
This is free software; see the source for copying conditions.
|
||||
There is NO warranty; not even for MERCHANTABILITY
|
||||
|
|
|
@ -108,7 +108,7 @@ int interactive = 1; /* no cmd because of daemon */
|
|||
int prompt = 0; /* Daemon mode for rigparse return string */
|
||||
int opt_end = 0; /* END marker 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 */
|
||||
|
||||
|
@ -278,10 +278,11 @@ int main (int argc, char *argv[])
|
|||
dump_caps_opt++;
|
||||
break;
|
||||
case 'e':
|
||||
opt_end = 1;
|
||||
opt_end++;
|
||||
fprintf(stderr, "-e|--end-marker option is deprecated. Please consider -b|--block instead.\n");
|
||||
break;
|
||||
case 'b':
|
||||
opt_block = 1;
|
||||
opt_block++;
|
||||
break;
|
||||
default:
|
||||
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.
|
||||
*/
|
||||
if (dump_caps_opt) {
|
||||
|
|
Ładowanie…
Reference in New Issue