2000-12-23 08:40:14 +00:00
|
|
|
/*
|
2001-07-13 19:08:15 +00:00
|
|
|
* Hamlib Kenwood backend - main file
|
2009-01-29 22:54:41 +00:00
|
|
|
* Copyright (c) 2000-2009 by Stephane Fillod
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
* Copyright (C) 2009 Alessandro Zummo <a.zummo@towertech.it>
|
2000-12-23 08:40:14 +00:00
|
|
|
*
|
2009-02-13 19:34:21 +00:00
|
|
|
* $Id: kenwood.c,v 1.118 2009-02-13 19:34:21 azummo Exp $
|
2000-12-23 08:40:14 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
2000-12-23 08:40:14 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* 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 Library General Public License for more details.
|
2000-12-23 08:40:14 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2000-12-23 08:40:14 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2001-07-13 19:08:15 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2000-12-23 08:40:14 +00:00
|
|
|
#include <stdlib.h>
|
2003-10-01 19:32:04 +00:00
|
|
|
#include <stdio.h>
|
2000-12-23 08:40:14 +00:00
|
|
|
#include <string.h> /* String function definitions */
|
|
|
|
#include <unistd.h> /* UNIX standard function definitions */
|
|
|
|
#include <math.h>
|
2009-02-10 22:48:25 +00:00
|
|
|
#include <ctype.h>
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2003-04-07 22:42:11 +00:00
|
|
|
#include "hamlib/rig.h"
|
|
|
|
#include "serial.h"
|
|
|
|
#include "misc.h"
|
2003-04-16 22:30:43 +00:00
|
|
|
#include "register.h"
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
#include "cal.h"
|
2001-06-15 07:08:37 +00:00
|
|
|
|
2000-12-23 08:40:14 +00:00
|
|
|
#include "kenwood.h"
|
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
struct kenwood_id {
|
|
|
|
rig_model_t model;
|
|
|
|
int id;
|
|
|
|
};
|
|
|
|
|
2001-10-18 20:43:13 +00:00
|
|
|
struct kenwood_id_string {
|
|
|
|
rig_model_t model;
|
|
|
|
const char *id;
|
|
|
|
};
|
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
#define UNKNOWN_ID -1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Identification number as returned by "ID;"
|
|
|
|
* Please, if the model number of your rig is listed as UNKNOWN_ID,
|
2001-12-11 21:58:37 +00:00
|
|
|
* send the value to <fillods@users.sourceforge.net> for inclusion. Thanks --SF
|
2001-05-15 22:05:26 +00:00
|
|
|
*
|
|
|
|
* TODO: sort this list with most frequent rigs first.
|
|
|
|
*/
|
|
|
|
static const struct kenwood_id kenwood_id_list[] = {
|
2002-07-05 23:22:11 +00:00
|
|
|
{ RIG_MODEL_TS940, 1 },
|
|
|
|
{ RIG_MODEL_TS811, 2 },
|
|
|
|
{ RIG_MODEL_TS711, 3 },
|
|
|
|
{ RIG_MODEL_TS440, 4 },
|
2001-06-04 21:18:39 +00:00
|
|
|
{ RIG_MODEL_R5000, 5 },
|
2003-01-29 22:25:16 +00:00
|
|
|
{ RIG_MODEL_TS790, 7 },
|
2009-02-03 22:33:00 +00:00
|
|
|
{ RIG_MODEL_TS950SDX, 8 }, /* reported as RIG_MODEL_TS950SD originally */
|
|
|
|
{ RIG_MODEL_TS850, 9 },
|
2002-12-16 18:44:02 +00:00
|
|
|
{ RIG_MODEL_TS450S, 10 },
|
|
|
|
{ RIG_MODEL_TS690S, 11 },
|
2001-06-04 21:18:39 +00:00
|
|
|
{ RIG_MODEL_TS870S, 15 },
|
2009-01-29 22:54:41 +00:00
|
|
|
{ RIG_MODEL_TRC80, 16 },
|
2002-11-13 20:35:18 +00:00
|
|
|
{ RIG_MODEL_TS570D, 17 }, /* Elecraft K2 also returns 17 */
|
2001-06-30 23:19:42 +00:00
|
|
|
{ RIG_MODEL_TS570S, 18 },
|
2001-06-04 21:18:39 +00:00
|
|
|
{ RIG_MODEL_TS2000, 19 },
|
2004-11-27 13:19:56 +00:00
|
|
|
{ RIG_MODEL_TS480, 20 },
|
2001-06-30 23:19:42 +00:00
|
|
|
{ RIG_MODEL_NONE, UNKNOWN_ID }, /* end marker */
|
2001-05-15 22:05:26 +00:00
|
|
|
};
|
|
|
|
|
2009-02-03 22:42:44 +00:00
|
|
|
/* XXX numeric ids have been tested only with the TS-450 */
|
2001-10-18 20:43:13 +00:00
|
|
|
static const struct kenwood_id_string kenwood_id_string_list[] = {
|
2009-02-03 22:42:44 +00:00
|
|
|
{ RIG_MODEL_TS940, "001" },
|
|
|
|
{ RIG_MODEL_TS811, "002" },
|
|
|
|
{ RIG_MODEL_TS711, "003" },
|
|
|
|
{ RIG_MODEL_TS440, "004" },
|
|
|
|
{ RIG_MODEL_R5000, "005" },
|
|
|
|
{ RIG_MODEL_TS790, "007" },
|
|
|
|
{ RIG_MODEL_TS950SDX, "008" }, /* reported as RIG_MODEL_TS950SD originally */
|
|
|
|
{ RIG_MODEL_TS850, "009" },
|
|
|
|
{ RIG_MODEL_TS450S, "010" },
|
|
|
|
{ RIG_MODEL_TS690S, "011" },
|
|
|
|
{ RIG_MODEL_TS870S, "015" },
|
|
|
|
{ RIG_MODEL_TS570D, "017" }, /* Elecraft K2 also returns 17 */
|
|
|
|
{ RIG_MODEL_TS570S, "018" },
|
|
|
|
{ RIG_MODEL_TS2000, "019" },
|
|
|
|
{ RIG_MODEL_TS480, "020" },
|
|
|
|
{ RIG_MODEL_THD7A, "TH-D7" },
|
|
|
|
{ RIG_MODEL_THD7AG, "TH-D7G" },
|
|
|
|
{ RIG_MODEL_TMD700, "TM-D700" },
|
|
|
|
{ RIG_MODEL_TMV7, "TM-V7" },
|
|
|
|
{ RIG_MODEL_THF6A, "TH-F6" },
|
|
|
|
{ RIG_MODEL_THF7E, "TH-F7" },
|
|
|
|
{ RIG_MODEL_THG71, "TH-G71" },
|
|
|
|
{ RIG_MODEL_NONE, NULL }, /* end marker */
|
2001-10-18 20:43:13 +00:00
|
|
|
};
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
rmode_t kenwood_mode_table[KENWOOD_MODE_TABLE_MAX] = {
|
|
|
|
[0] = RIG_MODE_NONE,
|
|
|
|
[1] = RIG_MODE_LSB,
|
|
|
|
[2] = RIG_MODE_USB,
|
|
|
|
[3] = RIG_MODE_CW,
|
|
|
|
[4] = RIG_MODE_FM,
|
|
|
|
[5] = RIG_MODE_AM,
|
|
|
|
[6] = RIG_MODE_RTTY,
|
|
|
|
[7] = RIG_MODE_CWR,
|
2009-02-05 21:05:59 +00:00
|
|
|
[8] = RIG_MODE_NONE, /* TUNE mode */
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
[9] = RIG_MODE_RTTYR
|
|
|
|
};
|
2001-10-18 20:43:13 +00:00
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
|
|
|
* 38 CTCSS sub-audible tones
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
*/
|
2006-03-09 19:45:10 +00:00
|
|
|
const tone_t kenwood38_ctcss_list[] = {
|
2001-05-15 22:05:26 +00:00
|
|
|
670, 719, 744, 770, 797, 825, 854, 885, 915, 948,
|
|
|
|
974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, 1318,
|
|
|
|
1365, 1413, 1462, 1514, 1567, 1622, 1679, 1738, 1799, 1862,
|
2009-06-23 20:55:58 +00:00
|
|
|
1928, 2035, 2107, 2181, 2257, 2336, 2418, 2503,
|
2001-05-15 22:05:26 +00:00
|
|
|
0,
|
|
|
|
};
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2002-03-13 23:42:43 +00:00
|
|
|
/**
|
2001-06-30 23:19:42 +00:00
|
|
|
* kenwood_transaction
|
2002-03-13 23:42:43 +00:00
|
|
|
* Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL
|
2001-06-30 23:19:42 +00:00
|
|
|
*
|
2002-03-13 23:42:43 +00:00
|
|
|
* cmdstr - Command to be sent to the rig. Cmdstr can also be NULL, indicating
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
* that only a reply is needed (nothing will be send).
|
2002-03-13 23:42:43 +00:00
|
|
|
* data - Buffer for reply string. Can be NULL, indicating that no reply is
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
* is needed and will return with RIG_OK after command was sent.
|
2002-03-13 23:42:43 +00:00
|
|
|
* datasize - in: Size of buffer. It is the caller's responsibily to provide
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
* a large enough buffer for all possible replies for a command.
|
|
|
|
* out: location where to store number of bytes read.
|
2001-12-11 21:58:37 +00:00
|
|
|
*
|
2002-03-13 23:42:43 +00:00
|
|
|
* returns:
|
|
|
|
* RIG_OK - if no error occured.
|
|
|
|
* RIG_EIO - if an I/O error occured while sending/receiving data.
|
|
|
|
* RIG_ETIMEOUT - if timeout expires without any characters received.
|
|
|
|
* RIG_REJECTED - if a negative acknowledge was received or command not
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
* recognized by rig.
|
2001-06-30 23:19:42 +00:00
|
|
|
*/
|
2002-03-13 23:42:43 +00:00
|
|
|
int
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
kenwood_transaction(RIG *rig, const char *cmdstr, int cmd_len,
|
2002-03-13 23:42:43 +00:00
|
|
|
char *data, size_t *datasize)
|
2001-06-30 23:19:42 +00:00
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
2002-03-13 23:42:43 +00:00
|
|
|
struct rig_state *rs;
|
|
|
|
int retval;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char cmdtrm[2]; /* Default Command/Reply termination char */
|
2002-03-13 23:42:43 +00:00
|
|
|
int retry_read = 0;
|
|
|
|
|
|
|
|
rs = &rig->state;
|
|
|
|
rs->hold_decode = 1;
|
|
|
|
|
2009-01-29 08:41:57 +00:00
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: %s\n", __func__, cmdstr);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
cmdtrm[0] = caps->cmdtrm;
|
|
|
|
cmdtrm[1] = '\0';
|
2002-03-13 23:42:43 +00:00
|
|
|
|
2004-03-29 20:54:26 +00:00
|
|
|
transaction_write:
|
|
|
|
|
|
|
|
serial_flush(&rs->rigport);
|
|
|
|
|
2002-03-13 23:42:43 +00:00
|
|
|
if (cmdstr) {
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int len = strlen(cmdstr);
|
|
|
|
|
|
|
|
retval = write_block(&rs->rigport, cmdstr, strlen(cmdstr));
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
goto transaction_quit;
|
|
|
|
|
|
|
|
/* XXX the if is temporary, until all invocations are fixed */
|
|
|
|
/* XXX eventually a buffer could be used and write_block called once */
|
|
|
|
if (cmdstr[len - 1] != ';' && cmdstr[len - 1] != '\r')
|
|
|
|
retval = write_block(&rs->rigport, &caps->cmdtrm, 1);
|
|
|
|
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
goto transaction_quit;
|
2002-03-13 23:42:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (data == NULL || *datasize <= 0) {
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
rig->state.hold_decode = 0;
|
|
|
|
return RIG_OK; /* don't want a reply */
|
2002-03-13 23:42:43 +00:00
|
|
|
}
|
|
|
|
|
2007-09-04 15:01:23 +00:00
|
|
|
memset(data,0,*datasize);
|
2002-03-13 23:42:43 +00:00
|
|
|
retval = read_string(&rs->rigport, data, *datasize, cmdtrm, strlen(cmdtrm));
|
2004-03-29 20:54:26 +00:00
|
|
|
if (retval < 0) {
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (retry_read++ < rig->state.rigport.retry)
|
|
|
|
goto transaction_write;
|
|
|
|
goto transaction_quit;
|
2004-03-29 20:54:26 +00:00
|
|
|
} else
|
|
|
|
*datasize = retval;
|
2002-03-13 23:42:43 +00:00
|
|
|
|
|
|
|
/* Check that command termination is correct */
|
2004-03-29 20:54:26 +00:00
|
|
|
if (strchr(cmdtrm, data[strlen(data)-1])==NULL) {
|
2009-02-03 23:22:58 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n", __func__, data);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (retry_read++ < rig->state.rigport.retry)
|
|
|
|
goto transaction_write;
|
|
|
|
retval = -RIG_EPROTO;
|
|
|
|
goto transaction_quit;
|
2002-03-13 23:42:43 +00:00
|
|
|
}
|
|
|
|
|
2008-05-04 21:19:07 +00:00
|
|
|
if (strlen(data) == 2) {
|
|
|
|
switch (data[0]) {
|
|
|
|
case 'N':
|
|
|
|
/* Command recognised by rig but invalid data entered. */
|
2009-02-03 23:22:58 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: NegAck for '%s'\n", __func__, cmdstr);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = -RIG_ENAVAIL;
|
|
|
|
goto transaction_quit;
|
2008-05-04 21:19:07 +00:00
|
|
|
case 'O':
|
2009-01-29 22:54:41 +00:00
|
|
|
/* Too many characters sent without a carriage return */
|
2009-02-03 23:22:58 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __func__, cmdstr);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = -RIG_EPROTO;
|
|
|
|
goto transaction_quit;
|
2009-01-29 22:54:41 +00:00
|
|
|
case 'E':
|
|
|
|
/* Communication error */
|
2009-02-03 23:22:58 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: Communication error for '%s'\n", __func__, cmdstr);
|
2009-01-29 22:54:41 +00:00
|
|
|
retval = -RIG_EIO;
|
|
|
|
goto transaction_quit;
|
2008-05-04 21:19:07 +00:00
|
|
|
case '?':
|
|
|
|
/* Command not understood by rig */
|
2009-02-03 23:22:58 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: Unknown command '%s'\n", __func__, cmdstr);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = -RIG_ERJCTED;
|
|
|
|
goto transaction_quit;
|
2008-05-04 21:19:07 +00:00
|
|
|
}
|
2002-03-13 23:42:43 +00:00
|
|
|
}
|
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
/* always give back a null terminated string without
|
|
|
|
* the command terminator.
|
|
|
|
*/
|
|
|
|
|
2002-03-13 23:42:43 +00:00
|
|
|
if (strlen(data) > 0)
|
2009-02-13 19:29:16 +00:00
|
|
|
data[strlen(data) - 1] = '\0'; /* not elegant, but works */
|
2002-03-13 23:42:43 +00:00
|
|
|
else
|
2009-02-13 19:29:16 +00:00
|
|
|
data[0] = '\0';
|
2002-03-13 23:42:43 +00:00
|
|
|
/*
|
|
|
|
* Check that received the correct reply. The first two characters
|
|
|
|
* should be the same as command.
|
|
|
|
*/
|
|
|
|
if (cmdstr && (data[0] != cmdstr[0] || data[1] != cmdstr[1])) {
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
/*
|
|
|
|
* TODO: When RIG_TRN is enabled, we can pass the string
|
|
|
|
* to the decoder for callback. That way we don't ignore
|
|
|
|
* any commands.
|
|
|
|
*/
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply %c%c for command %c%c\n",
|
|
|
|
__func__, data[0], data[1], cmdstr[0], cmdstr[1]);
|
|
|
|
|
|
|
|
if (retry_read++ < rig->state.rigport.retry)
|
|
|
|
goto transaction_write;
|
|
|
|
|
|
|
|
retval = -RIG_EPROTO;
|
|
|
|
goto transaction_quit;
|
2002-03-13 23:42:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
retval = RIG_OK;
|
|
|
|
transaction_quit:
|
|
|
|
rs->hold_decode = 0;
|
|
|
|
return retval;
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int
|
|
|
|
kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf,
|
|
|
|
size_t buf_size, size_t expected)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
|
|
|
|
if (expected == 0)
|
|
|
|
buf_size = 0;
|
|
|
|
|
|
|
|
err = kenwood_transaction(rig, cmd, strlen(cmd), buf, &buf_size);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
if (buf_size != expected) {
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: wrong answer len for cmd %s: "
|
|
|
|
"expected = %d, got %d\n",
|
|
|
|
__func__, cmd, expected, buf_size);
|
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2008-05-04 21:19:07 +00:00
|
|
|
rmode_t kenwood2rmode(unsigned char mode, const rmode_t mode_table[])
|
|
|
|
{
|
|
|
|
if (mode >= KENWOOD_MODE_TABLE_MAX)
|
|
|
|
return RIG_MODE_NONE;
|
|
|
|
return mode_table[mode];
|
|
|
|
}
|
|
|
|
|
|
|
|
char rmode2kenwood(rmode_t mode, const rmode_t mode_table[])
|
|
|
|
{
|
|
|
|
int i;
|
2009-02-13 19:29:16 +00:00
|
|
|
for(i = 0; i < KENWOOD_MODE_TABLE_MAX; i++) {
|
2008-05-04 21:19:07 +00:00
|
|
|
if (mode_table[i] == mode)
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int kenwood_init(RIG *rig)
|
|
|
|
{
|
|
|
|
struct kenwood_priv_data *priv;
|
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
|
|
|
|
2009-02-03 22:42:44 +00:00
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
priv = malloc(sizeof(struct kenwood_priv_data));
|
|
|
|
if (priv == NULL)
|
|
|
|
return -RIG_ENOMEM;
|
|
|
|
|
|
|
|
memset(priv, 0x00, sizeof(struct kenwood_priv_data));
|
|
|
|
|
2009-06-23 20:55:58 +00:00
|
|
|
priv->split = RIG_SPLIT_OFF;
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
rig->state.priv = priv;
|
|
|
|
|
|
|
|
/* default mode_table */
|
|
|
|
if (caps->mode_table == NULL)
|
|
|
|
caps->mode_table = kenwood_mode_table;
|
|
|
|
|
|
|
|
/* default if_len */
|
|
|
|
if (caps->if_len == 0)
|
|
|
|
caps->if_len = 38;
|
|
|
|
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: if_len = %d\n", __func__, caps->if_len);
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int kenwood_cleanup(RIG *rig)
|
|
|
|
{
|
|
|
|
if (rig == NULL)
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
|
|
|
|
free(rig->state.priv);
|
|
|
|
rig->state.priv = NULL;
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2009-02-03 22:42:44 +00:00
|
|
|
int kenwood_open(RIG *rig)
|
|
|
|
{
|
|
|
|
int err, i;
|
|
|
|
char *idptr;
|
|
|
|
char id[KENWOOD_MAX_BUF_LEN];
|
|
|
|
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
|
|
|
|
|
|
|
|
/* get id in buffer, will be null terminated */
|
|
|
|
err = kenwood_get_id(rig, id);
|
|
|
|
if (err != RIG_OK) {
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: cannot get identification\n",
|
|
|
|
__func__);
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* id is something like 'IDXXX' or 'ID XXX' */
|
|
|
|
if (strlen(id) < 5) {
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unknown id type (%s)\n", id);
|
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check for a white space and skip it */
|
|
|
|
idptr = &id[2];
|
|
|
|
if (*idptr == ' ')
|
|
|
|
idptr++;
|
|
|
|
|
|
|
|
/* compare id string */
|
|
|
|
for (i = 0; kenwood_id_string_list[i].model != RIG_MODEL_NONE; i++) {
|
|
|
|
if (strcmp(kenwood_id_string_list[i].id, idptr) != 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* found matching id, verify driver */
|
|
|
|
rig_debug(RIG_DEBUG_TRACE, "%s: found match %s\n",
|
|
|
|
__func__, kenwood_id_string_list[i].id);
|
|
|
|
|
|
|
|
if (kenwood_id_string_list[i].model == rig->caps->rig_model)
|
|
|
|
return RIG_OK;
|
|
|
|
|
|
|
|
/* driver mismatch */
|
|
|
|
rig_debug(RIG_DEBUG_ERR,
|
|
|
|
"%s: wrong driver selected (%d instead of %d)\n",
|
|
|
|
__func__, rig->caps->rig_model,
|
|
|
|
kenwood_id_string_list[i].model);
|
|
|
|
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: your rig (%s) is unknown\n",
|
|
|
|
__func__, id);
|
|
|
|
|
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* caller must give a buffer of KENWOOD_MAX_BUF_LEN size */
|
|
|
|
int kenwood_get_id(RIG *rig, char *buf)
|
|
|
|
{
|
|
|
|
size_t size = KENWOOD_MAX_BUF_LEN;
|
|
|
|
return kenwood_transaction(rig, "ID", 2, buf, &size);
|
|
|
|
}
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
static int kenwood_get_if(RIG *rig)
|
|
|
|
{
|
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
return kenwood_safe_transaction(rig, "IF", priv->info,
|
2009-02-03 22:42:44 +00:00
|
|
|
KENWOOD_MAX_BUF_LEN, caps->if_len);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
}
|
2002-03-13 23:42:43 +00:00
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
|
|
|
* kenwood_set_vfo
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_set_vfo(RIG *rig, vfo_t vfo)
|
|
|
|
{
|
2009-06-23 20:55:58 +00:00
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
2009-02-13 19:29:16 +00:00
|
|
|
char cmdbuf[6];
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int retval;
|
2005-09-24 07:48:42 +00:00
|
|
|
char vfo_function;
|
|
|
|
|
|
|
|
switch (vfo) {
|
|
|
|
case RIG_VFO_VFO:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
case RIG_VFO_A:
|
|
|
|
vfo_function = '0';
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_VFO_B:
|
|
|
|
vfo_function = '1';
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_VFO_MEM:
|
|
|
|
vfo_function = '2';
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_VFO_CURR:
|
|
|
|
return RIG_OK;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
default:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n",
|
|
|
|
__func__, vfo);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2002-03-13 23:42:43 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
sprintf(cmdbuf, "FR%c", vfo_function);
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
/* set RX VFO */
|
2009-02-02 07:29:11 +00:00
|
|
|
retval = kenwood_simple_cmd(rig, cmdbuf);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2009-06-23 20:55:58 +00:00
|
|
|
/* If split mode on, the don't change TxVFO */
|
|
|
|
if (priv->split != RIG_SPLIT_OFF)
|
|
|
|
return RIG_OK;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
/* set TX VFO */
|
|
|
|
cmdbuf[1] = 'T';
|
2009-02-13 19:29:16 +00:00
|
|
|
return kenwood_simple_cmd(rig, cmdbuf);
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
2004-02-14 16:50:54 +00:00
|
|
|
int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
|
|
|
{
|
2009-06-23 20:55:58 +00:00
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char cmdbuf[6];
|
|
|
|
int retval;
|
2006-03-07 19:48:20 +00:00
|
|
|
unsigned char vfo_function;
|
2005-09-24 07:48:42 +00:00
|
|
|
|
2009-06-23 20:55:58 +00:00
|
|
|
if(vfo != RIG_VFO_CURR) {
|
|
|
|
switch (vfo) {
|
2004-02-14 16:50:54 +00:00
|
|
|
case RIG_VFO_VFO:
|
|
|
|
case RIG_VFO_A: vfo_function = '0'; break;
|
|
|
|
case RIG_VFO_B: vfo_function = '1'; break;
|
|
|
|
case RIG_VFO_MEM: vfo_function = '2'; break;
|
|
|
|
default:
|
2009-06-23 20:55:58 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n", __func__,
|
|
|
|
vfo);
|
2004-02-14 16:50:54 +00:00
|
|
|
return -RIG_EINVAL;
|
2009-06-23 20:55:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* set RX VFO */
|
|
|
|
sprintf(cmdbuf, "FR%c", vfo_function);
|
|
|
|
retval = kenwood_simple_cmd(rig, cmdbuf);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Split off means Rx and Tx are the same */
|
|
|
|
if (split==RIG_SPLIT_OFF) {
|
|
|
|
txvfo = vfo;
|
|
|
|
if (txvfo == RIG_VFO_CURR) {
|
|
|
|
retval = rig_get_vfo(rig, &txvfo);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (txvfo) {
|
|
|
|
case RIG_VFO_VFO:
|
|
|
|
case RIG_VFO_A: vfo_function = '0'; break;
|
|
|
|
case RIG_VFO_B: vfo_function = '1'; break;
|
|
|
|
case RIG_VFO_MEM: vfo_function = '2'; break;
|
|
|
|
default:
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n",
|
|
|
|
__func__, txvfo);
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2005-09-24 07:48:42 +00:00
|
|
|
/* set TX VFO */
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
sprintf(cmdbuf, "FT%c", vfo_function);
|
2009-02-02 07:29:11 +00:00
|
|
|
retval = kenwood_simple_cmd(rig, cmdbuf);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2009-06-23 20:55:58 +00:00
|
|
|
|
|
|
|
/* Remember whether split is on, for kenwood_set_vfo */
|
|
|
|
priv->split = split;
|
2005-01-31 16:41:49 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2004-02-14 16:50:54 +00:00
|
|
|
}
|
2002-07-10 21:45:44 +00:00
|
|
|
|
2009-01-29 22:54:41 +00:00
|
|
|
int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo)
|
|
|
|
{
|
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
2009-06-23 20:55:58 +00:00
|
|
|
int retval;
|
2009-01-29 22:54:41 +00:00
|
|
|
|
|
|
|
retval = kenwood_get_if(rig);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
|
|
|
switch (priv->info[32]) {
|
|
|
|
case '0':
|
|
|
|
*split = RIG_SPLIT_OFF;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '1':
|
|
|
|
*split = RIG_SPLIT_ON;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported split %c\n",
|
|
|
|
__func__, priv->info[32]);
|
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
|
2009-06-23 20:55:58 +00:00
|
|
|
/* Remember whether split is on, for kenwood_set_vfo */
|
|
|
|
priv->split = *split;
|
|
|
|
|
2009-01-29 22:54:41 +00:00
|
|
|
/* TODO: find where is the txvfo.. */
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
* kenwood_get_vfo_if using byte 31 of the IF information field
|
2001-05-15 22:05:26 +00:00
|
|
|
* Assumes rig!=NULL, !vfo
|
|
|
|
*/
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo)
|
2001-05-15 22:05:26 +00:00
|
|
|
{
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = kenwood_get_if(rig);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
switch (priv->info[30]) {
|
|
|
|
case '0':
|
|
|
|
*vfo = RIG_VFO_A;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '1':
|
|
|
|
*vfo = RIG_VFO_B;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '2':
|
|
|
|
*vfo = RIG_VFO_MEM;
|
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
default:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %c\n",
|
|
|
|
__func__, priv->info[30]);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
return RIG_OK;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
2003-06-23 17:48:27 +00:00
|
|
|
|
2000-12-23 08:40:14 +00:00
|
|
|
/*
|
|
|
|
* kenwood_set_freq
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char freqbuf[16];
|
2006-03-07 19:48:20 +00:00
|
|
|
unsigned char vfo_letter;
|
|
|
|
vfo_t tvfo;
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2010-04-05 13:43:38 +00:00
|
|
|
tvfo = (vfo==RIG_VFO_CURR || vfo==RIG_VFO_VFO) ? rig->state.current_vfo : vfo;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
switch (tvfo) {
|
|
|
|
case RIG_VFO_A: vfo_letter = 'A'; break;
|
|
|
|
case RIG_VFO_B: vfo_letter = 'B'; break;
|
|
|
|
case RIG_VFO_C: vfo_letter = 'C'; break;
|
|
|
|
default:
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n",
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
__func__, vfo);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(freqbuf, "F%c%011ld", vfo_letter, (long)freq);
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, freqbuf);
|
2000-12-23 08:40:14 +00:00
|
|
|
}
|
|
|
|
|
2009-01-29 22:54:41 +00:00
|
|
|
int kenwood_get_freq_if(RIG *rig, vfo_t vfo, freq_t *freq)
|
|
|
|
{
|
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
|
|
|
|
|
|
|
char freqbuf[50];
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
retval = kenwood_get_if(rig);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
|
|
|
memcpy(freqbuf, priv->info, 15);
|
|
|
|
freqbuf[14] = '\0';
|
|
|
|
sscanf(freqbuf + 2, "%"SCNfreq, freq);
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2000-12-23 08:40:14 +00:00
|
|
|
/*
|
|
|
|
* kenwood_get_freq
|
|
|
|
* Assumes rig!=NULL, freq!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|
|
|
{
|
2006-03-07 19:48:20 +00:00
|
|
|
char freqbuf[50];
|
|
|
|
char cmdbuf[4];
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int retval;
|
2006-03-07 19:48:20 +00:00
|
|
|
unsigned char vfo_letter;
|
|
|
|
vfo_t tvfo;
|
2005-09-24 07:48:42 +00:00
|
|
|
|
2010-04-05 13:43:38 +00:00
|
|
|
tvfo = (vfo == RIG_VFO_CURR || vfo==RIG_VFO_VFO) ? rig->state.current_vfo : vfo;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
/* memory frequency cannot be read with an Fx command, use IF */
|
|
|
|
if (tvfo == RIG_VFO_MEM) {
|
|
|
|
|
2009-01-29 22:54:41 +00:00
|
|
|
return kenwood_get_freq_if(rig, vfo, freq);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
}
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
switch (tvfo) {
|
|
|
|
case RIG_VFO_A: vfo_letter = 'A'; break;
|
|
|
|
case RIG_VFO_B: vfo_letter = 'B'; break;
|
|
|
|
case RIG_VFO_C: vfo_letter = 'C'; break;
|
|
|
|
default:
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n",
|
2009-02-03 23:22:58 +00:00
|
|
|
__func__, vfo);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2000-12-23 08:40:14 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
sprintf(cmdbuf, "F%c", vfo_letter);
|
2002-03-13 23:42:43 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, cmdbuf, freqbuf, 50, 14);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
sscanf(freqbuf+2, "%"SCNfreq, freq);
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2000-12-23 08:40:14 +00:00
|
|
|
}
|
|
|
|
|
2002-09-03 18:55:05 +00:00
|
|
|
int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t * rit)
|
|
|
|
{
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char buf[6];
|
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
2002-09-03 18:55:05 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = kenwood_get_if(rig);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2002-09-03 18:55:05 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
memcpy(buf, &priv->info[18], 5);
|
2002-09-03 18:55:05 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
buf[5] = '\0';
|
|
|
|
*rit = atoi(buf);
|
2002-09-03 18:55:05 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2002-09-03 18:55:05 +00:00
|
|
|
}
|
|
|
|
|
2002-09-04 14:36:11 +00:00
|
|
|
/*
|
|
|
|
* rit can only move up/down by 10 Hz, so we use a loop...
|
|
|
|
*/
|
2002-09-03 18:55:05 +00:00
|
|
|
int kenwood_set_rit(RIG * rig, vfo_t vfo, shortfreq_t rit)
|
|
|
|
{
|
2009-02-13 19:29:16 +00:00
|
|
|
char buf[4];
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int retval, i;
|
2009-02-13 19:29:16 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (rit == 0)
|
2009-02-03 11:25:30 +00:00
|
|
|
return kenwood_simple_cmd(rig, "RC");
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(buf, "R%c", (rit > 0) ? 'U' : 'D');
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_simple_cmd(rig, "RC");
|
2009-02-13 19:29:16 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
2002-10-22 20:24:07 +00:00
|
|
|
for (i = 0; i < abs(rint(rit/10)); i++)
|
2009-02-02 07:29:11 +00:00
|
|
|
retval = kenwood_simple_cmd(rig, buf);
|
2002-09-03 18:55:05 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return retval;
|
2002-09-03 18:55:05 +00:00
|
|
|
}
|
|
|
|
|
2002-09-04 17:32:42 +00:00
|
|
|
/*
|
|
|
|
* rit and xit are the same
|
|
|
|
*/
|
|
|
|
int kenwood_get_xit(RIG * rig, vfo_t vfo, shortfreq_t * rit)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return kenwood_get_rit(rig, vfo, rit);
|
2002-09-04 17:32:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int kenwood_set_xit(RIG * rig, vfo_t vfo, shortfreq_t rit)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return kenwood_set_rit(rig, vfo, rit);
|
2002-09-04 17:32:42 +00:00
|
|
|
}
|
|
|
|
|
2004-05-02 17:17:31 +00:00
|
|
|
int kenwood_scan(RIG * rig, vfo_t vfo, scan_t scan, int ch)
|
|
|
|
{
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig,
|
2009-02-13 19:29:16 +00:00
|
|
|
scan == RIG_SCAN_STOP ? "SC0" : "SC1");
|
2004-05-02 17:17:31 +00:00
|
|
|
}
|
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
/*
|
|
|
|
* 000 No select
|
|
|
|
* 002 FM Wide
|
|
|
|
* 003 FM Narrow
|
|
|
|
* 005 AM
|
|
|
|
* 007 SSB
|
|
|
|
* 009 CW
|
|
|
|
* 010 CW NARROW
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* XXX revise */
|
2009-02-02 20:30:36 +00:00
|
|
|
static int kenwood_set_filter(RIG *rig, pbwidth_t width)
|
|
|
|
{
|
|
|
|
char *cmd;
|
|
|
|
|
|
|
|
if (width <= Hz(250))
|
|
|
|
cmd = "FL010009";
|
|
|
|
else if(width <= Hz(500))
|
|
|
|
cmd = "FL009009";
|
|
|
|
else if(width <= kHz(2.7))
|
|
|
|
cmd = "FL007007";
|
|
|
|
else if(width <= kHz(6))
|
|
|
|
cmd = "FL005005";
|
|
|
|
else
|
|
|
|
cmd = "FL002002";
|
|
|
|
|
|
|
|
return kenwood_simple_cmd(rig, cmd);
|
|
|
|
}
|
|
|
|
|
2000-12-23 08:40:14 +00:00
|
|
|
/*
|
|
|
|
* kenwood_set_mode
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
2009-02-02 20:30:36 +00:00
|
|
|
char buf[6];
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char kmode;
|
2009-02-02 20:30:36 +00:00
|
|
|
int err;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
kmode = rmode2kenwood(mode, caps->mode_table);
|
|
|
|
if (kmode < 0 ) {
|
|
|
|
rig_debug(RIG_DEBUG_WARN, "%s: unsupported mode '%s'\n",
|
2009-02-03 22:33:00 +00:00
|
|
|
__func__, rig_strrmode(mode));
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return -RIG_EINVAL;
|
2005-09-24 07:48:42 +00:00
|
|
|
}
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "MD%c", '0' + kmode);
|
2009-02-02 20:30:36 +00:00
|
|
|
err = kenwood_simple_cmd(rig, buf);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
if (rig->caps->rig_model == RIG_MODEL_TS450S
|
|
|
|
|| rig->caps->rig_model == RIG_MODEL_TS690S
|
|
|
|
|| rig->caps->rig_model == RIG_MODEL_TS850) {
|
|
|
|
|
|
|
|
err = kenwood_set_filter(rig, width);
|
|
|
|
/* non fatal */
|
|
|
|
}
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int kenwood_get_filter(RIG *rig, pbwidth_t *width)
|
|
|
|
{
|
|
|
|
int err, f, f1, f2;
|
|
|
|
char buf[10];
|
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
err = kenwood_safe_transaction(rig, "FL", buf, sizeof(buf), 9);
|
2009-02-02 20:30:36 +00:00
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
buf[8] = '\0';
|
|
|
|
f2 = atoi(&buf[5]);
|
|
|
|
|
|
|
|
buf[5] = '\0';
|
|
|
|
f1 = atoi(&buf[2]);
|
|
|
|
|
|
|
|
if (f2 > f1)
|
|
|
|
f = f2;
|
|
|
|
else
|
|
|
|
f = f1;
|
|
|
|
|
|
|
|
switch (f) {
|
|
|
|
case 2:
|
|
|
|
*width = kHz(12);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 5:
|
|
|
|
*width = kHz(6);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
*width = kHz(2.7);
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
*width = Hz(500);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
*width = Hz(250);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return RIG_OK;
|
2000-12-23 08:40:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_get_mode
|
|
|
|
* Assumes rig!=NULL, mode!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
|
|
|
char modebuf[10];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "MD", modebuf, 6, 4);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2000-12-23 08:40:14 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
*mode = kenwood2rmode(modebuf[2] - '0', caps->mode_table);
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
/* XXX ? */
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
*width = rig_passband_normal(rig, *mode);
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is used when the radio does not support MD; for mode reading */
|
|
|
|
int kenwood_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
2000-12-23 08:40:14 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
err = kenwood_get_if(rig);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
*mode = kenwood2rmode(priv->info[29] - '0', caps->mode_table);
|
|
|
|
|
|
|
|
*width = rig_passband_normal(rig, *mode);
|
2002-12-20 10:39:41 +00:00
|
|
|
|
2009-02-02 20:30:36 +00:00
|
|
|
if (rig->caps->rig_model == RIG_MODEL_TS450S
|
|
|
|
|| rig->caps->rig_model == RIG_MODEL_TS690S
|
|
|
|
|| rig->caps->rig_model == RIG_MODEL_TS850) {
|
|
|
|
|
|
|
|
err = kenwood_get_filter(rig, width);
|
|
|
|
/* non fatal */
|
|
|
|
}
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2000-12-23 08:40:14 +00:00
|
|
|
}
|
|
|
|
|
2002-01-03 21:42:53 +00:00
|
|
|
int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char levelbuf[16];
|
2005-09-24 07:48:42 +00:00
|
|
|
int i, kenwood_val;
|
2002-01-19 18:56:00 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
if (RIG_LEVEL_IS_FLOAT(level))
|
|
|
|
kenwood_val = val.f * 255;
|
|
|
|
else
|
|
|
|
kenwood_val = val.i;
|
2002-01-19 18:56:00 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
switch (level) {
|
|
|
|
case RIG_LEVEL_RFPOWER:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
/* XXX check level range */
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(levelbuf, "PC%03d", kenwood_val);
|
2002-03-25 00:22:41 +00:00
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_AF:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(levelbuf, "AG%03d", kenwood_val);
|
2002-01-19 18:56:00 +00:00
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_RF:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
/* XXX check level range */
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(levelbuf, "RG%03d", kenwood_val);
|
2002-01-19 18:56:00 +00:00
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_SQL:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(levelbuf, "SQ%03d", kenwood_val);
|
2002-01-19 18:56:00 +00:00
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_AGC:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (kenwood_val > 3)
|
|
|
|
kenwood_val = 3; /* 0.. 255 */
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(levelbuf, "GT%03d", 84*kenwood_val);
|
2002-09-15 22:22:39 +00:00
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_ATT:
|
2005-02-02 19:32:16 +00:00
|
|
|
/* set the attenuator if a correct value is entered */
|
2009-02-10 22:48:25 +00:00
|
|
|
if (val.i == 0)
|
|
|
|
sprintf(levelbuf, "RA00");
|
|
|
|
else {
|
|
|
|
for (i=0; i<MAXDBLSTSIZ && rig->state.attenuator[i]; i++) {
|
|
|
|
if (val.i == rig->state.attenuator[i])
|
|
|
|
{
|
|
|
|
sprintf(levelbuf, "RA%02d", i+1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (val.i != rig->state.attenuator[i])
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_LEVEL_PREAMP:
|
|
|
|
/* set the preamp if a correct value is entered */
|
|
|
|
if (val.i == 0)
|
|
|
|
sprintf(levelbuf, "PA0");
|
|
|
|
else {
|
|
|
|
for (i=0; i<MAXDBLSTSIZ && rig->state.preamp[i]; i++) {
|
|
|
|
if (val.i == rig->state.preamp[i])
|
|
|
|
{
|
|
|
|
sprintf(levelbuf, "PA%01d", i+1);
|
|
|
|
break;
|
|
|
|
}
|
2005-02-02 19:32:16 +00:00
|
|
|
}
|
2009-02-10 22:48:25 +00:00
|
|
|
if (val.i != rig->state.preamp[i])
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2005-02-02 19:32:16 +00:00
|
|
|
break;
|
|
|
|
|
2007-08-18 12:55:46 +00:00
|
|
|
case RIG_LEVEL_SLOPE_HIGH:
|
|
|
|
if(val.i>20 || val.i < 0)
|
|
|
|
return -RIG_EINVAL;
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(levelbuf, "SH%02d",(val.i));
|
2007-08-18 12:55:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_LEVEL_SLOPE_LOW:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if(val.i>20 || val.i < 0)
|
2007-08-18 12:55:46 +00:00
|
|
|
return -RIG_EINVAL;
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(levelbuf, "SL%02d",(val.i));
|
2007-08-18 12:55:46 +00:00
|
|
|
break;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
case RIG_LEVEL_CWPITCH:
|
|
|
|
if(val.i > 1000 || val.i < 400)
|
|
|
|
return -RIG_EINVAL;
|
2009-02-03 22:33:00 +00:00
|
|
|
sprintf(levelbuf, "PT%02d", (val.i / 50) - 8);
|
|
|
|
break;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2009-02-10 22:48:25 +00:00
|
|
|
case RIG_LEVEL_KEYSPD:
|
|
|
|
if(val.i > 50 || val.i < 5)
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
sprintf(levelbuf, "KS%03d", val.i);
|
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
default:
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "Unsupported set_level %d", level);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2002-01-19 18:56:00 +00:00
|
|
|
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, levelbuf);
|
2002-01-03 21:42:53 +00:00
|
|
|
}
|
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
|
|
|
* assumes f!=NULL
|
|
|
|
*/
|
2005-02-02 20:05:03 +00:00
|
|
|
int get_kenwood_level(RIG *rig, const char *cmd, int cmd_len, float *f)
|
2001-05-15 22:05:26 +00:00
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char lvlbuf[10];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
int lvl;
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, cmd, lvlbuf, 10, 6);
|
2001-06-12 07:07:11 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
/* 000..255 */
|
2001-05-15 22:05:26 +00:00
|
|
|
sscanf(lvlbuf+2, "%d", &lvl);
|
|
|
|
*f = (float)lvl/255.0;
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_get_level
|
|
|
|
* Assumes rig!=NULL, val!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|
|
|
{
|
2006-03-07 19:48:20 +00:00
|
|
|
char lvlbuf[50];
|
|
|
|
int retval;
|
2005-09-24 07:48:42 +00:00
|
|
|
int lvl;
|
|
|
|
int i, ret, agclevel;
|
2006-03-07 19:48:20 +00:00
|
|
|
size_t lvl_len;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
switch (level) {
|
2005-09-28 21:14:44 +00:00
|
|
|
case RIG_LEVEL_RAWSTR:
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "SM", lvlbuf, 10, 7);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
/* XXX atoi ? */
|
|
|
|
sscanf(lvlbuf+2, "%d", &val->i); /* rawstr */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_LEVEL_STRENGTH:
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "SM", lvlbuf, 10, 7);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-28 21:14:44 +00:00
|
|
|
sscanf(lvlbuf+2, "%d", &val->i); /* rawstr */
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (rig->caps->str_cal.size)
|
|
|
|
val->i = (int) rig_raw2val(val->i, &rig->caps->str_cal);
|
|
|
|
else
|
|
|
|
val->i = (val->i * 4) - 54;
|
2005-09-24 07:48:42 +00:00
|
|
|
break;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_ATT:
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "RA", lvlbuf, 50, 5);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
sscanf(lvlbuf+2, "%d", &lvl);
|
|
|
|
if (lvl == 0) {
|
|
|
|
val->i = 0;
|
|
|
|
} else {
|
2009-02-10 22:48:25 +00:00
|
|
|
for (i=0; i<lvl && i<MAXDBLSTSIZ; i++) {
|
2005-09-24 07:48:42 +00:00
|
|
|
if (rig->state.attenuator[i] == 0) {
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: "
|
2005-09-28 21:14:44 +00:00
|
|
|
"unexpected att level %d\n",
|
2009-02-03 23:22:58 +00:00
|
|
|
__func__, lvl);
|
2005-09-28 21:14:44 +00:00
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
2009-02-10 22:48:25 +00:00
|
|
|
}
|
|
|
|
if (i != lvl)
|
|
|
|
return -RIG_EINTERNAL;
|
|
|
|
val->i = rig->state.attenuator[i-1];
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_LEVEL_PREAMP:
|
|
|
|
retval = kenwood_safe_transaction(rig, "PA", lvlbuf, 50, 4);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
|
|
|
if (lvlbuf[2] == '0')
|
|
|
|
val->i = 0;
|
|
|
|
else if (isdigit(lvlbuf[2])) {
|
|
|
|
lvl = lvlbuf[2]-'0';
|
|
|
|
for (i=0; i<lvl && i<MAXDBLSTSIZ; i++) {
|
|
|
|
if (rig->state.preamp[i] == 0) {
|
|
|
|
rig_debug(RIG_DEBUG_ERR,"%s: "
|
|
|
|
"unexpected preamp level %d\n",
|
|
|
|
__func__, lvl);
|
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i != lvl)
|
|
|
|
return -RIG_EINTERNAL;
|
|
|
|
val->i = rig->state.preamp[i-1];
|
|
|
|
} else {
|
|
|
|
rig_debug(RIG_DEBUG_ERR,"%s: "
|
|
|
|
"unexpected preamp char '%c'\n",
|
|
|
|
__func__, lvlbuf[2]);
|
|
|
|
return -RIG_EPROTO;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
2005-09-24 07:48:42 +00:00
|
|
|
break;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_RFPOWER:
|
2009-02-03 11:25:30 +00:00
|
|
|
return get_kenwood_level(rig, "PC", 3, &val->f);
|
2005-09-24 07:48:42 +00:00
|
|
|
|
|
|
|
case RIG_LEVEL_AF:
|
2009-02-03 11:25:30 +00:00
|
|
|
return get_kenwood_level(rig, "AG", 3, &val->f);
|
2005-09-24 07:48:42 +00:00
|
|
|
|
|
|
|
case RIG_LEVEL_RF:
|
2009-02-03 11:25:30 +00:00
|
|
|
return get_kenwood_level(rig, "RG", 3, &val->f);
|
2005-09-24 07:48:42 +00:00
|
|
|
|
|
|
|
case RIG_LEVEL_SQL:
|
2009-02-03 11:25:30 +00:00
|
|
|
return get_kenwood_level(rig, "SQ", 3, &val->f);
|
2005-09-24 07:48:42 +00:00
|
|
|
|
|
|
|
case RIG_LEVEL_MICGAIN:
|
2009-02-03 11:25:30 +00:00
|
|
|
return get_kenwood_level(rig, "MG", 3, &val->f);
|
2005-09-24 07:48:42 +00:00
|
|
|
|
|
|
|
case RIG_LEVEL_AGC:
|
2009-02-03 11:25:30 +00:00
|
|
|
ret = get_kenwood_level(rig, "GT", 3, &val->f);
|
2005-09-24 07:48:42 +00:00
|
|
|
agclevel = 255 * val->f;
|
|
|
|
if (agclevel == 0) val->i = 0;
|
|
|
|
else if (agclevel < 85) val->i = 1;
|
|
|
|
else if (agclevel < 170) val->i = 2;
|
|
|
|
else if (agclevel <= 255) val->i = 3;
|
|
|
|
return ret;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2007-08-18 12:55:46 +00:00
|
|
|
case RIG_LEVEL_SLOPE_LOW:
|
|
|
|
lvl_len = 50;
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_transaction (rig, "SL", 3, lvlbuf, &lvl_len);
|
2007-08-18 12:55:46 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
lvlbuf[4]='\0';
|
|
|
|
val->i=atoi(&lvlbuf[2]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_LEVEL_SLOPE_HIGH:
|
|
|
|
lvl_len = 50;
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_transaction (rig, "SH", 3, lvlbuf, &lvl_len);
|
2007-08-18 12:55:46 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
lvlbuf[4]='\0';
|
|
|
|
val->i=atoi(&lvlbuf[2]);
|
|
|
|
break;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
case RIG_LEVEL_CWPITCH:
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "PT", lvlbuf, 50, 5);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
|
|
|
sscanf(lvlbuf+2, "%d", &val->i);
|
|
|
|
val->i = (val->i * 1000) + 1000; /* 00 - 08 */
|
|
|
|
break;
|
|
|
|
|
2009-02-10 22:48:25 +00:00
|
|
|
case RIG_LEVEL_KEYSPD:
|
|
|
|
retval = kenwood_safe_transaction(rig, "KS", lvlbuf, 50, 6);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
|
|
|
sscanf(lvlbuf+2, "%d", &val->i);
|
|
|
|
break;
|
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_LEVEL_IF:
|
|
|
|
case RIG_LEVEL_APF:
|
|
|
|
case RIG_LEVEL_NR:
|
|
|
|
case RIG_LEVEL_PBT_IN:
|
|
|
|
case RIG_LEVEL_PBT_OUT:
|
|
|
|
case RIG_LEVEL_NOTCHF:
|
|
|
|
case RIG_LEVEL_COMP:
|
|
|
|
case RIG_LEVEL_BKINDL:
|
|
|
|
case RIG_LEVEL_BALANCE:
|
|
|
|
return -RIG_ENIMPL;
|
|
|
|
|
|
|
|
default:
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "Unsupported get_level %d", level);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
2002-01-03 21:42:53 +00:00
|
|
|
int kenwood_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
|
|
|
{
|
2009-02-13 19:29:16 +00:00
|
|
|
char buf[6]; /* longest cmd is GTxxx */
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
switch (func) {
|
|
|
|
case RIG_FUNC_NB:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "NB%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_ABM:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "AM%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_COMP:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "PR%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_TONE:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "TO%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_TSQL:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "CT%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_VOX:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "VX%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_FAGC:
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(buf, "GT00%c", (status == 0) ? '4' : '2');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2005-02-13 00:22:00 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_NR:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "NR%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_BC:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "BC%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_ANF:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "NT%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2002-01-09 23:14:48 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_LOCK:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "LK%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2007-08-18 12:55:46 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
case RIG_FUNC_AIP:
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "MX%c", (status == 0) ? '0' : '1');
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
default:
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "Unsupported set_func %#x", func);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2002-01-09 23:14:48 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return -RIG_EINVAL;
|
2002-01-03 21:42:53 +00:00
|
|
|
}
|
|
|
|
|
2001-06-30 23:19:42 +00:00
|
|
|
/*
|
|
|
|
* assumes status!=NULL
|
|
|
|
* works for any 'format 1' command
|
2009-02-03 22:47:33 +00:00
|
|
|
* answer is always 4 bytes: two byte command id, status and terminator
|
2001-06-30 23:19:42 +00:00
|
|
|
*/
|
2009-02-03 22:47:33 +00:00
|
|
|
static int get_kenwood_func(RIG *rig, const char *cmd, int *status)
|
2001-06-30 23:19:42 +00:00
|
|
|
{
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char buf[10];
|
2001-06-30 23:19:42 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, cmd, buf, 10, 4);
|
2001-06-30 23:19:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
*status = buf[2] == '0' ? 0 : 1;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_get_func
|
|
|
|
* Assumes rig!=NULL, val!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char fctbuf[20];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
switch (func) {
|
|
|
|
case RIG_FUNC_FAGC:
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "GT", fctbuf, 20, 6);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
*status = fctbuf[4] != '4' ? 1 : 0;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return RIG_OK;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_NB:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "NB", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_ABM:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "AM", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_COMP:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "PR", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_TONE:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "TO", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_TSQL:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "CT", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_VOX:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "VX", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_NR:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "NR", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
/* FIXME on TS2000 */
|
|
|
|
case RIG_FUNC_BC:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "BC", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_ANF:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "NT", status);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
case RIG_FUNC_LOCK:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "LK", status);
|
2005-09-24 07:48:42 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
case RIG_FUNC_AIP:
|
2009-02-03 22:47:33 +00:00
|
|
|
return get_kenwood_func(rig, "MX", status);
|
2009-02-06 14:15:12 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
default:
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "Unsupported get_func %#x", func);
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return -RIG_EINVAL;
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
2001-07-01 11:46:17 +00:00
|
|
|
* kenwood_set_ctcss_tone
|
2001-05-15 22:05:26 +00:00
|
|
|
* Assumes rig!=NULL, rig->caps->ctcss_list != NULL
|
|
|
|
*
|
|
|
|
* Warning! This is untested stuff! May work at least on TS-870S
|
2001-12-11 21:58:37 +00:00
|
|
|
* Please owners report to me <fillods@users.sourceforge.net>, thanks. --SF
|
2001-05-15 22:05:26 +00:00
|
|
|
|
|
|
|
* TODO: TS-2000 uses CN/CT
|
|
|
|
*/
|
2001-07-01 11:46:17 +00:00
|
|
|
int kenwood_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
2001-05-15 22:05:26 +00:00
|
|
|
{
|
|
|
|
const struct rig_caps *caps;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char tonebuf[16];
|
2001-05-15 22:05:26 +00:00
|
|
|
int i;
|
2006-03-07 19:48:20 +00:00
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
caps = rig->caps;
|
|
|
|
|
2001-05-22 21:59:26 +00:00
|
|
|
/* TODO: replace 200 by something like RIGTONEMAX */
|
2001-05-15 22:05:26 +00:00
|
|
|
for (i = 0; caps->ctcss_list[i] != 0 && i<200; i++) {
|
2005-09-24 07:48:42 +00:00
|
|
|
if (caps->ctcss_list[i] == tone)
|
|
|
|
break;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
if (caps->ctcss_list[i] != tone)
|
2005-09-24 07:48:42 +00:00
|
|
|
return -RIG_EINVAL;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
|
|
|
/* TODO: replace menu no 57 by a define */
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(tonebuf, "EX%03d%04d", 57, i+1);
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, tonebuf);
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
2009-02-03 23:42:53 +00:00
|
|
|
int kenwood_set_ctcss_tone_tn(RIG *rig, vfo_t vfo, tone_t tone)
|
|
|
|
{
|
|
|
|
const struct rig_caps *caps = rig->caps;
|
|
|
|
char buf[6];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* XXX 38 is a fixed constant */
|
|
|
|
for (i = 0; caps->ctcss_list[i] != 0 && i < 38; i++) {
|
|
|
|
if (tone == caps->ctcss_list[i])
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tone != caps->ctcss_list[i])
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
|
|
|
|
sprintf(buf, "TN%02d", i + 1);
|
|
|
|
|
|
|
|
return kenwood_simple_cmd(rig, buf);
|
|
|
|
}
|
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
2001-07-01 11:46:17 +00:00
|
|
|
* kenwood_get_ctcss_tone
|
2001-05-15 22:05:26 +00:00
|
|
|
* Assumes rig!=NULL, rig->state.priv!=NULL
|
|
|
|
*/
|
2001-07-01 11:46:17 +00:00
|
|
|
int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
|
2001-05-15 22:05:26 +00:00
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
2001-05-15 22:05:26 +00:00
|
|
|
const struct rig_caps *caps;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char tonebuf[3];
|
2006-03-07 19:48:20 +00:00
|
|
|
int i, retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
unsigned int tone_idx;
|
2006-03-07 19:48:20 +00:00
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
caps = rig->caps;
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = kenwood_get_if(rig);
|
2001-06-12 07:07:11 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
memcpy(tonebuf, &priv->info[34], 2);
|
2001-05-15 22:05:26 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
tonebuf[2] = '\0';
|
|
|
|
tone_idx = atoi(tonebuf);
|
2001-05-15 22:05:26 +00:00
|
|
|
|
|
|
|
if (tone_idx == 0) {
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS tone is zero (%s)\n",
|
|
|
|
__func__, tonebuf);
|
|
|
|
return -RIG_EPROTO;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* check this tone exists. That's better than nothing. */
|
|
|
|
for (i = 0; i<tone_idx; i++) {
|
|
|
|
if (caps->ctcss_list[i] == 0) {
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS NG (%04d)\n",
|
|
|
|
__func__, tone_idx);
|
2001-05-15 22:05:26 +00:00
|
|
|
return -RIG_EPROTO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*tone = caps->ctcss_list[tone_idx-1];
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2008-03-01 11:20:30 +00:00
|
|
|
/*
|
|
|
|
* set the aerial/antenna to use
|
|
|
|
*/
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int kenwood_set_ant(RIG * rig, vfo_t vfo, ant_t ant)
|
2008-03-01 11:20:30 +00:00
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
const char *cmd;
|
2008-03-01 11:20:30 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
switch (ant) {
|
|
|
|
case RIG_ANT_1:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN1";
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
break;
|
|
|
|
case RIG_ANT_2:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN2";
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
break;
|
|
|
|
case RIG_ANT_3:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN3";
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
break;
|
|
|
|
case RIG_ANT_4:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN4";
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-03-01 11:20:30 +00:00
|
|
|
return -RIG_EINVAL;
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
}
|
2008-03-01 11:20:30 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return kenwood_simple_transaction(rig, cmd, 4);
|
2008-03-01 11:20:30 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 07:30:35 +00:00
|
|
|
int kenwood_set_ant_no_ack(RIG * rig, vfo_t vfo, ant_t ant)
|
|
|
|
{
|
|
|
|
const char *cmd;
|
|
|
|
|
|
|
|
switch (ant) {
|
|
|
|
case RIG_ANT_1:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN1";
|
2009-02-02 07:30:35 +00:00
|
|
|
break;
|
|
|
|
case RIG_ANT_2:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN2";
|
2009-02-02 07:30:35 +00:00
|
|
|
break;
|
|
|
|
case RIG_ANT_3:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN3";
|
2009-02-02 07:30:35 +00:00
|
|
|
break;
|
|
|
|
case RIG_ANT_4:
|
2009-02-03 11:25:30 +00:00
|
|
|
cmd = "AN4";
|
2009-02-02 07:30:35 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return kenwood_simple_cmd(rig, cmd);
|
|
|
|
}
|
|
|
|
|
2008-03-01 11:20:30 +00:00
|
|
|
/*
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
* get the aerial/antenna in use
|
2008-03-01 11:20:30 +00:00
|
|
|
*/
|
|
|
|
int kenwood_get_ant (RIG * rig, vfo_t vfo, ant_t * ant)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char ackbuf[6];
|
|
|
|
int retval;
|
2008-03-01 11:20:30 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "AN", ackbuf, 6, 4);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
|
|
|
if (ackbuf[2] < '1' || ackbuf[2] > '9')
|
|
|
|
return -RIG_EPROTO;
|
2008-03-01 11:20:30 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
*ant = RIG_ANT_N(ackbuf[2]-'1');
|
2008-03-01 11:20:30 +00:00
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
/* XXX check that the returned antenna is valid for the current rig */
|
2008-03-01 11:20:30 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return RIG_OK;
|
2008-03-01 11:20:30 +00:00
|
|
|
}
|
|
|
|
|
2002-02-18 18:26:08 +00:00
|
|
|
/*
|
|
|
|
* kenwood_get_ptt
|
|
|
|
* Assumes rig!=NULL, ptt!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2002-02-18 18:26:08 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
retval = kenwood_get_if(rig);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2002-02-18 18:26:08 +00:00
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
*ptt = priv->info[28] == '0' ? RIG_PTT_OFF : RIG_PTT_ON;
|
2002-02-18 18:26:08 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2002-02-18 18:26:08 +00:00
|
|
|
}
|
|
|
|
|
2004-05-02 17:17:31 +00:00
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
|
|
|
* kenwood_set_ptt
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
2001-05-22 21:59:26 +00:00
|
|
|
int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
2001-05-15 22:05:26 +00:00
|
|
|
{
|
2009-02-02 07:30:35 +00:00
|
|
|
return kenwood_simple_cmd(rig,
|
2009-02-09 20:59:31 +00:00
|
|
|
(ptt == RIG_PTT_ON) ? "TX" : "RX");
|
|
|
|
}
|
|
|
|
|
|
|
|
int kenwood_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
ptt_t current_ptt;
|
|
|
|
|
|
|
|
err = kenwood_get_ptt(rig, vfo, ¤t_ptt);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
if (current_ptt == ptt)
|
|
|
|
return RIG_OK;
|
|
|
|
|
|
|
|
return kenwood_simple_cmd(rig,
|
|
|
|
(ptt == RIG_PTT_ON) ? "TX" : "RX");
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_get_dcd
|
|
|
|
* Assumes rig!=NULL, dcd!=NULL
|
|
|
|
*/
|
2001-05-22 21:59:26 +00:00
|
|
|
int kenwood_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
2001-05-15 22:05:26 +00:00
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char busybuf[10];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "BY", busybuf, 10, 4);
|
2001-06-12 07:07:11 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2009-01-29 22:54:41 +00:00
|
|
|
*dcd = (busybuf[2] == '1') ? RIG_DCD_ON : RIG_DCD_OFF;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2001-03-04 13:08:33 +00:00
|
|
|
/*
|
|
|
|
* kenwood_set_trn
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
2001-12-20 07:46:13 +00:00
|
|
|
int kenwood_set_trn(RIG *rig, int trn)
|
2001-03-04 13:08:33 +00:00
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return kenwood_simple_transaction(rig,
|
2009-02-03 11:25:30 +00:00
|
|
|
(trn == RIG_TRN_RIG) ? "AI1" : "AI0", 4);
|
2001-03-04 13:08:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_get_trn
|
|
|
|
* Assumes rig!=NULL, trn!=NULL
|
|
|
|
*/
|
2001-12-20 07:46:13 +00:00
|
|
|
int kenwood_get_trn(RIG *rig, int *trn)
|
2001-03-04 13:08:33 +00:00
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char trnbuf[6];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2001-03-04 13:08:33 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "AI", trnbuf, 6, 4);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
*trn = trnbuf[2] != '0' ? RIG_TRN_RIG : RIG_TRN_OFF;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_set_powerstat
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_set_powerstat(RIG *rig, powerstat_t status)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
return kenwood_simple_transaction(rig,
|
2009-02-03 11:25:30 +00:00
|
|
|
(status == RIG_POWER_ON) ? "PS1" : "PS0", 4);
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_get_powerstat
|
|
|
|
* Assumes rig!=NULL, trn!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_get_powerstat(RIG *rig, powerstat_t *status)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char pwrbuf[6];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "PS", pwrbuf, 6, 4);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
*status = pwrbuf[2] == '0' ? RIG_POWER_OFF : RIG_POWER_ON;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
2001-03-04 13:08:33 +00:00
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
|
|
|
* kenwood_reset
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_reset(RIG *rig, reset_t reset)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char rstbuf[6];
|
2005-09-24 07:48:42 +00:00
|
|
|
char rst;
|
|
|
|
|
|
|
|
switch(reset) {
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
case RIG_RESET_VFO:
|
|
|
|
rst = '1';
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIG_RESET_MASTER:
|
|
|
|
rst = '2';
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported reset %d\n",
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
__func__, reset);
|
|
|
|
return -RIG_EINVAL;
|
2005-09-24 07:48:42 +00:00
|
|
|
}
|
2001-03-04 13:08:33 +00:00
|
|
|
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(rstbuf, "SR%c", rst);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
/* this command has no answer */
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, rstbuf);
|
2001-03-04 13:08:33 +00:00
|
|
|
}
|
|
|
|
|
2001-05-15 22:05:26 +00:00
|
|
|
/*
|
|
|
|
* kenwood_send_morse
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char morsebuf[30], m2[30];
|
2005-09-24 07:48:42 +00:00
|
|
|
int msg_len, buff_len, retval;
|
|
|
|
const char *p;
|
|
|
|
|
|
|
|
p = msg;
|
|
|
|
msg_len = strlen(msg);
|
|
|
|
|
|
|
|
while(msg_len > 0) {
|
|
|
|
/*
|
2009-02-03 11:25:30 +00:00
|
|
|
* TODO: check with "KY" if char buffer is available.
|
2005-09-24 07:48:42 +00:00
|
|
|
* if not, sleep.
|
|
|
|
*
|
|
|
|
* Make the total message segments 28 characters
|
|
|
|
* in length because Kenwood demands it.
|
|
|
|
* Spaces fill in the message end.
|
|
|
|
*/
|
|
|
|
buff_len = msg_len > 24 ? 24 : msg_len;
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
strncpy(m2, p, 24);
|
|
|
|
m2[24] = '\0';
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
/* the command must consist of 28 bytes */
|
2009-02-13 19:29:16 +00:00
|
|
|
sprintf(morsebuf, "KY %-24s", m2);
|
2009-02-02 07:29:11 +00:00
|
|
|
retval = kenwood_simple_cmd(rig, morsebuf);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
|
|
|
|
|
|
|
msg_len -= buff_len;
|
|
|
|
p += buff_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
return RIG_OK;
|
2001-05-15 22:05:26 +00:00
|
|
|
}
|
|
|
|
|
2001-06-30 23:19:42 +00:00
|
|
|
/*
|
|
|
|
* kenwood_vfo_op
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
|
|
|
{
|
2005-09-24 07:48:42 +00:00
|
|
|
switch(op) {
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
case RIG_OP_UP:
|
2009-02-13 19:29:16 +00:00
|
|
|
return kenwood_simple_cmd(rig, "UP");
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
case RIG_OP_DOWN:
|
2009-02-13 19:29:16 +00:00
|
|
|
return kenwood_simple_cmd(rig, "DN");
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
case RIG_OP_BAND_UP:
|
2009-02-13 19:34:21 +00:00
|
|
|
return kenwood_simple_cmd(rig, "BU");
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
case RIG_OP_BAND_DOWN:
|
2009-02-13 19:34:21 +00:00
|
|
|
return kenwood_simple_cmd(rig, "BD");
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported op %#x\n",
|
|
|
|
__func__, op);
|
|
|
|
return -RIG_EINVAL;
|
2005-09-24 07:48:42 +00:00
|
|
|
}
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_set_mem
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_set_mem(RIG *rig, vfo_t vfo, int ch)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char buf[8];
|
2005-09-24 07:48:42 +00:00
|
|
|
/*
|
|
|
|
* "MCbmm;"
|
|
|
|
* where b is the bank number, mm the memory number.
|
|
|
|
* b can be a space
|
|
|
|
*/
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(buf, "MC %02d", ch);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2009-02-02 07:29:11 +00:00
|
|
|
return kenwood_simple_cmd(rig, buf);
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* kenwood_get_mem
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
int kenwood_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char membuf[10];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
/*
|
|
|
|
* "MCbmm;"
|
|
|
|
* where b is the bank number, mm the memory number.
|
|
|
|
* b can be a space
|
|
|
|
*/
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "MC", membuf, 10, 6);
|
2005-09-24 07:48:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return retval;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
*ch = atoi(membuf+2);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
int kenwood_get_mem_if(RIG *rig, vfo_t vfo, int *ch)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
char buf[4];
|
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
|
|
|
|
|
|
|
err = kenwood_get_if(rig);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
memcpy(buf, &priv->info[26], 2);
|
|
|
|
buf[2] = '\0';
|
|
|
|
|
|
|
|
*ch = atoi(buf);
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int kenwood_get_channel(RIG *rig, channel_t *chan)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
char buf[26];
|
|
|
|
char cmd[8];
|
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
|
|
|
|
|
|
|
/* put channel num in the command string */
|
2009-02-03 11:25:30 +00:00
|
|
|
sprintf(cmd, "MR0 %02d", chan->channel_num);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
err = kenwood_safe_transaction(rig, cmd, buf, 26, 24);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
memset(chan, 0x00, sizeof(channel_t));
|
|
|
|
|
|
|
|
chan->vfo = RIG_VFO_VFO;
|
|
|
|
|
|
|
|
/* MR0 1700005890000510 ;
|
|
|
|
* MRs ccfffffffffffMLTtt ;
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* parse from right to left */
|
2009-02-03 22:45:59 +00:00
|
|
|
|
|
|
|
/* XXX based on the available documentation, there is no command
|
|
|
|
* to read out the filters of a given memory channel. The rig, however,
|
|
|
|
* stores this information.
|
|
|
|
*/
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
2009-01-29 22:54:41 +00:00
|
|
|
if (buf[19] == '0' || buf[19] == ' ')
|
2009-02-03 22:42:44 +00:00
|
|
|
chan->ctcss_tone = 0;
|
|
|
|
else {
|
2009-02-03 22:45:59 +00:00
|
|
|
buf[22] = '\0';
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
if (rig->caps->ctcss_list)
|
2009-02-03 22:42:44 +00:00
|
|
|
chan->ctcss_tone = rig->caps->ctcss_list[atoi(&buf[20])];
|
|
|
|
}
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
|
|
|
|
/* memory lockout */
|
|
|
|
if (buf[18] == '1')
|
|
|
|
chan->flags |= RIG_CHFLAG_SKIP;
|
|
|
|
|
|
|
|
chan->mode = kenwood2rmode(buf[17] - '0', caps->mode_table);
|
|
|
|
|
|
|
|
buf[17] = '\0';
|
|
|
|
chan->freq = atoi(&buf[6]);
|
|
|
|
|
|
|
|
if (chan->freq == RIG_FREQ_NONE)
|
|
|
|
return -RIG_ENAVAIL;
|
|
|
|
|
|
|
|
buf[6] = '\0';
|
|
|
|
chan->channel_num = atoi(&buf[4]);
|
|
|
|
|
|
|
|
|
|
|
|
/* split freq */
|
|
|
|
cmd[2] = '1';
|
|
|
|
err = kenwood_safe_transaction(rig, cmd, buf, 26, 24);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
chan->tx_mode = kenwood2rmode(buf[17] - '0', caps->mode_table);
|
|
|
|
|
|
|
|
buf[17] = '\0';
|
|
|
|
chan->tx_freq = atoi(&buf[6]);
|
|
|
|
|
|
|
|
if (chan->freq == chan->tx_freq) {
|
|
|
|
chan->tx_freq = RIG_FREQ_NONE;
|
|
|
|
chan->tx_mode = RIG_MODE_NONE;
|
|
|
|
chan->split = RIG_SPLIT_OFF;
|
|
|
|
} else
|
|
|
|
chan->split = RIG_SPLIT_ON;
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2009-02-10 22:48:25 +00:00
|
|
|
int kenwood_set_channel(RIG *rig, const channel_t *chan)
|
2009-02-03 22:45:59 +00:00
|
|
|
{
|
|
|
|
char buf[26];
|
|
|
|
char mode, tx_mode = 0;
|
|
|
|
int err;
|
|
|
|
int tone = 0;
|
|
|
|
|
|
|
|
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
|
|
|
|
|
|
|
mode = rmode2kenwood(chan->mode, caps->mode_table);
|
|
|
|
if (mode < 0 ) {
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported mode '%s'\n",
|
|
|
|
__func__, rig_strrmode(chan->mode));
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (chan->split == RIG_SPLIT_ON) {
|
|
|
|
tx_mode = rmode2kenwood(chan->tx_mode, caps->mode_table);
|
|
|
|
if (tx_mode < 0 ) {
|
|
|
|
rig_debug(RIG_DEBUG_ERR, "%s: unsupported mode '%s'\n",
|
|
|
|
__func__, rig_strrmode(chan->tx_mode));
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find tone */
|
|
|
|
if (chan->ctcss_tone) {
|
|
|
|
|
|
|
|
for (tone = 0; rig->caps->ctcss_list[tone] != 0; tone++) {
|
|
|
|
if (chan->ctcss_tone == rig->caps->ctcss_list[tone])
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (chan->ctcss_tone != rig->caps->ctcss_list[tone])
|
|
|
|
tone = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sprintf(buf, "MW0 %02d%011d%c%c%c%02d ", /* note the space at the end */
|
|
|
|
chan->channel_num,
|
|
|
|
(int) chan->freq,
|
|
|
|
'0' + mode,
|
|
|
|
(chan->flags & RIG_CHFLAG_SKIP) ? '1' : '0',
|
|
|
|
chan->ctcss_tone ? '1' : '0',
|
|
|
|
chan->ctcss_tone ? (tone + 1) : 0);
|
|
|
|
|
|
|
|
err = kenwood_simple_cmd(rig, buf);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
sprintf(buf, "MW1 %02d%011d%c%c%c%02d ",
|
|
|
|
chan->channel_num,
|
|
|
|
(chan->split == RIG_SPLIT_ON) ? ((int) chan->tx_freq) : 0,
|
|
|
|
(chan->split == RIG_SPLIT_ON) ? ('0' + tx_mode) : '0',
|
|
|
|
(chan->flags & RIG_CHFLAG_SKIP) ? '1' : '0',
|
|
|
|
chan->ctcss_tone ? '1' : '0',
|
|
|
|
chan->ctcss_tone ? (tone + 1) : 0);
|
|
|
|
|
|
|
|
return kenwood_simple_cmd(rig, buf);
|
|
|
|
}
|
|
|
|
|
2009-02-06 14:15:12 +00:00
|
|
|
int kenwood_set_ext_parm(RIG *rig, token_t token, value_t val)
|
|
|
|
{
|
|
|
|
char buf[4];
|
|
|
|
|
|
|
|
switch (token) {
|
|
|
|
case TOK_VOICE:
|
|
|
|
return kenwood_simple_cmd(rig, "VR");
|
|
|
|
|
|
|
|
case TOK_FINE:
|
|
|
|
sprintf(buf, "FS%c", (val.i == 0) ? '0' : '1');
|
|
|
|
return kenwood_simple_cmd(rig, buf);
|
|
|
|
|
|
|
|
case TOK_XIT:
|
|
|
|
sprintf(buf, "XT%c", (val.i == 0) ? '0' : '1');
|
|
|
|
return kenwood_simple_cmd(rig, buf);
|
|
|
|
|
|
|
|
case TOK_RIT:
|
|
|
|
sprintf(buf, "RT%c", (val.i == 0) ? '0' : '1');
|
|
|
|
return kenwood_simple_cmd(rig, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
int kenwood_get_ext_parm(RIG *rig, token_t token, value_t *val)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
struct kenwood_priv_data *priv = rig->state.priv;
|
|
|
|
|
|
|
|
switch (token) {
|
|
|
|
case TOK_FINE:
|
|
|
|
return get_kenwood_func(rig, "FS", &val->i);
|
|
|
|
|
|
|
|
case TOK_XIT:
|
|
|
|
err = kenwood_get_if(rig);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
val->i = (priv->info[24] == '1') ? 1 : 0;
|
|
|
|
return RIG_OK;
|
|
|
|
|
|
|
|
case TOK_RIT:
|
|
|
|
err = kenwood_get_if(rig);
|
|
|
|
if (err != RIG_OK)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
val->i = (priv->info[23] == '1') ? 1 : 0;
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -RIG_ENIMPL;
|
|
|
|
}
|
|
|
|
|
2001-06-30 23:19:42 +00:00
|
|
|
/*
|
|
|
|
* kenwood_get_info
|
|
|
|
* supposed to work only for TS2000...
|
|
|
|
* Assumes rig!=NULL
|
|
|
|
*/
|
|
|
|
const char* kenwood_get_info(RIG *rig)
|
|
|
|
{
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
char firmbuf[10];
|
2006-03-07 19:48:20 +00:00
|
|
|
int retval;
|
|
|
|
|
2009-02-03 11:25:30 +00:00
|
|
|
retval = kenwood_safe_transaction(rig, "TY", firmbuf, 10, 6);
|
2001-06-30 23:19:42 +00:00
|
|
|
if (retval != RIG_OK)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
switch (firmbuf[4]) {
|
2005-09-24 07:48:42 +00:00
|
|
|
case '0': return "Firmware: Overseas type";
|
|
|
|
case '1': return "Firmware: Japanese 100W type";
|
|
|
|
case '2': return "Firmware: Japanese 20W type";
|
|
|
|
default: return "Firmware: unknown";
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-13 23:42:43 +00:00
|
|
|
#define IDBUFSZ 16
|
2001-06-30 23:19:42 +00:00
|
|
|
|
|
|
|
/*
|
2003-03-10 08:26:09 +00:00
|
|
|
* proberigs_kenwood
|
|
|
|
*
|
|
|
|
* Notes:
|
|
|
|
* There's only one rig possible per port.
|
2003-04-16 22:30:43 +00:00
|
|
|
*
|
|
|
|
* rig_model_t probeallrigs_kenwood(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
|
2001-06-30 23:19:42 +00:00
|
|
|
*/
|
2003-04-16 22:30:43 +00:00
|
|
|
DECLARE_PROBERIG_BACKEND(kenwood)
|
2001-06-30 23:19:42 +00:00
|
|
|
{
|
2006-03-07 19:48:20 +00:00
|
|
|
char idbuf[IDBUFSZ];
|
2003-03-15 23:58:41 +00:00
|
|
|
int id_len=-1, i, k_id;
|
|
|
|
int retval=-1;
|
2004-12-20 22:58:19 +00:00
|
|
|
int rates[] = { 115200, 57600, 9600, 4800, 1200, 0 }; /* possible baud rates */
|
2003-03-10 08:26:09 +00:00
|
|
|
int rates_idx;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
|
|
|
if (!port)
|
2003-03-10 08:26:09 +00:00
|
|
|
return RIG_MODEL_NONE;
|
|
|
|
|
|
|
|
if (port->type.rig != RIG_PORT_SERIAL)
|
|
|
|
return RIG_MODEL_NONE;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
|
|
|
port->write_delay = port->post_write_delay = 0;
|
2003-03-10 08:26:09 +00:00
|
|
|
port->parm.serial.stop_bits = 2;
|
2001-06-30 23:19:42 +00:00
|
|
|
port->retry = 1;
|
|
|
|
|
2003-03-10 08:26:09 +00:00
|
|
|
/*
|
|
|
|
* try for all different baud rates
|
|
|
|
*/
|
|
|
|
for (rates_idx = 0; rates[rates_idx]; rates_idx++) {
|
|
|
|
port->parm.serial.rate = rates[rates_idx];
|
|
|
|
port->timeout = 2*1000/rates[rates_idx] + 50;
|
|
|
|
|
|
|
|
retval = serial_open(port);
|
|
|
|
if (retval != RIG_OK)
|
2001-06-30 23:19:42 +00:00
|
|
|
return RIG_MODEL_NONE;
|
2003-03-10 08:26:09 +00:00
|
|
|
|
|
|
|
retval = write_block(port, "ID;", 3);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
id_len = read_string(port, idbuf, IDBUFSZ, ";\r", 2);
|
2003-03-10 08:26:09 +00:00
|
|
|
close(port->fd);
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2003-03-10 08:26:09 +00:00
|
|
|
if (retval != RIG_OK || id_len < 0)
|
|
|
|
continue;
|
|
|
|
}
|
2001-06-30 23:19:42 +00:00
|
|
|
|
2003-03-10 08:26:09 +00:00
|
|
|
if (retval != RIG_OK || id_len < 0 || !strcmp(idbuf, "ID;"))
|
|
|
|
return RIG_MODEL_NONE;
|
2001-06-30 23:19:42 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* reply should be something like 'IDxxx;'
|
|
|
|
*/
|
2001-10-18 20:43:13 +00:00
|
|
|
if (id_len != 5 || id_len != 6) {
|
2005-09-24 07:48:42 +00:00
|
|
|
idbuf[7] = '\0';
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "probe_kenwood: protocol error, "
|
2005-09-24 07:48:42 +00:00
|
|
|
" expected %d, received %d: %s\n",
|
|
|
|
6, id_len, idbuf);
|
|
|
|
return RIG_MODEL_NONE;
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
|
2001-10-18 20:43:13 +00:00
|
|
|
|
|
|
|
/* first, try ID string */
|
|
|
|
for (i=0; kenwood_id_string_list[i].model != RIG_MODEL_NONE; i++) {
|
2005-09-24 07:48:42 +00:00
|
|
|
if (!strncmp(kenwood_id_string_list[i].id, idbuf+2, 16)) {
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "probe_kenwood: "
|
2005-09-24 07:48:42 +00:00
|
|
|
"found %s\n", idbuf+2);
|
|
|
|
if (cfunc)
|
|
|
|
(*cfunc)(port, kenwood_id_string_list[i].model, data);
|
|
|
|
return kenwood_id_string_list[i].model;
|
|
|
|
}
|
2001-10-18 20:43:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* then, try ID numbers */
|
|
|
|
|
2001-06-30 23:19:42 +00:00
|
|
|
k_id = atoi(idbuf+2);
|
|
|
|
|
2002-11-13 20:35:18 +00:00
|
|
|
/*
|
|
|
|
* Elecraft K2 returns same ID as TS570
|
|
|
|
*/
|
|
|
|
if (k_id == 17) {
|
|
|
|
retval = serial_open(port);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return RIG_MODEL_NONE;
|
|
|
|
retval = write_block(port, "K2;", 3);
|
Several Kenwood patches from Alessandro Zummo, azummo-lists@towertech.it
Among the changes:
I finally had the time to build the CAT interface for my TS450 and
discovered a couple of new commands.
MX; MX0; MX1; is used to activate the AIP function
FL; FLXXXYYY; is used to set the filters.
I made a perl script to try every possible two-letters command. If
amyone is interested, at their own risk, just ask.
I've then modified and optimized the kenwood driver:
- moved MD_ defined to .h
- added init/cleanup
- ts450_get_mode -> kenwood_get_mode_if
- support reading memory channel freq within kenwood_get_freq
- added kenwood_safe_transaction as an helper with result len check
- added kenwood_get_if
- added get_level for RIG_LEVEL_CWPITCH
- set/get for RIG_FUNC_AIP
- replaced ts140/680 get_mode and get_freq
- removed the delay on the ts450. it works just fine without it.
=============================
the attached patch requires the first one I sent and
addresses a few remaining issues
- converted 8 spaces to tabs
- added kenwood_mode_table
- added kenwood_simple_transaction helper func
- use kenwood2rmode and rmode2kenwood where possible
- some code cleanup
- use kenwood_safe/simple_transaction where possible
- added kenwood_get_mem_if (ts140,ts450,ts680,ts690,ts850)
- added kenwood_get_channel (ts450,ts850)
- added FUNC_FINE_STEP (commented out, we have no more func slots)
- added LEVEL_CWPITCH (set)
- no reason to have ts850_set_func, ts850_set_level
- ... ts480_get/set_ant, ts480_set_func
- ... ts570_set/get_ant, ts570_get_channel, ts570_get_rit
- ... ts680_set_func
- ... ts790_get_mode, ts790_get_vfo
this patch is a bit more extensive and tested only on the TS450.
feedback will be appreciated.
where I removed code I took care to verify that the generic
code in kenwood.c worked in the same way.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2591 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-23 03:24:42 +00:00
|
|
|
id_len = read_string(port, idbuf, IDBUFSZ, ";\r", 2);
|
2002-11-13 20:35:18 +00:00
|
|
|
close(port->fd);
|
|
|
|
if (retval != RIG_OK)
|
|
|
|
return RIG_MODEL_NONE;
|
|
|
|
/*
|
|
|
|
* reply should be something like 'K2n;'
|
|
|
|
*/
|
|
|
|
if (id_len == 4 || !strcmp(idbuf, "K2")) {
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "probe_kenwood: found K2\n");
|
2003-03-10 08:26:09 +00:00
|
|
|
if (cfunc)
|
|
|
|
(*cfunc)(port, RIG_MODEL_K2, data);
|
2002-11-13 20:35:18 +00:00
|
|
|
return RIG_MODEL_K2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-30 23:19:42 +00:00
|
|
|
for (i=0; kenwood_id_list[i].model != RIG_MODEL_NONE; i++) {
|
2002-11-13 20:35:18 +00:00
|
|
|
if (kenwood_id_list[i].id == k_id) {
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "probe_kenwood: "
|
2002-11-13 20:35:18 +00:00
|
|
|
"found %03d\n", k_id);
|
2003-03-10 08:26:09 +00:00
|
|
|
if (cfunc)
|
|
|
|
(*cfunc)(port, kenwood_id_list[i].model, data);
|
2002-11-13 20:35:18 +00:00
|
|
|
return kenwood_id_list[i].model;
|
|
|
|
}
|
2001-06-30 23:19:42 +00:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* not found in known table....
|
|
|
|
* update kenwood_id_list[]!
|
|
|
|
*/
|
2009-02-13 19:29:16 +00:00
|
|
|
rig_debug(RIG_DEBUG_WARN, "probe_kenwood: found unknown device "
|
2001-06-30 23:19:42 +00:00
|
|
|
"with ID %03d, please report to Hamlib "
|
|
|
|
"developers.\n", k_id);
|
|
|
|
|
|
|
|
return RIG_MODEL_NONE;
|
|
|
|
}
|
2001-05-15 22:05:26 +00:00
|
|
|
|
2001-03-04 13:08:33 +00:00
|
|
|
|
2000-12-23 08:40:14 +00:00
|
|
|
/*
|
2001-12-28 20:28:04 +00:00
|
|
|
* initrigs_kenwood is called by rig_backend_load
|
2000-12-23 08:40:14 +00:00
|
|
|
*/
|
2003-04-16 22:30:43 +00:00
|
|
|
DECLARE_INITRIG_BACKEND(kenwood)
|
2000-12-23 08:40:14 +00:00
|
|
|
{
|
2005-09-24 07:48:42 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "kenwood: _init called\n");
|
|
|
|
|
|
|
|
rig_register(&ts950sdx_caps);
|
|
|
|
rig_register(&ts50s_caps);
|
|
|
|
rig_register(&ts140_caps);
|
|
|
|
rig_register(&ts450s_caps);
|
|
|
|
rig_register(&ts570d_caps);
|
|
|
|
rig_register(&ts570s_caps);
|
|
|
|
rig_register(&ts680s_caps);
|
|
|
|
rig_register(&ts690s_caps);
|
|
|
|
rig_register(&ts790_caps);
|
|
|
|
rig_register(&ts850_caps);
|
|
|
|
rig_register(&ts870s_caps);
|
|
|
|
rig_register(&ts930_caps);
|
|
|
|
rig_register(&ts2000_caps);
|
2009-01-29 22:54:41 +00:00
|
|
|
rig_register(&trc80_caps);
|
2005-09-24 07:48:42 +00:00
|
|
|
rig_register(&k2_caps);
|
2008-09-01 19:01:13 +00:00
|
|
|
rig_register(&k3_caps);
|
2005-09-24 07:48:42 +00:00
|
|
|
|
|
|
|
rig_register(&ts440_caps);
|
|
|
|
rig_register(&ts940_caps);
|
|
|
|
rig_register(&ts711_caps);
|
|
|
|
rig_register(&ts811_caps);
|
|
|
|
rig_register(&r5000_caps);
|
|
|
|
|
|
|
|
rig_register(&tmd700_caps);
|
|
|
|
rig_register(&thd7a_caps);
|
|
|
|
rig_register(&thf7e_caps);
|
|
|
|
rig_register(&thg71_caps);
|
|
|
|
rig_register(&tmv7_caps);
|
|
|
|
|
|
|
|
rig_register(&ts480_caps);
|
2000-12-23 08:40:14 +00:00
|
|
|
|
2005-09-24 07:48:42 +00:00
|
|
|
return RIG_OK;
|
2000-12-23 08:40:14 +00:00
|
|
|
}
|