2000-10-01 12:52:17 +00:00
|
|
|
/*
|
2012-01-06 08:28:24 +00:00
|
|
|
* dumpcaps.c - Copyright (C) 2000-2012 Stephane Fillod
|
2000-10-01 12:52:17 +00:00
|
|
|
* This programs dumps the capabilities of a backend rig.
|
|
|
|
*
|
|
|
|
*
|
2011-08-22 01:51:06 +00:00
|
|
|
* 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.
|
2010-02-04 00:53:56 +00:00
|
|
|
*
|
2011-08-22 01:51:06 +00:00
|
|
|
* 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.
|
2010-02-04 00:53:56 +00:00
|
|
|
*
|
2011-08-22 01:51:06 +00:00
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2010-02-04 00:53:56 +00:00
|
|
|
*
|
2000-10-01 12:52:17 +00:00
|
|
|
*/
|
|
|
|
|
2003-11-16 17:34:00 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2000-10-01 12:52:17 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2000-10-08 21:22:36 +00:00
|
|
|
#include <hamlib/rig.h>
|
2001-04-24 19:56:41 +00:00
|
|
|
#include "misc.h"
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2003-11-16 17:34:00 +00:00
|
|
|
#include "sprintflst.h"
|
2008-05-23 14:26:09 +00:00
|
|
|
#include "rigctl_parse.h"
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2002-09-06 14:07:17 +00:00
|
|
|
static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr);
|
2000-10-01 12:52:17 +00:00
|
|
|
int range_sanity_check(const struct freq_range_list range_list[], int rx);
|
2001-05-08 09:11:32 +00:00
|
|
|
int ts_sanity_check(const struct tuning_step_list tuning_step[]);
|
2008-01-05 18:13:12 +00:00
|
|
|
static void dump_chan_caps(const channel_cap_t *chan, FILE *fout);
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2002-09-06 14:07:17 +00:00
|
|
|
/*
|
|
|
|
* the rig may be in rig_init state, but not openned
|
|
|
|
*/
|
2008-01-05 18:13:12 +00:00
|
|
|
int dumpcaps (RIG* rig, FILE *fout)
|
2010-02-04 00:53:56 +00:00
|
|
|
{
|
2000-10-01 12:52:17 +00:00
|
|
|
const struct rig_caps *caps;
|
2010-02-04 00:53:56 +00:00
|
|
|
int status, i;
|
|
|
|
int can_esplit, can_echannel;
|
2001-04-24 19:56:41 +00:00
|
|
|
char freqbuf[20];
|
2010-02-04 00:53:56 +00:00
|
|
|
int backend_warnings = 0;
|
2003-11-16 17:34:00 +00:00
|
|
|
static char prntbuf[1024]; /* a malloc would be better.. */
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2002-09-06 14:07:17 +00:00
|
|
|
if (!rig || !rig->caps)
|
|
|
|
return -RIG_EINVAL;
|
2001-06-04 21:17:53 +00:00
|
|
|
|
2002-09-06 14:07:17 +00:00
|
|
|
caps = rig->caps;
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
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);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Backend status:\t%s\n", rig_strstatus(caps->status));
|
|
|
|
fprintf(fout, "Rig type:\t");
|
2001-08-08 06:08:33 +00:00
|
|
|
switch (caps->rig_type & RIG_TYPE_MASK) {
|
2000-10-01 12:52:17 +00:00
|
|
|
case RIG_TYPE_TRANSCEIVER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Transceiver\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
|
|
|
case RIG_TYPE_HANDHELD:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Handheld\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
|
|
|
case RIG_TYPE_MOBILE:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Mobile\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
|
|
|
case RIG_TYPE_RECEIVER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Receiver\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
2001-02-11 23:19:58 +00:00
|
|
|
case RIG_TYPE_PCRECEIVER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "PC Receiver\n");
|
2001-02-11 23:19:58 +00:00
|
|
|
break;
|
|
|
|
case RIG_TYPE_SCANNER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Scanner\n");
|
2001-02-11 23:19:58 +00:00
|
|
|
break;
|
2001-06-02 18:11:21 +00:00
|
|
|
case RIG_TYPE_TRUNKSCANNER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Trunking scanner\n");
|
2001-06-02 18:11:21 +00:00
|
|
|
break;
|
2001-02-11 23:19:58 +00:00
|
|
|
case RIG_TYPE_COMPUTER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Computer\n");
|
2001-02-11 23:19:58 +00:00
|
|
|
break;
|
2002-11-28 22:27:11 +00:00
|
|
|
case RIG_TYPE_TUNER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Tuner\n");
|
2002-11-28 22:27:11 +00:00
|
|
|
break;
|
2001-02-14 01:11:22 +00:00
|
|
|
case RIG_TYPE_OTHER:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Other\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "PTT type:\t");
|
2000-10-01 12:52:17 +00:00
|
|
|
switch (caps->ptt_type) {
|
|
|
|
case RIG_PTT_RIG:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Rig capable\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
2011-07-19 22:09:50 +00:00
|
|
|
case RIG_PTT_RIG_MICDATA:
|
|
|
|
fprintf(fout, "Rig capable (Mic/Data)\n");
|
|
|
|
break;
|
2000-10-01 12:52:17 +00:00
|
|
|
case RIG_PTT_PARALLEL:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Parallel port (DATA0)\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
2001-01-28 22:21:00 +00:00
|
|
|
case RIG_PTT_SERIAL_RTS:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Serial port (CTS/RTS)\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
2001-01-28 22:21:00 +00:00
|
|
|
case RIG_PTT_SERIAL_DTR:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Serial port (DTR/DSR)\n");
|
2001-01-28 22:21:00 +00:00
|
|
|
break;
|
2000-10-01 12:52:17 +00:00
|
|
|
case RIG_PTT_NONE:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "None\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "DCD type:\t");
|
2001-02-15 00:01:08 +00:00
|
|
|
switch (caps->dcd_type) {
|
|
|
|
case RIG_DCD_RIG:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Rig capable\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
|
|
|
case RIG_DCD_PARALLEL:
|
2010-04-25 17:30:52 +00:00
|
|
|
fprintf(fout, "Parallel port (/STROBE)\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
|
|
|
case RIG_DCD_SERIAL_CTS:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Serial port (CTS/RTS)\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
|
|
|
case RIG_DCD_SERIAL_DSR:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Serial port (DTR/DSR)\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
2003-08-17 22:39:07 +00:00
|
|
|
case RIG_DCD_SERIAL_CAR:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Serial port (CD)\n");
|
2003-08-17 22:39:07 +00:00
|
|
|
break;
|
2001-02-15 00:01:08 +00:00
|
|
|
case RIG_DCD_NONE:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "None\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2001-02-15 00:01:08 +00:00
|
|
|
}
|
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Port type:\t");
|
2001-02-15 00:01:08 +00:00
|
|
|
switch (caps->port_type) {
|
|
|
|
case RIG_PORT_SERIAL:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "RS-232\n");
|
2010-04-25 17:30:52 +00:00
|
|
|
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':
|
2011-08-22 01:51:06 +00:00
|
|
|
caps->serial_parity == RIG_PARITY_ODD ? 'O' :
|
|
|
|
caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
|
2010-10-26 19:31:09 +00:00
|
|
|
caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
|
2010-04-25 17:30:52 +00:00
|
|
|
caps->serial_stop_bits,
|
|
|
|
caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
|
|
|
|
(caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
|
|
|
|
);
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
2003-08-25 22:36:39 +00:00
|
|
|
case RIG_PORT_PARALLEL:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Parallel\n");
|
2003-08-25 22:36:39 +00:00
|
|
|
break;
|
2001-02-15 00:01:08 +00:00
|
|
|
case RIG_PORT_DEVICE:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Device driver\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
2008-09-21 19:10:59 +00:00
|
|
|
case RIG_PORT_USB:
|
|
|
|
fprintf(fout, "USB\n");
|
|
|
|
break;
|
2001-02-15 00:01:08 +00:00
|
|
|
case RIG_PORT_NETWORK:
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Network link\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
2012-01-06 08:28:24 +00:00
|
|
|
case RIG_PORT_UDP_NETWORK:
|
|
|
|
fprintf(fout, "UDP Network link\n");
|
|
|
|
break;
|
2001-02-15 00:01:08 +00:00
|
|
|
case RIG_PORT_NONE:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "None\n");
|
2001-02-15 00:01:08 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2001-02-15 00:01:08 +00:00
|
|
|
}
|
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Write delay: %dms, timeout %dms, %d retry\n",
|
|
|
|
caps->write_delay, caps->timeout, caps->retry);
|
|
|
|
fprintf(fout, "Post Write delay: %dms\n",
|
2000-10-09 01:17:20 +00:00
|
|
|
caps->post_write_delay);
|
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Has targetable VFO: %s\n",
|
2010-02-04 00:53:56 +00:00
|
|
|
caps->targetable_vfo ? "Y" : "N");
|
2001-01-05 18:22:40 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Has transceive: %s\n",
|
2010-02-04 00:53:56 +00:00
|
|
|
caps->transceive ? "Y" : "N");
|
2001-05-08 16:41:52 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Announce: 0x%x\n", caps->announces);
|
2010-02-04 00:53:56 +00:00
|
|
|
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);
|
2001-02-11 23:19:58 +00:00
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
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);
|
2001-05-08 09:11:32 +00:00
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
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);
|
2001-03-02 18:43:25 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Preamp:");
|
2010-02-04 00:53:56 +00:00
|
|
|
for(i = 0; i < MAXDBLSTSIZ && caps->preamp[i] != 0; i++)
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, " %ddB", caps->preamp[i]);
|
2001-02-15 00:01:08 +00:00
|
|
|
if (i == 0)
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, " None");
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n");
|
|
|
|
fprintf(fout, "Attenuator:");
|
2010-02-04 00:53:56 +00:00
|
|
|
for(i = 0; i < MAXDBLSTSIZ && caps->attenuator[i] != 0; i++)
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, " %ddB",caps->attenuator[i]);
|
2001-02-15 00:01:08 +00:00
|
|
|
if (i == 0)
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, " None");
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n");
|
2001-02-11 23:19:58 +00:00
|
|
|
|
2008-12-14 19:01:16 +00:00
|
|
|
fprintf(fout, "CTCSS:");
|
2010-02-04 00:53:56 +00:00
|
|
|
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);
|
2008-12-14 19:01:16 +00:00
|
|
|
}
|
|
|
|
if (i == 0)
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, " None");
|
2008-12-14 19:01:16 +00:00
|
|
|
else
|
|
|
|
fprintf(fout, " Hz, %d tones", i);
|
|
|
|
fprintf(fout, "\n");
|
|
|
|
|
|
|
|
fprintf(fout, "DCS:");
|
2010-02-04 00:53:56 +00:00
|
|
|
for(i = 0; caps->dcs_list && i < 128 && caps->dcs_list[i] != 0; i++) {
|
|
|
|
fprintf(fout, " %d", caps->dcs_list[i]);
|
2008-12-14 19:01:16 +00:00
|
|
|
}
|
|
|
|
if (i == 0)
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, " None");
|
2008-12-14 19:01:16 +00:00
|
|
|
else
|
|
|
|
fprintf(fout, ", %d codes", i);
|
|
|
|
fprintf(fout, "\n");
|
|
|
|
|
2002-01-27 23:54:58 +00:00
|
|
|
sprintf_func(prntbuf, caps->has_get_func);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Get functions: %s\n", prntbuf);
|
2002-01-27 23:54:58 +00:00
|
|
|
|
|
|
|
sprintf_func(prntbuf, caps->has_set_func);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Set functions: %s\n", prntbuf);
|
2002-01-27 23:54:58 +00:00
|
|
|
|
2003-11-16 17:34:00 +00:00
|
|
|
sprintf_level_gran(prntbuf, caps->has_get_level, caps->level_gran);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Get level: %s\n", prntbuf);
|
2002-01-27 23:54:58 +00:00
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
if ((caps->has_get_level & RIG_LEVEL_SQLSTAT)) {
|
|
|
|
fprintf(fout, "Warning--backend uses deprecated SQLSTAT level!\n");
|
2004-09-26 08:35:05 +00:00
|
|
|
backend_warnings++;
|
|
|
|
}
|
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
if ((caps->has_get_level & RIG_LEVEL_RAWSTR) &&
|
2011-06-01 07:19:55 +00:00
|
|
|
caps->str_cal.size == 0 &&
|
|
|
|
!(caps->has_get_level & RIG_LEVEL_STRENGTH)) {
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Warning--backend has get RAWSTR, but not calibration data\n");
|
2004-09-26 08:35:05 +00:00
|
|
|
backend_warnings++;
|
|
|
|
}
|
|
|
|
|
2003-11-16 17:34:00 +00:00
|
|
|
sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Set level: %s\n", prntbuf);
|
2010-02-04 00:53:56 +00:00
|
|
|
|
|
|
|
if (caps->has_set_level & RIG_LEVEL_READONLY_LIST) {
|
|
|
|
fprintf(fout, "Warning--backend can set readonly levels!\n");
|
2002-01-27 23:54:58 +00:00
|
|
|
backend_warnings++;
|
|
|
|
}
|
2010-02-04 00:53:56 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Extra levels:");
|
2009-01-28 22:49:58 +00:00
|
|
|
rig_ext_level_foreach(rig, print_ext, fout);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n");
|
2002-01-27 23:54:58 +00:00
|
|
|
|
2003-11-16 17:34:00 +00:00
|
|
|
sprintf_parm_gran(prntbuf, caps->has_get_parm, caps->parm_gran);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Get parameters: %s\n", prntbuf);
|
2001-01-28 22:21:00 +00:00
|
|
|
|
2003-11-16 17:34:00 +00:00
|
|
|
sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Set parameters: %s\n", prntbuf);
|
2010-02-04 00:53:56 +00:00
|
|
|
if (caps->has_set_parm & RIG_PARM_READONLY_LIST) {
|
|
|
|
fprintf(fout, "Warning--backend can set readonly parms!\n");
|
2002-01-27 23:54:58 +00:00
|
|
|
backend_warnings++;
|
|
|
|
}
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Extra parameters:");
|
|
|
|
rig_ext_parm_foreach(rig, print_ext, fout);
|
|
|
|
fprintf(fout, "\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
|
2001-01-28 22:21:00 +00:00
|
|
|
|
2010-04-13 18:36:29 +00:00
|
|
|
if (rig->state.mode_list != 0)
|
|
|
|
sprintf_mode(prntbuf, rig->state.mode_list);
|
|
|
|
else {
|
|
|
|
strcpy(prntbuf,"None. This backend might be bogus!\n");
|
|
|
|
backend_warnings++;
|
|
|
|
}
|
|
|
|
fprintf(fout, "Mode list: %s\n", prntbuf);
|
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
if (rig->state.vfo_list != 0)
|
2003-12-04 23:18:49 +00:00
|
|
|
sprintf_vfo(prntbuf, rig->state.vfo_list);
|
2010-04-13 18:36:29 +00:00
|
|
|
else {
|
2010-02-04 00:53:56 +00:00
|
|
|
strcpy(prntbuf,"None. This backend might be bogus!\n");
|
2010-04-13 18:36:29 +00:00
|
|
|
backend_warnings++;
|
|
|
|
}
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "VFO list: %s\n", prntbuf);
|
2003-12-04 23:18:49 +00:00
|
|
|
|
|
|
|
sprintf_vfop(prntbuf, caps->vfo_ops);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "VFO Ops: %s\n", prntbuf);
|
2003-12-04 23:18:49 +00:00
|
|
|
|
|
|
|
sprintf_scan(prntbuf, caps->scan_ops);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Scan Ops: %s\n", prntbuf);
|
2003-12-04 23:18:49 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Number of banks:\t%d\n", caps->bank_qty);
|
|
|
|
fprintf(fout, "Memory name desc size:\t%d\n", caps->chan_desc_sz);
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Memories:");
|
2010-02-04 00:53:56 +00:00
|
|
|
for (i = 0; i < CHANLSTSIZ && caps->chan_list[i].type; i++) {
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n\t%d..%d: \t%s", caps->chan_list[i].start,
|
2002-11-04 22:28:46 +00:00
|
|
|
caps->chan_list[i].end,
|
2008-04-27 09:56:06 +00:00
|
|
|
rig_strmtype(caps->chan_list[i].type));
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "\n\t Mem caps: ");
|
2008-01-05 18:13:12 +00:00
|
|
|
dump_chan_caps(&caps->chan_list[i].mem_caps, fout);
|
2001-05-08 16:41:52 +00:00
|
|
|
}
|
|
|
|
if (i == 0)
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, " None");
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n");
|
2001-05-08 16:41:52 +00:00
|
|
|
|
2000-10-01 12:52:17 +00:00
|
|
|
/* TODO: print rx/tx ranges here */
|
2010-02-04 00:53:56 +00:00
|
|
|
status = range_sanity_check(caps->tx_range_list1, 0);
|
|
|
|
fprintf(fout, "TX ranges status, region 1:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
2001-05-08 09:11:32 +00:00
|
|
|
if (status) backend_warnings++;
|
2010-02-04 00:53:56 +00:00
|
|
|
status = range_sanity_check(caps->rx_range_list1, 1);
|
|
|
|
fprintf(fout, "RX ranges status, region 1:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
2001-05-08 09:11:32 +00:00
|
|
|
if (status) backend_warnings++;
|
2001-02-11 23:19:58 +00:00
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
status = range_sanity_check(caps->tx_range_list2, 0);
|
|
|
|
fprintf(fout, "TX ranges status, region 2:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
2001-05-08 09:11:32 +00:00
|
|
|
if (status) backend_warnings++;
|
2010-02-04 00:53:56 +00:00
|
|
|
status = range_sanity_check(caps->rx_range_list2, 1);
|
|
|
|
fprintf(fout, "RX ranges status, region 2:\t%s (%d)\n", status ? "Bad" : "OK", status);
|
2001-05-08 09:11:32 +00:00
|
|
|
if (status) backend_warnings++;
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Tuning steps:");
|
2010-02-04 00:53:56 +00:00
|
|
|
for (i = 0; i < TSLSTSIZ && !RIG_IS_TS_END(caps->tuning_steps[i]); i++) {
|
2003-02-23 22:41:03 +00:00
|
|
|
if (caps->tuning_steps[i].ts == RIG_TS_ANY)
|
2010-02-04 00:53:56 +00:00
|
|
|
strcpy(freqbuf, "ANY"); /* strcpy! Looks safe for now */
|
2003-02-23 22:41:03 +00:00
|
|
|
else
|
2010-02-04 00:53:56 +00:00
|
|
|
sprintf_freq(freqbuf, caps->tuning_steps[i].ts);
|
|
|
|
|
|
|
|
sprintf_mode(prntbuf, caps->tuning_steps[i].modes);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
2010-02-04 00:53:56 +00:00
|
|
|
if (i == 0) {
|
|
|
|
fprintf(fout, " None! This backend might be bogus!");
|
|
|
|
backend_warnings++;
|
2001-05-08 09:11:32 +00:00
|
|
|
}
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
status = ts_sanity_check(caps->tuning_steps);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Tuning steps status:\t%s (%d)\n",status?"Bad":"OK",status);
|
2001-05-08 09:11:32 +00:00
|
|
|
if (status) backend_warnings++;
|
2001-02-15 00:01:08 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "Filters:");
|
2003-02-23 22:41:03 +00:00
|
|
|
for (i=0; i<FLTLSTSIZ && !RIG_IS_FLT_END(caps->filters[i]); i++) {
|
|
|
|
if (caps->filters[i].width == RIG_FLT_ANY)
|
|
|
|
strcpy(freqbuf, "ANY");
|
|
|
|
else
|
2002-01-27 23:54:58 +00:00
|
|
|
sprintf_freq(freqbuf,caps->filters[i].width);
|
2003-02-23 22:41:03 +00:00
|
|
|
sprintf_mode(prntbuf,caps->filters[i].modes);
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
|
2001-02-15 00:01:08 +00:00
|
|
|
}
|
2010-02-04 00:53:56 +00:00
|
|
|
if (i == 0) {
|
|
|
|
fprintf(fout, " None. This backend might be bogus!");
|
|
|
|
backend_warnings++;
|
2001-05-08 09:11:32 +00:00
|
|
|
}
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Bandwidths:");
|
|
|
|
for (i = 1; i < RIG_MODE_TESTS_MAX; i <<= 1) {
|
2002-09-06 14:07:17 +00:00
|
|
|
pbwidth_t pbnorm = rig_passband_normal(rig, i);
|
|
|
|
|
|
|
|
if (pbnorm == 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
sprintf_freq(freqbuf, pbnorm);
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "\n\t%s\tNormal: %s,\t", rig_strrmode(i), freqbuf);
|
2002-09-06 14:07:17 +00:00
|
|
|
|
|
|
|
sprintf_freq(freqbuf, rig_passband_narrow(rig, i));
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Narrow: %s,\t", freqbuf);
|
2002-09-06 14:07:17 +00:00
|
|
|
|
|
|
|
sprintf_freq(freqbuf, rig_passband_wide(rig, i));
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Wide: %s", freqbuf);
|
2002-09-06 14:07:17 +00:00
|
|
|
}
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\n");
|
2002-09-06 14:07:17 +00:00
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf(fout, "Has priv data:\t%c\n", caps->priv != NULL ? 'Y' : 'N');
|
2001-02-15 00:01:08 +00:00
|
|
|
/*
|
2005-04-03 18:36:36 +00:00
|
|
|
* Status is either 'Y'es, 'E'mulated, 'N'o
|
|
|
|
*
|
2001-02-15 00:01:08 +00:00
|
|
|
* TODO: keep me up-to-date with API call list!
|
|
|
|
*/
|
2010-02-06 15:05:17 +00:00
|
|
|
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');
|
2010-02-04 00:53:56 +00:00
|
|
|
|
2011-06-01 07:19:55 +00:00
|
|
|
can_esplit = caps->set_split_vfo && (caps->set_vfo ||
|
|
|
|
(rig_has_vfo_op(rig, RIG_OP_TOGGLE) && caps->vfo_op));
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can set Split Freq:\t%c\n", caps->set_split_freq != NULL ? 'Y' :
|
2010-02-04 00:53:56 +00:00
|
|
|
(can_esplit && caps->set_freq ? 'E' : 'N'));
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can get Split Freq:\t%c\n", caps->get_split_freq != NULL ? 'Y' :
|
2010-02-04 00:53:56 +00:00
|
|
|
(can_esplit && caps->get_freq ? 'E' : 'N'));
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can set Split Mode:\t%c\n", caps->set_split_mode != NULL ? 'Y' :
|
2010-02-04 00:53:56 +00:00
|
|
|
(can_esplit && caps->set_mode ? 'E' : 'N'));
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can get Split Mode:\t%c\n", caps->get_split_mode != NULL ? 'Y' :
|
2010-02-04 00:53:56 +00:00
|
|
|
(can_esplit && caps->get_mode ? 'E' : 'N'));
|
|
|
|
|
2010-02-06 15:05:17 +00:00
|
|
|
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');
|
2010-02-04 00:53:56 +00:00
|
|
|
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');
|
2010-02-06 15:05:17 +00:00
|
|
|
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');
|
2011-08-22 01:51:06 +00:00
|
|
|
fprintf(fout, "Can set Transceive:\t%c\n", caps->set_trn != NULL ? 'Y' :
|
2011-06-01 07:19:55 +00:00
|
|
|
caps->transceive == RIG_TRN_RIG ? 'E' : 'N');
|
2010-02-06 15:05:17 +00:00
|
|
|
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');
|
2010-03-03 08:33:27 +00:00
|
|
|
fprintf(fout, "Can send DTMF:\t%c\n", caps->send_dtmf != NULL ? 'Y': 'N');
|
2010-02-04 00:53:56 +00:00
|
|
|
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');
|
2010-02-06 15:05:17 +00:00
|
|
|
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');
|
2005-04-03 18:36:36 +00:00
|
|
|
|
2011-06-01 07:19:55 +00:00
|
|
|
can_echannel = caps->set_mem && (
|
|
|
|
(caps->set_vfo && ((rig->state.vfo_list & RIG_VFO_MEM) == RIG_VFO_MEM)) ||
|
|
|
|
(caps->vfo_op && rig_has_vfo_op(rig, RIG_OP_TO_VFO|RIG_OP_FROM_VFO)));
|
|
|
|
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can set Channel:\t%c\n", caps->set_channel != NULL ? 'Y' :
|
2010-02-04 00:53:56 +00:00
|
|
|
(can_echannel ? 'E' : 'N'));
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can get Channel:\t%c\n", caps->get_channel != NULL ? 'Y' :
|
2010-02-04 00:53:56 +00:00
|
|
|
(can_echannel ? 'E' : 'N'));
|
|
|
|
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can ctl Mem/VFO:\t%c\n", caps->vfo_op != NULL ? 'Y' : 'N');
|
2010-03-03 08:33:27 +00:00
|
|
|
fprintf(fout, "Can Scan:\t%c\n", caps->scan != NULL ? 'Y' : 'N');
|
2010-02-06 15:05:17 +00:00
|
|
|
fprintf(fout, "Can get Info:\t%c\n", caps->get_info != NULL ? 'Y' : 'N');
|
|
|
|
fprintf(fout, "Can get power2mW:\t%c\n", caps->power2mW != NULL ? 'Y' : 'N');
|
|
|
|
fprintf(fout, "Can get mW2power:\t%c\n", caps->mW2power != NULL ? 'Y' : 'N');
|
2005-04-03 18:36:36 +00:00
|
|
|
|
2000-10-10 22:13:26 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
fprintf(fout, "\nOverall backend warnings: %d\n", backend_warnings);
|
2001-05-08 09:11:32 +00:00
|
|
|
|
|
|
|
return backend_warnings;
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-09-06 14:07:17 +00:00
|
|
|
static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr)
|
|
|
|
{
|
2010-02-04 00:53:56 +00:00
|
|
|
fprintf((FILE *)ptr, " %s", cfp->name);
|
2002-09-06 14:07:17 +00:00
|
|
|
|
|
|
|
return 1; /* process them all */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
/*
|
2000-10-01 12:52:17 +00:00
|
|
|
* check for:
|
2010-02-04 00:53:56 +00:00
|
|
|
* - 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
|
2000-10-01 12:52:17 +00:00
|
|
|
* ->fprintf(stderr,)!
|
2001-02-11 23:19:58 +00:00
|
|
|
*
|
|
|
|
* TODO: array is sorted in ascending freq order
|
2000-10-01 12:52:17 +00:00
|
|
|
*/
|
|
|
|
int range_sanity_check(const struct freq_range_list range_list[], int rx)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
for (i = 0; i < FRQRANGESIZ; i++) {
|
2000-10-01 12:52:17 +00:00
|
|
|
if (range_list[i].start == 0 && range_list[i].end == 0)
|
|
|
|
break;
|
|
|
|
if (range_list[i].start > range_list[i].end)
|
|
|
|
return -1;
|
|
|
|
if (range_list[i].modes == 0)
|
|
|
|
return -2;
|
|
|
|
if (rx) {
|
|
|
|
if (range_list[i].low_power > 0 && range_list[i].high_power > 0)
|
|
|
|
return -3;
|
|
|
|
} else {
|
|
|
|
if (!(range_list[i].low_power > 0 && range_list[i].high_power > 0))
|
|
|
|
return -3;
|
|
|
|
if (range_list[i].low_power > range_list[i].high_power)
|
|
|
|
return -3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i == FRQRANGESIZ)
|
|
|
|
return -4;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-02-04 00:53:56 +00:00
|
|
|
/*
|
2001-05-08 09:11:32 +00:00
|
|
|
* check for:
|
|
|
|
* - steps sorted in ascending order return_code=-1
|
|
|
|
* - modes are not 0 return_code=-2
|
|
|
|
* - array is ended by a {0,0,0,0,0} element (before boundary) rc=-4
|
|
|
|
*
|
|
|
|
* TODO: array is sorted in ascending freq order
|
|
|
|
*/
|
|
|
|
int ts_sanity_check(const struct tuning_step_list tuning_step[])
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
shortfreq_t last_ts;
|
2001-05-08 16:41:52 +00:00
|
|
|
rmode_t last_modes;
|
2001-05-08 09:11:32 +00:00
|
|
|
|
|
|
|
last_ts = 0;
|
2001-05-08 16:41:52 +00:00
|
|
|
last_modes = RIG_MODE_NONE;
|
2001-05-08 09:11:32 +00:00
|
|
|
for (i=0; i<TSLSTSIZ; i++) {
|
2003-02-23 22:41:03 +00:00
|
|
|
if (RIG_IS_TS_END(tuning_step[i]))
|
2001-05-08 09:11:32 +00:00
|
|
|
break;
|
2010-02-04 00:53:56 +00:00
|
|
|
if (tuning_step[i].ts != RIG_TS_ANY && tuning_step[i].ts < last_ts &&
|
2001-05-08 16:41:52 +00:00
|
|
|
last_modes == tuning_step[i].modes)
|
2001-05-08 09:11:32 +00:00
|
|
|
return -1;
|
|
|
|
if (tuning_step[i].modes == 0)
|
|
|
|
return -2;
|
|
|
|
last_ts = tuning_step[i].ts;
|
2001-05-08 16:41:52 +00:00
|
|
|
last_modes = tuning_step[i].modes;
|
2001-05-08 09:11:32 +00:00
|
|
|
}
|
|
|
|
if (i == TSLSTSIZ)
|
|
|
|
return -4;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2008-01-05 18:13:12 +00:00
|
|
|
static void dump_chan_caps(const channel_cap_t *chan, FILE *fout)
|
2002-11-04 22:28:46 +00:00
|
|
|
{
|
2008-01-05 18:13:12 +00:00
|
|
|
if (chan->bank_num) fprintf(fout, "BANK ");
|
|
|
|
if (chan->ant) fprintf(fout, "ANT ");
|
|
|
|
if (chan->freq) fprintf(fout, "FREQ ");
|
|
|
|
if (chan->mode) fprintf(fout, "MODE ");
|
|
|
|
if (chan->width) fprintf(fout, "WIDTH ");
|
|
|
|
if (chan->tx_freq) fprintf(fout, "TXFREQ ");
|
|
|
|
if (chan->tx_mode) fprintf(fout, "TXMODE ");
|
|
|
|
if (chan->tx_width) fprintf(fout, "TXWIDTH ");
|
|
|
|
if (chan->split) fprintf(fout, "SPLIT ");
|
|
|
|
if (chan->rptr_shift) fprintf(fout, "RPTRSHIFT ");
|
|
|
|
if (chan->rptr_offs) fprintf(fout, "RPTROFS ");
|
|
|
|
if (chan->tuning_step) fprintf(fout, "TS ");
|
|
|
|
if (chan->rit) fprintf(fout, "RIT ");
|
|
|
|
if (chan->xit) fprintf(fout, "XIT ");
|
2008-04-27 09:56:06 +00:00
|
|
|
if (chan->funcs) fprintf(fout, "FUNC "); /* TODO: iterate over the list */
|
|
|
|
if (chan->levels) fprintf(fout, "LEVEL "); /* TODO: iterate over the list */
|
2008-01-05 18:13:12 +00:00
|
|
|
if (chan->ctcss_tone) fprintf(fout, "TONE ");
|
|
|
|
if (chan->ctcss_sql) fprintf(fout, "CTCSS ");
|
|
|
|
if (chan->dcs_code) fprintf(fout, "DCSCODE ");
|
|
|
|
if (chan->dcs_sql) fprintf(fout, "DCSSQL ");
|
|
|
|
if (chan->scan_group) fprintf(fout, "SCANGRP ");
|
2008-04-27 09:56:06 +00:00
|
|
|
if (chan->flags) fprintf(fout, "FLAG "); /* TODO: iterate over the RIG_CHFLAG's */
|
2008-01-05 18:13:12 +00:00
|
|
|
if (chan->channel_desc) fprintf(fout, "NAME ");
|
|
|
|
if (chan->ext_levels) fprintf(fout, "EXTLVL ");
|
2002-11-04 22:28:46 +00:00
|
|
|
}
|
|
|
|
|
2008-05-23 14:26:09 +00:00
|
|
|
int dumpconf (RIG* rig, FILE *fout)
|
|
|
|
{
|
|
|
|
rig_token_foreach(rig, print_conf_list, (rig_ptr_t)rig);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|