kopia lustrzana https://github.com/Hamlib/Hamlib
* new testcaps released
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@460 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.1.1
rodzic
7144361c52
commit
3148e26ec5
|
@ -1,4 +1,4 @@
|
|||
bin_PROGRAMS = dumpcaps testrig testtrn testbcd testfreq listrigs rigctl @RIGMATRIX@
|
||||
bin_PROGRAMS = dumpcaps testcaps testrig testtrn testbcd testfreq listrigs rigctl @RIGMATRIX@
|
||||
EXTRA_PROGRAMS = rigmatrix
|
||||
|
||||
# all the programs need this
|
||||
|
@ -10,6 +10,7 @@ BACKENDEPS = ../icom/libhamlib-icom.la ../yaesu/libhamlib-ft747.la ../yaesu/libh
|
|||
## Linker options
|
||||
listrigs_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
dumpcaps_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
testcaps_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
testrig_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
testtrn_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
rigctl_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
|
@ -19,6 +20,7 @@ rigmatrix_LDADD = -lgd ../src/libhamlib.la $(BACKENDLNK)
|
|||
## Dependencies
|
||||
|
||||
dumpcaps_DEPENDENCIES = $(BACKENDEPS)
|
||||
testcaps_DEPENDENCIES = $(BACKENDEPS)
|
||||
testrig_DEPENDENCIES = $(BACKENDEPS)
|
||||
testtrn_DEPENDENCIES = $(BACKENDEPS)
|
||||
listrigs_DEPENDENCIES = $(BACKENDEPS)
|
||||
|
@ -31,6 +33,7 @@ testtrn_SOURCES = testtrn.c
|
|||
testbcd_SOURCES = testbcd.c
|
||||
testfreq_SOURCES = testfreq.c
|
||||
dumpcaps_SOURCES = dumpcaps.c
|
||||
testcaps_SOURCES = testcaps.c
|
||||
listrigs_SOURCES = listrigs.c
|
||||
rigctl_SOURCES = rigctl.c
|
||||
rigmatrix_SOURCES = rigmatrix.c
|
||||
|
|
|
@ -80,7 +80,7 @@ WINRADIODEPS = @WINRADIODEPS@
|
|||
WINRADIOLNK = @WINRADIOLNK@
|
||||
hamlibdocdir = @hamlibdocdir@
|
||||
|
||||
bin_PROGRAMS = dumpcaps testrig testtrn testbcd testfreq listrigs rigctl @RIGMATRIX@
|
||||
bin_PROGRAMS = dumpcaps testcaps testrig testtrn testbcd testfreq listrigs rigctl @RIGMATRIX@
|
||||
EXTRA_PROGRAMS = rigmatrix
|
||||
|
||||
# all the programs need this
|
||||
|
@ -91,6 +91,7 @@ BACKENDEPS = ../icom/libhamlib-icom.la ../yaesu/libhamlib-ft747.la ../yaesu/libh
|
|||
|
||||
listrigs_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
dumpcaps_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
testcaps_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
testrig_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
testtrn_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
rigctl_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
||||
|
@ -98,6 +99,7 @@ rigctl_LDADD = ../src/libhamlib.la $(BACKENDLNK)
|
|||
rigmatrix_LDADD = -lgd ../src/libhamlib.la $(BACKENDLNK)
|
||||
|
||||
dumpcaps_DEPENDENCIES = $(BACKENDEPS)
|
||||
testcaps_DEPENDENCIES = $(BACKENDEPS)
|
||||
testrig_DEPENDENCIES = $(BACKENDEPS)
|
||||
testtrn_DEPENDENCIES = $(BACKENDEPS)
|
||||
listrigs_DEPENDENCIES = $(BACKENDEPS)
|
||||
|
@ -109,6 +111,7 @@ testtrn_SOURCES = testtrn.c
|
|||
testbcd_SOURCES = testbcd.c
|
||||
testfreq_SOURCES = testfreq.c
|
||||
dumpcaps_SOURCES = dumpcaps.c
|
||||
testcaps_SOURCES = testcaps.c
|
||||
listrigs_SOURCES = listrigs.c
|
||||
rigctl_SOURCES = rigctl.c
|
||||
rigmatrix_SOURCES = rigmatrix.c
|
||||
|
@ -126,6 +129,8 @@ rigmatrix_OBJECTS = rigmatrix.o
|
|||
rigmatrix_LDFLAGS =
|
||||
dumpcaps_OBJECTS = dumpcaps.o
|
||||
dumpcaps_LDFLAGS =
|
||||
testcaps_OBJECTS = testcaps.o
|
||||
testcaps_LDFLAGS =
|
||||
testrig_OBJECTS = testrig.o
|
||||
testrig_LDFLAGS =
|
||||
testtrn_OBJECTS = testtrn.o
|
||||
|
@ -147,7 +152,7 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CF
|
|||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
DIST_COMMON = README Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
@ -155,10 +160,10 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
|||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
DEP_FILES = .deps/dumpcaps.P .deps/listrigs.P .deps/rigctl.P \
|
||||
.deps/rigmatrix.P .deps/testbcd.P .deps/testfreq.P .deps/testrig.P \
|
||||
.deps/testtrn.P
|
||||
SOURCES = $(rigmatrix_SOURCES) $(dumpcaps_SOURCES) $(testrig_SOURCES) $(testtrn_SOURCES) $(testbcd_SOURCES) $(testfreq_SOURCES) $(listrigs_SOURCES) $(rigctl_SOURCES)
|
||||
OBJECTS = $(rigmatrix_OBJECTS) $(dumpcaps_OBJECTS) $(testrig_OBJECTS) $(testtrn_OBJECTS) $(testbcd_OBJECTS) $(testfreq_OBJECTS) $(listrigs_OBJECTS) $(rigctl_OBJECTS)
|
||||
.deps/rigmatrix.P .deps/testbcd.P .deps/testcaps.P .deps/testfreq.P \
|
||||
.deps/testrig.P .deps/testtrn.P
|
||||
SOURCES = $(rigmatrix_SOURCES) $(dumpcaps_SOURCES) $(testcaps_SOURCES) $(testrig_SOURCES) $(testtrn_SOURCES) $(testbcd_SOURCES) $(testfreq_SOURCES) $(listrigs_SOURCES) $(rigctl_SOURCES)
|
||||
OBJECTS = $(rigmatrix_OBJECTS) $(dumpcaps_OBJECTS) $(testcaps_OBJECTS) $(testrig_OBJECTS) $(testtrn_OBJECTS) $(testbcd_OBJECTS) $(testfreq_OBJECTS) $(listrigs_OBJECTS) $(rigctl_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
|
@ -236,6 +241,10 @@ dumpcaps: $(dumpcaps_OBJECTS) $(dumpcaps_DEPENDENCIES)
|
|||
@rm -f dumpcaps
|
||||
$(LINK) $(dumpcaps_LDFLAGS) $(dumpcaps_OBJECTS) $(dumpcaps_LDADD) $(LIBS)
|
||||
|
||||
testcaps: $(testcaps_OBJECTS) $(testcaps_DEPENDENCIES)
|
||||
@rm -f testcaps
|
||||
$(LINK) $(testcaps_LDFLAGS) $(testcaps_OBJECTS) $(testcaps_LDADD) $(LIBS)
|
||||
|
||||
testrig: $(testrig_OBJECTS) $(testrig_DEPENDENCIES)
|
||||
@rm -f testrig
|
||||
$(LINK) $(testrig_LDFLAGS) $(testrig_OBJECTS) $(testrig_LDADD) $(LIBS)
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* testcaps.c - Copyright (C) 2001 Stephane Fillod
|
||||
* This programs test the capabilities of a backend rig,
|
||||
* like the passband info..
|
||||
*
|
||||
*
|
||||
* $Id: testcaps.c,v 1.1 2001-04-24 20:04:47 f4cfe 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
static char *decode_modes(rmode_t modes);
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
const struct rig_caps *caps;
|
||||
int status, i;
|
||||
char freqbuf[20];
|
||||
RIG *pbrig;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr,"%s <rig_num>\n",argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
status = rig_load_backend("icom");
|
||||
status |= rig_load_backend("ft747");
|
||||
status |= rig_load_backend("ft847");
|
||||
status |= rig_load_backend("kenwood");
|
||||
status |= rig_load_backend("aor");
|
||||
status |= rig_load_backend("pcr");
|
||||
rig_load_backend("winradio"); /* may not be compiled ... */
|
||||
rig_load_backend("dummy");
|
||||
|
||||
if (status != RIG_OK ) {
|
||||
printf("rig_load_backend: error = %s \n", rigerror(status));
|
||||
exit(3);
|
||||
}
|
||||
|
||||
pbrig = rig_init(atoi(argv[1]));
|
||||
if (!pbrig) {
|
||||
fprintf(stderr,"Unknown rig num: %d\n",atoi(argv[1]));
|
||||
fprintf(stderr,"Please check riglist.h\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
caps = pbrig->caps;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
for (i=1; i < 1<<10; i<<=1) {
|
||||
const char *mode = decode_modes(i);
|
||||
|
||||
pbwidth_t pbnorm = rig_passband_normal(pbrig, i);
|
||||
if (pbnorm == 0)
|
||||
continue;
|
||||
|
||||
freq_sprintf(freqbuf, pbnorm);
|
||||
printf("%s normal: %s\n", mode, freqbuf);
|
||||
|
||||
freq_sprintf(freqbuf, rig_passband_narrow(pbrig, i));
|
||||
printf("%s narrow: %s\n", mode, freqbuf);
|
||||
|
||||
freq_sprintf(freqbuf, rig_passband_wide(pbrig, i));
|
||||
printf("%s wide: %s\n", mode, freqbuf);
|
||||
}
|
||||
|
||||
rig_cleanup(pbrig);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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 ");
|
||||
#ifdef RIG_MODE_WFM
|
||||
if (modes&RIG_MODE_WFM) strcat(buf,"WFM ");
|
||||
#endif
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
Ładowanie…
Reference in New Issue