From 20bfa6f080a1aa427d154b7522dd09bb4b205102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Mon, 31 May 2010 08:42:01 +0000 Subject: [PATCH] ext_levels in get_channel(), and fix func list git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2934 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- dummy/dummy.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/dummy/dummy.c b/dummy/dummy.c index 06621be75..5d1e3c44d 100644 --- a/dummy/dummy.c +++ b/dummy/dummy.c @@ -1296,12 +1296,15 @@ static int dummy_get_channel(RIG *rig, channel_t *chan) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__); - if (!chan->ext_levels) - return -RIG_EINVAL; - if (chan->channel_num < 0 || chan->channel_num >= NB_CHAN) return -RIG_EINVAL; + if (!chan->ext_levels) { + chan->ext_levels = alloc_init_ext(dummy_ext_levels); + if (!chan->ext_levels) + return -RIG_ENOMEM; + } + /* TODO: * - check ext_levels is the right length */ @@ -1408,15 +1411,9 @@ static int dummy_mW2power(RIG * rig, float *power, unsigned int mwpower, * Dummy rig capabilities. */ -#if 0 -#define DUMMY_FUNC 0x7fffffffffffffLL /* has it all */ -#define DUMMY_LEVEL 0x7ffffffffffffffLL -#define DUMMY_PARM 0x7ffffffffffffffLL -#else -#define DUMMY_FUNC ((setting_t)-1) /* has it all */ -#define DUMMY_LEVEL ((setting_t)-1) +#define DUMMY_FUNC (((setting_t)-1)&~(0xc1000000U)) /* has it all */ +#define DUMMY_LEVEL (((setting_t)-1)&~(1<<27)) #define DUMMY_PARM ((setting_t)-1) -#endif #define DUMMY_VFO_OP 0x7ffffffL #define DUMMY_SCAN 0x7ffffffL