2000-10-01 12:52:17 +00:00
|
|
|
/*
|
2001-05-08 09:11:32 +00:00
|
|
|
* dumpcaps.c - Copyright (C) 2000,2001 Stephane Fillod
|
2000-10-01 12:52:17 +00:00
|
|
|
* This programs dumps the capabilities of a backend rig.
|
|
|
|
*
|
|
|
|
*
|
2001-09-20 21:21:14 +00:00
|
|
|
* $Id: dumpcaps.c,v 1.29 2001-09-20 21:21:14 f4cfe Exp $
|
2000-10-01 12:52:17 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
|
static char *decode_modes(rmode_t modes);
|
2001-05-08 16:41:52 +00:00
|
|
|
static const char *decode_mtype(enum chan_type_e type);
|
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[]);
|
2000-10-01 12:52:17 +00:00
|
|
|
|
|
|
|
int main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
const struct rig_caps *caps;
|
|
|
|
int status,i;
|
2001-04-24 19:56:41 +00:00
|
|
|
char freqbuf[20];
|
2001-05-08 09:11:32 +00:00
|
|
|
int backend_warnings=0;
|
2001-06-04 21:17:53 +00:00
|
|
|
int rig_model;
|
2000-10-01 12:52:17 +00:00
|
|
|
|
|
|
|
if (argc != 2) {
|
|
|
|
fprintf(stderr,"%s <rig_num>\n",argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2001-06-04 21:17:53 +00:00
|
|
|
rig_model = atoi(argv[1]);
|
|
|
|
|
|
|
|
rig_check_backend(rig_model);
|
|
|
|
|
|
|
|
caps = rig_get_caps(rig_model);
|
2000-10-01 12:52:17 +00:00
|
|
|
if (!caps) {
|
2001-06-04 21:17:53 +00:00
|
|
|
fprintf(stderr,"Unknown rig num: %d\n", rig_model);
|
2000-10-01 12:52:17 +00:00
|
|
|
fprintf(stderr,"Please check riglist.h\n");
|
|
|
|
exit(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("Rig dump for model %d\n",caps->rig_model);
|
|
|
|
printf("Model name:\t%s\n",caps->model_name);
|
|
|
|
printf("Mfg name:\t%s\n",caps->mfg_name);
|
|
|
|
printf("Backend version:\t%s\n",caps->version);
|
2001-05-08 16:41:52 +00:00
|
|
|
printf("Backend copyright:\t%s\n",caps->copyright);
|
2000-10-01 12:52:17 +00:00
|
|
|
printf("Backend status:\t");
|
|
|
|
switch (caps->status) {
|
|
|
|
case RIG_STATUS_ALPHA:
|
|
|
|
printf("Alpha\n");
|
|
|
|
break;
|
|
|
|
case RIG_STATUS_UNTESTED:
|
|
|
|
printf("Untested\n");
|
|
|
|
break;
|
|
|
|
case RIG_STATUS_BETA:
|
|
|
|
printf("Beta\n");
|
|
|
|
break;
|
|
|
|
case RIG_STATUS_STABLE:
|
|
|
|
printf("Stable\n");
|
|
|
|
break;
|
2000-10-08 21:22:36 +00:00
|
|
|
case RIG_STATUS_BUGGY:
|
|
|
|
printf("Buggy\n");
|
|
|
|
break;
|
2000-10-01 12:52:17 +00:00
|
|
|
case RIG_STATUS_NEW:
|
|
|
|
printf("New\n");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
|
|
|
printf("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:
|
|
|
|
printf("Transceiver\n");
|
|
|
|
break;
|
|
|
|
case RIG_TYPE_HANDHELD:
|
|
|
|
printf("Handheld\n");
|
|
|
|
break;
|
|
|
|
case RIG_TYPE_MOBILE:
|
|
|
|
printf("Mobile\n");
|
|
|
|
break;
|
|
|
|
case RIG_TYPE_RECEIVER:
|
|
|
|
printf("Receiver\n");
|
|
|
|
break;
|
2001-02-11 23:19:58 +00:00
|
|
|
case RIG_TYPE_PCRECEIVER:
|
|
|
|
printf("PC Receiver\n");
|
|
|
|
break;
|
|
|
|
case RIG_TYPE_SCANNER:
|
|
|
|
printf("Scanner\n");
|
|
|
|
break;
|
2001-06-02 18:11:21 +00:00
|
|
|
case RIG_TYPE_TRUNKSCANNER:
|
|
|
|
printf("Trunking scanner\n");
|
|
|
|
break;
|
2001-02-11 23:19:58 +00:00
|
|
|
case RIG_TYPE_COMPUTER:
|
|
|
|
printf("Computer\n");
|
|
|
|
break;
|
2001-02-14 01:11:22 +00:00
|
|
|
case RIG_TYPE_OTHER:
|
|
|
|
printf("Other\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
printf("PTT type:\t");
|
|
|
|
switch (caps->ptt_type) {
|
|
|
|
case RIG_PTT_RIG:
|
|
|
|
printf("rig capable\n");
|
|
|
|
break;
|
|
|
|
case RIG_PTT_PARALLEL:
|
|
|
|
printf("thru parallel port (DATA0)\n");
|
|
|
|
break;
|
2001-01-28 22:21:00 +00:00
|
|
|
case RIG_PTT_SERIAL_RTS:
|
2000-10-01 12:52:17 +00:00
|
|
|
printf("thru serial port (CTS/RTS)\n");
|
|
|
|
break;
|
2001-01-28 22:21:00 +00:00
|
|
|
case RIG_PTT_SERIAL_DTR:
|
|
|
|
printf("thru serial port (DTR/DSR)\n");
|
|
|
|
break;
|
2000-10-01 12:52:17 +00:00
|
|
|
case RIG_PTT_NONE:
|
|
|
|
printf("None\n");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
|
|
|
|
2001-02-15 00:01:08 +00:00
|
|
|
printf("DCD type:\t");
|
|
|
|
switch (caps->dcd_type) {
|
|
|
|
case RIG_DCD_RIG:
|
|
|
|
printf("rig capable\n");
|
|
|
|
break;
|
|
|
|
case RIG_DCD_PARALLEL:
|
|
|
|
printf("thru parallel port (DATA1? STROBE?)\n");
|
|
|
|
break;
|
|
|
|
case RIG_DCD_SERIAL_CTS:
|
|
|
|
printf("thru serial port (CTS/RTS)\n");
|
|
|
|
break;
|
|
|
|
case RIG_DCD_SERIAL_DSR:
|
|
|
|
printf("thru serial port (DTR/DSR)\n");
|
|
|
|
break;
|
|
|
|
case RIG_DCD_NONE:
|
|
|
|
printf("None\n");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2001-02-15 00:01:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
printf("Port type:\t");
|
|
|
|
switch (caps->port_type) {
|
|
|
|
case RIG_PORT_SERIAL:
|
|
|
|
printf("RS-232\n");
|
|
|
|
break;
|
|
|
|
case RIG_PORT_DEVICE:
|
|
|
|
printf("device driver\n");
|
|
|
|
break;
|
|
|
|
case RIG_PORT_NETWORK:
|
|
|
|
printf("network link\n");
|
|
|
|
break;
|
|
|
|
case RIG_PORT_NONE:
|
|
|
|
printf("None\n");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("Unknown\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
2001-02-15 00:01:08 +00:00
|
|
|
}
|
|
|
|
|
2000-11-01 23:27:26 +00:00
|
|
|
printf("Serial speed: %d..%d bauds, %d%c%d %s\n", caps->serial_rate_min,
|
2000-10-01 12:52:17 +00:00
|
|
|
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")
|
|
|
|
);
|
|
|
|
|
|
|
|
printf("Write delay %dms, timeout %dms, %d retry\n",
|
|
|
|
caps->write_delay,caps->timeout,caps->retry);
|
2001-01-05 18:22:40 +00:00
|
|
|
printf("Post Write delay %dms\n",
|
2000-10-09 01:17:20 +00:00
|
|
|
caps->post_write_delay);
|
|
|
|
|
2001-01-05 18:22:40 +00:00
|
|
|
printf("Has targetable VFO: %s\n",
|
|
|
|
caps->targetable_vfo?"yes":"no");
|
|
|
|
|
2001-05-08 16:41:52 +00:00
|
|
|
printf("Has transceive: %s\n",
|
|
|
|
caps->transceive?"yes":"no");
|
|
|
|
|
|
|
|
printf("Announce: 0x%lx\n", caps->announces);
|
2001-02-15 00:01:08 +00:00
|
|
|
printf("Max RIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
2001-02-11 23:19:58 +00:00
|
|
|
caps->max_rit/1000, caps->max_rit%1000,
|
|
|
|
caps->max_rit/1000, caps->max_rit%1000);
|
|
|
|
|
2001-05-08 09:11:32 +00:00
|
|
|
printf("Max XIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
|
|
|
|
caps->max_xit/1000, caps->max_xit%1000,
|
|
|
|
caps->max_xit/1000, caps->max_xit%1000);
|
|
|
|
|
2001-03-02 18:43:25 +00:00
|
|
|
printf("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-02-11 23:19:58 +00:00
|
|
|
printf("Preamp:");
|
|
|
|
for(i=0; i<MAXDBLSTSIZ && caps->preamp[i] != 0; i++)
|
|
|
|
printf(" %ddB", caps->preamp[i]);
|
2001-02-15 00:01:08 +00:00
|
|
|
if (i == 0)
|
2001-02-14 01:11:22 +00:00
|
|
|
printf(" none");
|
2001-02-11 23:19:58 +00:00
|
|
|
printf("\n");
|
|
|
|
printf("Attenuator:");
|
|
|
|
for(i=0; i<MAXDBLSTSIZ && caps->attenuator[i] != 0; i++)
|
|
|
|
printf(" %ddB",caps->attenuator[i]);
|
2001-02-15 00:01:08 +00:00
|
|
|
if (i == 0)
|
2001-02-14 01:11:22 +00:00
|
|
|
printf(" none");
|
2001-02-11 23:19:58 +00:00
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
printf("Get functions: ");
|
|
|
|
if (caps->has_get_func!=0) {
|
|
|
|
if (caps->has_get_func&RIG_FUNC_FAGC) printf("FAGC ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_NB) printf("NB ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_COMP) printf("COMP ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_VOX) printf("VOX ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_TONE) printf("TONE ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_TSQL) printf("TSQL ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_SBKIN) printf("SBKIN ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_FBKIN) printf("FBKIN ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_ANF) printf("ANF ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_NR) printf("NR ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_AIP) printf("AIP ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_APF) printf("APF ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_MON) printf("MON ");
|
|
|
|
if (caps->has_get_func&RIG_FUNC_MN) printf("MN ");
|
2001-03-01 21:23:32 +00:00
|
|
|
if (caps->has_get_func&RIG_FUNC_RNF) printf("RNF ");
|
2001-02-11 23:19:58 +00:00
|
|
|
printf("\n");
|
|
|
|
} else
|
|
|
|
printf("none\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2001-02-11 23:19:58 +00:00
|
|
|
printf("Set functions: ");
|
|
|
|
if (caps->has_set_func!=0) {
|
|
|
|
if (caps->has_set_func&RIG_FUNC_FAGC) printf("FAGC ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_NB) printf("NB ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_COMP) printf("COMP ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_VOX) printf("VOX ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_TONE) printf("TONE ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_TSQL) printf("TSQL ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_SBKIN) printf("SBKIN ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_FBKIN) printf("FBKIN ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_ANF) printf("ANF ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_NR) printf("NR ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_AIP) printf("AIP ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_APF) printf("APF ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_MON) printf("MON ");
|
|
|
|
if (caps->has_set_func&RIG_FUNC_MN) printf("MN ");
|
2001-03-01 21:23:32 +00:00
|
|
|
if (caps->has_set_func&RIG_FUNC_RNF) printf("RNF ");
|
2001-01-28 22:21:00 +00:00
|
|
|
printf("\n");
|
|
|
|
} else
|
|
|
|
printf("none\n");
|
|
|
|
|
|
|
|
printf("Get level: ");
|
2001-02-11 23:19:58 +00:00
|
|
|
if (caps->has_get_level!=0) {
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_PREAMP) printf("PREAMP ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_ATT) printf("ATT ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_AF) printf("AF ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_RF) printf("RF ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_SQL) printf("SQL ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_IF) printf("IF ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_APF) printf("APF ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_NR) printf("NR ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_PBT_IN) printf("PBT_IN ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_PBT_OUT) printf("PBT_OUT ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_CWPITCH) printf("CWPITCH ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_RFPOWER) printf("RFPOWER ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_MICGAIN) printf("MICGAIN ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_KEYSPD) printf("KEYSPD ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_NOTCHF) printf("NOTCHF ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_COMP) printf("COMP ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_AGC) printf("AGC ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_BKINDL) printf("BKINDL ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_BALANCE) printf("BALANCE ");
|
2001-05-08 09:11:32 +00:00
|
|
|
|
2001-02-11 23:19:58 +00:00
|
|
|
if (caps->has_get_level&RIG_LEVEL_SWR) printf("SWR ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_ALC) printf("ALC ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_SQLSTAT) printf("SQLSTAT ");
|
|
|
|
if (caps->has_get_level&RIG_LEVEL_STRENGTH) printf("STRENGTH ");
|
2000-10-01 12:52:17 +00:00
|
|
|
printf("\n");
|
|
|
|
} else
|
|
|
|
printf("none\n");
|
|
|
|
|
2001-01-28 22:21:00 +00:00
|
|
|
printf("Set level: ");
|
|
|
|
if (caps->has_set_level!=0) {
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_PREAMP) printf("PREAMP ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_ATT) printf("ATT ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_AF) printf("AF ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_RF) printf("RF ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_SQL) printf("SQL ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_IF) printf("IF ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_APF) printf("APF ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_NR) printf("NR ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_PBT_IN) printf("PBT_IN ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_PBT_OUT) printf("PBT_OUT ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_CWPITCH) printf("CWPITCH ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_RFPOWER) printf("RFPOWER ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_MICGAIN) printf("MICGAIN ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_KEYSPD) printf("KEYSPD ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_NOTCHF) printf("NOTCHF ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_COMP) printf("COMP ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_AGC) printf("AGC ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_BKINDL) printf("BKINDL ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_BALANCE) printf("BALANCE ");
|
|
|
|
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_SWR) printf("SWR ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_ALC) printf("ALC ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_SQLSTAT) printf("SQLSTAT ");
|
|
|
|
if (caps->has_set_level&RIG_LEVEL_STRENGTH) printf("STRENGTH ");
|
|
|
|
printf("\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
if (caps->has_set_level&RIG_LEVEL_READONLY_LIST) {
|
|
|
|
printf("Warning: backend can set readonly levels!\n");
|
|
|
|
backend_warnings++;
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
printf("none\n");
|
|
|
|
|
|
|
|
printf("Get parameters: ");
|
|
|
|
if (caps->has_get_parm!=0) {
|
|
|
|
if (caps->has_get_parm&RIG_PARM_ANN) printf("ANN ");
|
|
|
|
if (caps->has_get_parm&RIG_PARM_APO) printf("APO ");
|
|
|
|
if (caps->has_get_parm&RIG_PARM_BACKLIGHT) printf("BACKLIGHT ");
|
|
|
|
if (caps->has_get_parm&RIG_PARM_BEEP) printf("BEEP ");
|
|
|
|
if (caps->has_get_parm&RIG_PARM_TIME) printf("TIME ");
|
|
|
|
if (caps->has_get_parm&RIG_PARM_BAT) printf("BAT ");
|
|
|
|
printf("\n");
|
|
|
|
} else
|
|
|
|
printf("none\n");
|
|
|
|
|
|
|
|
printf("Set parameters: ");
|
|
|
|
if (caps->has_set_parm!=0) {
|
|
|
|
if (caps->has_set_parm&RIG_PARM_ANN) printf("ANN ");
|
|
|
|
if (caps->has_set_parm&RIG_PARM_APO) printf("APO ");
|
|
|
|
if (caps->has_set_parm&RIG_PARM_BACKLIGHT) printf("BACKLIGHT ");
|
|
|
|
if (caps->has_set_parm&RIG_PARM_BEEP) printf("BEEP ");
|
|
|
|
if (caps->has_set_parm&RIG_PARM_TIME) printf("TIME ");
|
|
|
|
if (caps->has_set_parm&RIG_PARM_BAT) printf("BAT ");
|
|
|
|
printf("\n");
|
2001-01-28 22:21:00 +00:00
|
|
|
} else
|
|
|
|
printf("none\n");
|
|
|
|
|
2001-05-08 09:11:32 +00:00
|
|
|
|
2001-05-04 22:45:57 +00:00
|
|
|
#if 0
|
|
|
|
/* FIXME: use rig->state.vfo_list instead */
|
2001-04-22 14:47:02 +00:00
|
|
|
printf("VFO list: ");
|
|
|
|
if (caps->vfo_list!=0) {
|
2001-04-26 21:33:57 +00:00
|
|
|
if ((caps->vfo_list&RIG_VFO_A)==RIG_VFO_A) printf("VFOA ");
|
|
|
|
if ((caps->vfo_list&RIG_VFO_B)==RIG_VFO_A) printf("VFOB ");
|
|
|
|
if ((caps->vfo_list&RIG_VFO_C)==RIG_VFO_A) printf("VFOC ");
|
2001-04-22 14:47:02 +00:00
|
|
|
printf("\n");
|
|
|
|
} else {
|
|
|
|
printf(" none! This backend might be bogus!\n");
|
|
|
|
}
|
2001-01-28 22:21:00 +00:00
|
|
|
|
2001-02-11 23:19:58 +00:00
|
|
|
printf("Number of channels:\t%d\n", caps->chan_qty);
|
2001-05-04 22:45:57 +00:00
|
|
|
#endif
|
2001-02-11 23:19:58 +00:00
|
|
|
printf("Number of banks:\t%d\n", caps->bank_qty);
|
|
|
|
printf("Memory name desc size:\t%d\n", caps->chan_desc_sz);
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2001-05-08 16:41:52 +00:00
|
|
|
printf("Memories:");
|
|
|
|
for (i=0; i<CHANLSTSIZ && caps->chan_list[i].type; i++) {
|
|
|
|
printf("\n\t%d..%d: \t%s", caps->chan_list[i].start,
|
|
|
|
caps->chan_list[i].end,
|
|
|
|
decode_mtype(caps->chan_list[i].type));
|
|
|
|
}
|
|
|
|
if (i == 0)
|
|
|
|
printf(" none");
|
|
|
|
printf("\n");
|
|
|
|
|
2000-10-01 12:52:17 +00:00
|
|
|
/* TODO: print rx/tx ranges here */
|
2001-02-11 23:19:58 +00:00
|
|
|
status = range_sanity_check(caps->tx_range_list1,0);
|
|
|
|
printf("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++;
|
2001-02-11 23:19:58 +00:00
|
|
|
status = range_sanity_check(caps->rx_range_list1,1);
|
|
|
|
printf("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
|
|
|
|
|
|
|
status = range_sanity_check(caps->tx_range_list2,0);
|
|
|
|
printf("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++;
|
2001-02-11 23:19:58 +00:00
|
|
|
status = range_sanity_check(caps->rx_range_list2,1);
|
|
|
|
printf("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
|
|
|
|
2001-02-15 00:01:08 +00:00
|
|
|
printf("Tuning steps:");
|
2000-10-01 12:52:17 +00:00
|
|
|
for (i=0; i<TSLSTSIZ && caps->tuning_steps[i].ts; i++) {
|
2001-04-24 19:56:41 +00:00
|
|
|
freq_sprintf(freqbuf,caps->tuning_steps[i].ts);
|
|
|
|
printf("\n\t%s: \t%s", freqbuf,
|
2000-10-01 12:52:17 +00:00
|
|
|
decode_modes(caps->tuning_steps[i].modes));
|
|
|
|
}
|
2001-05-08 09:11:32 +00:00
|
|
|
if (i==0) {
|
2001-02-15 00:01:08 +00:00
|
|
|
printf(" none! This backend might be bogus!");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
|
|
|
}
|
2001-02-15 00:01:08 +00:00
|
|
|
printf("\n");
|
2001-05-08 09:11:32 +00:00
|
|
|
status = ts_sanity_check(caps->tuning_steps);
|
|
|
|
printf("Tuning steps status:\t%s (%d)\n",status?"Bad":"OK",status);
|
|
|
|
if (status) backend_warnings++;
|
2001-02-15 00:01:08 +00:00
|
|
|
|
|
|
|
printf("Filters:");
|
|
|
|
for (i=0; i<FLTLSTSIZ && caps->filters[i].modes; i++) {
|
2001-04-24 19:56:41 +00:00
|
|
|
freq_sprintf(freqbuf,caps->filters[i].width);
|
|
|
|
printf("\n\t%s: \t%s", freqbuf,
|
2001-02-15 00:01:08 +00:00
|
|
|
decode_modes(caps->filters[i].modes));
|
|
|
|
}
|
2001-05-08 09:11:32 +00:00
|
|
|
if (i==0) {
|
2001-02-15 00:01:08 +00:00
|
|
|
printf(" none! This backend might be bogus!");
|
2001-05-08 09:11:32 +00:00
|
|
|
backend_warnings++;
|
|
|
|
}
|
2001-02-15 00:01:08 +00:00
|
|
|
printf("\n");
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2001-02-27 23:04:35 +00:00
|
|
|
printf("Has priv data:\t%c\n",caps->priv!=NULL?'Y':'N');
|
2001-02-15 00:01:08 +00:00
|
|
|
/*
|
|
|
|
* TODO: keep me up-to-date with API call list!
|
|
|
|
*/
|
2000-10-01 12:52:17 +00:00
|
|
|
printf("Can set frequency:\t%c\n",caps->set_freq!=NULL?'Y':'N');
|
2000-10-10 22:13:26 +00:00
|
|
|
printf("Can get frequency:\t%c\n",caps->get_freq!=NULL?'Y':'N');
|
|
|
|
printf("Can set mode:\t%c\n",caps->set_mode!=NULL?'Y':'N');
|
|
|
|
printf("Can get mode:\t%c\n",caps->get_mode!=NULL?'Y':'N');
|
|
|
|
printf("Can set vfo:\t%c\n",caps->set_vfo!=NULL?'Y':'N');
|
|
|
|
printf("Can get vfo:\t%c\n",caps->get_vfo!=NULL?'Y':'N');
|
|
|
|
printf("Can set ptt:\t%c\n",caps->set_ptt!=NULL?'Y':'N');
|
|
|
|
printf("Can get ptt:\t%c\n",caps->get_ptt!=NULL?'Y':'N');
|
2001-02-15 00:01:08 +00:00
|
|
|
printf("Can get dcd:\t%c\n",caps->get_dcd!=NULL?'Y':'N');
|
2000-10-22 16:14:53 +00:00
|
|
|
printf("Can set repeater duplex:\t%c\n",caps->set_rptr_shift!=NULL?'Y':'N');
|
|
|
|
printf("Can get repeater duplex:\t%c\n",caps->get_rptr_shift!=NULL?'Y':'N');
|
|
|
|
printf("Can set repeater offset:\t%c\n",caps->set_rptr_offs!=NULL?'Y':'N');
|
|
|
|
printf("Can get repeater offset:\t%c\n",caps->get_rptr_offs!=NULL?'Y':'N');
|
2001-04-28 12:42:26 +00:00
|
|
|
printf("Can set split freq:\t%c\n",caps->set_split_freq!=NULL?'Y':'N');
|
|
|
|
printf("Can get split freq:\t%c\n",caps->get_split_freq!=NULL?'Y':'N');
|
|
|
|
printf("Can set split mode:\t%c\n",caps->set_split_mode!=NULL?'Y':'N');
|
|
|
|
printf("Can get split mode:\t%c\n",caps->get_split_mode!=NULL?'Y':'N');
|
|
|
|
printf("Can set split:\t%c\n",caps->set_split!=NULL?'Y':'N');
|
|
|
|
printf("Can get split:\t%c\n",caps->get_split!=NULL?'Y':'N');
|
2000-10-10 22:13:26 +00:00
|
|
|
printf("Can set tuning step:\t%c\n",caps->set_ts!=NULL?'Y':'N');
|
|
|
|
printf("Can get tuning step:\t%c\n",caps->get_ts!=NULL?'Y':'N');
|
2001-04-28 12:42:26 +00:00
|
|
|
printf("Can set RIT:\t%c\n",caps->set_rit!=NULL?'Y':'N');
|
|
|
|
printf("Can get RIT:\t%c\n",caps->get_rit!=NULL?'Y':'N');
|
2001-05-08 09:11:32 +00:00
|
|
|
printf("Can set XIT:\t%c\n",caps->set_xit!=NULL?'Y':'N');
|
|
|
|
printf("Can get XIT:\t%c\n",caps->get_xit!=NULL?'Y':'N');
|
2001-07-01 11:46:17 +00:00
|
|
|
printf("Can set CTCSS:\t%c\n",caps->set_ctcss_tone!=NULL?'Y':'N');
|
|
|
|
printf("Can get CTCSS:\t%c\n",caps->get_ctcss_tone!=NULL?'Y':'N');
|
|
|
|
printf("Can set DCS:\t%c\n",caps->set_dcs_code!=NULL?'Y':'N');
|
|
|
|
printf("Can get DCS:\t%c\n",caps->get_dcs_code!=NULL?'Y':'N');
|
2001-02-27 23:04:35 +00:00
|
|
|
printf("Can set CTCSS squelch:\t%c\n",caps->set_ctcss_sql!=NULL?'Y':'N');
|
|
|
|
printf("Can get CTCSS squelch:\t%c\n",caps->get_ctcss_sql!=NULL?'Y':'N');
|
|
|
|
printf("Can set DCS squelch:\t%c\n",caps->set_dcs_sql!=NULL?'Y':'N');
|
|
|
|
printf("Can get DCS squelch:\t%c\n",caps->get_dcs_sql!=NULL?'Y':'N');
|
2001-03-02 18:43:25 +00:00
|
|
|
printf("Can set power stat:\t%c\n",caps->set_powerstat!=NULL?'Y':'N');
|
|
|
|
printf("Can get power stat:\t%c\n",caps->get_powerstat!=NULL?'Y':'N');
|
2000-10-10 22:13:26 +00:00
|
|
|
printf("Can set transceive:\t%c\n",caps->set_trn!=NULL?'Y':'N');
|
|
|
|
printf("Can get transceive:\t%c\n",caps->get_trn!=NULL?'Y':'N');
|
2001-02-11 23:19:58 +00:00
|
|
|
printf("Can set func:\t%c\n",caps->set_func!=NULL?'Y':'N');
|
|
|
|
printf("Can get func:\t%c\n",caps->get_func!=NULL?'Y':'N');
|
|
|
|
printf("Can set level:\t%c\n",caps->set_level!=NULL?'Y':'N');
|
|
|
|
printf("Can get level:\t%c\n",caps->get_level!=NULL?'Y':'N');
|
2001-04-28 12:42:26 +00:00
|
|
|
printf("Can set param:\t%c\n",caps->set_parm!=NULL?'Y':'N');
|
|
|
|
printf("Can get param:\t%c\n",caps->get_parm!=NULL?'Y':'N');
|
|
|
|
printf("Can send DTMF:\t%c\n",caps->send_dtmf!=NULL?'Y':'N');
|
|
|
|
printf("Can recv DTMF:\t%c\n",caps->recv_dtmf!=NULL?'Y':'N');
|
|
|
|
printf("Can send Morse:\t%c\n",caps->send_morse!=NULL?'Y':'N');
|
2000-10-10 22:13:26 +00:00
|
|
|
printf("Can decode events:\t%c\n",caps->decode_event!=NULL?'Y':'N');
|
2001-04-28 12:42:26 +00:00
|
|
|
printf("Can set mem:\t%c\n",caps->set_mem!=NULL?'Y':'N');
|
|
|
|
printf("Can get mem:\t%c\n",caps->get_mem!=NULL?'Y':'N');
|
2000-10-10 22:13:26 +00:00
|
|
|
printf("Can set channel:\t%c\n",caps->set_channel!=NULL?'Y':'N');
|
|
|
|
printf("Can get channel:\t%c\n",caps->get_channel!=NULL?'Y':'N');
|
2001-06-03 19:54:05 +00:00
|
|
|
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
|
2001-04-28 12:42:26 +00:00
|
|
|
printf("Can ctl mem/vfo:\t%c\n",caps->mv_ctl!=NULL?'Y':'N');
|
2001-06-03 19:54:05 +00:00
|
|
|
#else
|
|
|
|
printf("Can ctl mem/vfo:\t%c\n",caps->vfo_op!=NULL?'Y':'N');
|
|
|
|
#endif
|
2001-04-28 12:42:26 +00:00
|
|
|
printf("Can get info:\t%c\n",caps->get_info!=NULL?'Y':'N');
|
2000-10-01 12:52:17 +00:00
|
|
|
|
2000-10-10 22:13:26 +00:00
|
|
|
|
2001-05-08 09:11:32 +00:00
|
|
|
printf("\nOverall backend warnings: %d\n", backend_warnings);
|
|
|
|
|
|
|
|
return backend_warnings;
|
2000-10-01 12:52:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NB: this function is not reentrant, because of the static buf.
|
|
|
|
* but who cares? --SF
|
|
|
|
*/
|
|
|
|
static char *decode_modes(rmode_t modes)
|
|
|
|
{
|
|
|
|
static char buf[80];
|
|
|
|
|
|
|
|
buf[0] = '\0';
|
|
|
|
if (modes&RIG_MODE_AM) strcat(buf,"AM ");
|
|
|
|
if (modes&RIG_MODE_CW) strcat(buf,"CW ");
|
|
|
|
if (modes&RIG_MODE_USB) strcat(buf,"USB ");
|
|
|
|
if (modes&RIG_MODE_LSB) strcat(buf,"LSB ");
|
|
|
|
if (modes&RIG_MODE_RTTY) strcat(buf,"RTTY ");
|
|
|
|
if (modes&RIG_MODE_FM) strcat(buf,"FM ");
|
2001-02-15 00:01:08 +00:00
|
|
|
#ifdef RIG_MODE_WFM
|
|
|
|
if (modes&RIG_MODE_WFM) strcat(buf,"WFM ");
|
|
|
|
#endif
|
2000-10-01 12:52:17 +00:00
|
|
|
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
2001-05-08 16:41:52 +00:00
|
|
|
static const char *decode_mtype(enum chan_type_e type)
|
|
|
|
{
|
|
|
|
switch(type) {
|
|
|
|
case RIG_MTYPE_NONE: return "NONE";
|
|
|
|
case RIG_MTYPE_MEM: return "MEM";
|
|
|
|
case RIG_MTYPE_EDGE: return "EDGE";
|
|
|
|
case RIG_MTYPE_CALL: return "CALL";
|
|
|
|
case RIG_MTYPE_MEMOPAD: return "MEMOPAD";
|
|
|
|
default: return "UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
2000-10-01 12:52:17 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
* ->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;
|
|
|
|
|
|
|
|
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)
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
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++) {
|
|
|
|
if (tuning_step[i].modes == 0 && tuning_step[i].ts == 0)
|
|
|
|
break;
|
2001-05-08 16:41:52 +00:00
|
|
|
if (tuning_step[i].ts < last_ts &&
|
|
|
|
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
|
|
|
|