From a0961e496641b12bcf2b2f9fb2d58e6d46909566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Mon, 24 Mar 2003 23:08:28 +0000 Subject: [PATCH] Removed RIG_FUNC_LMP in favor of RIG_PARM_BACKLIGHT git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1416 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- kenwood/th.c | 35 +++++++++++++++++++++++++++++++---- kenwood/th.h | 5 +++-- kenwood/thd7.c | 16 +++++++++------- kenwood/thf7.c | 13 ++++++++----- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/kenwood/th.c b/kenwood/th.c index 90d5ad339..5860cc5bd 100644 --- a/kenwood/th.c +++ b/kenwood/th.c @@ -1,8 +1,8 @@ /* * Hamlib Kenwood backend - TH handheld primitives - * Copyright (c) 2001-2002 by Stephane Fillod + * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: th.c,v 1.9 2002-08-16 17:43:01 fillods Exp $ + * $Id: th.c,v 1.10 2003-03-24 23:08:28 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 @@ -642,8 +642,6 @@ th_get_func (RIG *rig, vfo_t vfo, setting_t func, int *status) return th_get_kenwood_func(rig, "AIP" EOM, status); case RIG_FUNC_LOCK: return th_get_kenwood_func(rig, "LK" EOM, status); - case RIG_FUNC_LMP: - return th_get_kenwood_func(rig, "LMP" EOM, status); case RIG_FUNC_FAGC: case RIG_FUNC_NB: @@ -669,6 +667,35 @@ th_get_func (RIG *rig, vfo_t vfo, setting_t func, int *status) return RIG_OK; } +/* + * th_get_parm + * Assumes rig!=NULL, status!=NULL + */ +int +th_get_parm (RIG *rig, setting_t parm, value_t *val) +{ + int status; + int ret; + + rig_debug(RIG_DEBUG_TRACE, "%s: called (0x%04x)\n", __FUNCTION__, parm); + + /* Optimize: + * sort the switch cases with the most frequent first + */ + switch (parm) { + case RIG_PARM_BACKLIGHT: + ret = th_get_kenwood_func(rig, "LMP" EOM, &status); + val->f = status ? 1.0 : 0; + return ret; + + default: + rig_debug(RIG_DEBUG_ERR,"%s: Unsupported parm %#x", __FUNCTION__, parm); + return -RIG_EINVAL; + } + return RIG_OK; +} + + /* * th_get_level * Assumes rig!=NULL, val!=NULL diff --git a/kenwood/th.h b/kenwood/th.h index 8844e3afa..4b2bfaa6b 100644 --- a/kenwood/th.h +++ b/kenwood/th.h @@ -1,8 +1,8 @@ /* * Hamlib Kenwood backend - TH handheld header - * Copyright (c) 2001-2002 by Stephane Fillod + * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: th.h,v 1.3 2002-03-13 23:42:43 fillods Exp $ + * $Id: th.h,v 1.4 2003-03-24 23:08:28 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 @@ -33,6 +33,7 @@ extern int th_get_vfo(RIG *rig, vfo_t *vfo); extern int th_set_trn(RIG *rig, int trn); extern int th_get_trn (RIG *rig, int *trn); extern int th_get_func (RIG *rig, vfo_t vfo, setting_t func, int *status); +extern int th_get_parm (RIG *rig, setting_t parm, value_t *val); extern int th_get_level (RIG *rig, vfo_t vfo, setting_t level, value_t *val); extern int th_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone); extern int th_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone); diff --git a/kenwood/thd7.c b/kenwood/thd7.c index f210bd401..b98dc5c5e 100644 --- a/kenwood/thd7.c +++ b/kenwood/thd7.c @@ -1,8 +1,8 @@ /* * Hamlib Kenwood backend - TH-D7 description - * Copyright (c) 2000-2002 by Stephane Fillod + * Copyright (c) 2000-2003 by Stephane Fillod * - * $Id: thd7.c,v 1.8 2002-11-04 22:40:54 fillods Exp $ + * $Id: thd7.c,v 1.9 2003-03-24 23:08:28 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 @@ -45,8 +45,7 @@ RIG_FUNC_TONE| \ RIG_FUNC_REV| \ RIG_FUNC_LOCK| \ - RIG_FUNC_ARO| \ - RIG_FUNC_LMP) + RIG_FUNC_ARO) #define THD7_LEVEL_ALL (RIG_LEVEL_STRENGTH| \ RIG_LEVEL_SQL| \ @@ -55,6 +54,8 @@ RIG_LEVEL_RF|\ RIG_LEVEL_MICGAIN) +#define THD7_PARMS (RIG_PARM_BACKLIGHT) + #define THD7_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) /* @@ -74,7 +75,7 @@ const struct rig_caps thd7a_caps = { .rig_model = RIG_MODEL_THD7A, .model_name = "TH-D7A", .mfg_name = "Kenwood", -.version = "0.1", +.version = "0.1.1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_HANDHELD|RIG_FLAG_APRS|RIG_FLAG_TNC|RIG_FLAG_DXCLUSTER, @@ -96,8 +97,8 @@ const struct rig_caps thd7a_caps = { .has_set_func = THD7_FUNC_ALL, .has_get_level = THD7_LEVEL_ALL, .has_set_level = RIG_LEVEL_SET(THD7_LEVEL_ALL), -.has_get_parm = RIG_PARM_NONE, -.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ +.has_get_parm = THD7_PARMS, +.has_set_parm = THD7_PARMS, /* FIXME: parms */ .level_gran = {}, /* FIXME: granularity */ .parm_gran = {}, .ctcss_list = kenwood38_ctcss_list, @@ -170,6 +171,7 @@ const struct rig_caps thd7a_caps = { .get_func = th_get_func, .get_level = th_get_level, +.get_parm = th_get_parm, .get_info = th_get_info, .decode_event = th_decode_event, diff --git a/kenwood/thf7.c b/kenwood/thf7.c index 4d6033d11..0e7a840d5 100644 --- a/kenwood/thf7.c +++ b/kenwood/thf7.c @@ -1,8 +1,8 @@ /* * Hamlib Kenwood backend - TH-F7 description - * Copyright (c) 2001-2002 by Stephane Fillod + * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: thf7.c,v 1.6 2002-11-04 22:40:54 fillods Exp $ + * $Id: thf7.c,v 1.7 2003-03-24 23:08:28 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 @@ -35,6 +35,8 @@ #define THF7_LEVEL_ALL (RIG_LEVEL_SQL|RIG_LEVEL_SQLSTAT|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_MICGAIN) +#define THF7_PARMS (RIG_PARM_BACKLIGHT) + #define THF7_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) /* @@ -53,7 +55,7 @@ const struct rig_caps thf7e_caps = { .rig_model = RIG_MODEL_THF7E, .model_name = "TH-F7E", .mfg_name = "Kenwood", -.version = "0.1", +.version = "0.1.1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_HANDHELD, @@ -75,8 +77,8 @@ const struct rig_caps thf7e_caps = { .has_set_func = THF7_FUNC_ALL, .has_get_level = THF7_LEVEL_ALL, .has_set_level = RIG_LEVEL_SET(THF7_LEVEL_ALL), -.has_get_parm = RIG_PARM_NONE, -.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ +.has_get_parm = THF7_PARMS, +.has_set_parm = THF7_PARMS, /* FIXME: parms */ .level_gran = {}, /* FIXME: granularity */ .parm_gran = {}, .ctcss_list = kenwood38_ctcss_list, @@ -149,6 +151,7 @@ const struct rig_caps thf7e_caps = { .get_func = th_get_func, .get_level = th_get_level, +.get_parm = th_get_parm, .get_info = th_get_info, .decode_event = th_decode_event,