From a3191999f91a4adc8a9b9e7deae6e886ec6a5eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Thu, 4 Dec 2003 23:18:49 +0000 Subject: [PATCH] support for printing more caps git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1625 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- tests/dumpcaps.c | 27 +++++++++++++-------------- tests/sprintflst.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 18c571fb1..d594266e6 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -3,7 +3,7 @@ * This programs dumps the capabilities of a backend rig. * * - * $Id: dumpcaps.c,v 1.40 2003-11-16 17:34:00 fillods Exp $ + * $Id: dumpcaps.c,v 1.41 2003-12-04 23:18:49 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -248,20 +248,19 @@ int dumpcaps (RIG* rig) rig_ext_parm_foreach(rig, print_ext, NULL); printf("\n"); -#if 0 - /* FIXME: use rig->state.vfo_list instead */ - printf("VFO list: "); - if (caps->vfo_list!=0) { - 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 "); - printf("\n"); - } else { - printf(" none! This backend might be bogus!\n"); - } - printf("Number of channels:\t%d\n", caps->chan_qty); -#endif + if (rig->state.vfo_list!=0) + sprintf_vfo(prntbuf, rig->state.vfo_list); + else + strcpy(prntbuf," none! This backend might be bogus!\n"); + printf("VFO list: %s\n", prntbuf); + + sprintf_vfop(prntbuf, caps->vfo_ops); + printf("VFO Ops: %s\n", prntbuf); + + sprintf_scan(prntbuf, caps->scan_ops); + printf("Scan Ops: %s\n", prntbuf); + printf("Number of banks:\t%d\n", caps->bank_qty); printf("Memory name desc size:\t%d\n", caps->chan_desc_sz); diff --git a/tests/sprintflst.c b/tests/sprintflst.c index d4438528b..699d0b857 100644 --- a/tests/sprintflst.c +++ b/tests/sprintflst.c @@ -2,7 +2,7 @@ * Hamlib Interface - sprintf toolbox * Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton * - * $Id: sprintflst.c,v 1.1 2003-11-16 16:58:35 fillods Exp $ + * $Id: sprintflst.c,v 1.2 2003-12-04 23:18:49 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -39,6 +39,33 @@ #define DUMMY_ALL 0x7ffffffffffffffLL +int sprintf_vfo(char *str, vfo_t vfo) +{ + int i, len=0; + const char *sv; + + *str = '\0'; + if (vfo == RIG_VFO_NONE) + return 0; + sv = strvfo(vfo & RIG_VFO_CURR); + if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); + sv = strvfo(vfo & RIG_VFO_MEM); + if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); + sv = strvfo(vfo & RIG_VFO_VFO); + if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); + sv = strvfo(vfo & RIG_VFO_MAIN); + if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); + sv = strvfo(vfo & RIG_VFO_SUB); + if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); + + for (i=0; i<16; i++) { + sv = strvfo(vfo & RIG_VFO_N(i)); + if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); + } + + return len; +} + int sprintf_mode(char *str, rmode_t mode) { int i, len=0;