From 38b3cfd29ca05fe86619abc54fbe0a12e727d159 Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Wed, 13 Jul 2011 21:57:07 -0500 Subject: [PATCH 01/12] Updates for 1.2.14 release (cherry picked from commit ef771cf4c449e2d7247c0c4ecf3afe453ee48fba) --- AUTHORS | 17 ++++++++++++++++- NEWS | 14 ++++++++++---- README.release | 2 +- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/AUTHORS b/AUTHORS index ac9ddde39..780ac1bf7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -96,6 +96,7 @@ C: Leigh Klotz, WA5ZNU [kenwood: K3] M: Nate Bargmann, N0NB +C: Alexander Sack [kenwood: TS-480SAT] M: Juergen Rinas, DC3BW @@ -238,6 +239,9 @@ C: Ron Patterson, W6FM M: Stephane Fillod, F8CFE C: Chris Bryant, G3WIE +[ts7400] +M: Øystein Hårberg, LA7LKA + [Frontend] M: Stephane Fillod, F8CFE @@ -247,6 +251,12 @@ C: Stephane Fillod, F8CFE C: Nate Bargmann, N0NB +[test utilities] +M: Stephane Fillod, F8CFE +C: Nate Bargmann, N0NB +C: Nirgal Vourgère + + [platform: FreeBSD] M: Diane Bruce, VA3DB @@ -268,9 +278,10 @@ M: Alexandru Csete, OZ9AEC M: Joop Stakenborg, PG4I -[Web site: http://hamlib.sf.net] +[Web site: http://www.hamlib.org] M: Joop Stakenborg, PG4I M: Stephane Fillod, F8CFE +M: Nate Bargmann, N0NB E-mail addresses: @@ -321,3 +332,7 @@ Kamal Mostafa, KA6MAL, Roger, Tristan Mills, Terry Dawson, VK2KTJ, +Øystein Hårberg, LA7LKA, +Alexander Sack +Nirgal Vourgère + diff --git a/NEWS b/NEWS index 4e7f03e7d..cb0c773eb 100644 --- a/NEWS +++ b/NEWS @@ -6,10 +6,16 @@ Copyright (C) 2000-2011 Stephane Fillod, and others Please send Hamlib bug reports to hamlib-developer@lists.sourceforge.net Version 1.2.14 - 2011-XX-XX - * New models: SigFox Transfox, TH-D72A, IC-7410, IC-9100 - * New rotator backends: IF-100 - * Fixes and features: K3 + 2011-08-01 + * New models: SigFox Transfox, TH-D72A, IC-7410, IC-9100, IC-R9500, KX3, + V4L2 API support (untested), + * New rotator backends: IF-100, TS-7400 + * Fixes and features: K3/KX3, Build Win32 from script, rigctld/rotctld + ported to Mingw32, Win32 build fixes, remove obsolete bundled + libtool files, rigctl improvements, FUNcube string test (works + with V0.0 and V1.0), Yaesu newcat.c fixed to use + rig->state.current_vfo to store vfo value, add a command to + halt rigctld, Version 1.2.13.1 * 2011-05-29 diff --git a/README.release b/README.release index 9553f047d..8e0c4fa60 100644 --- a/README.release +++ b/README.release @@ -60,7 +60,7 @@ remote repository, "origin"): * Push the changes (check for validity): git push origin # pushes previous commit to sf.net repository - git push origin Hamlib-1.2.14 # push the branch + git push -u origin Hamlib-1.2.14 # push the branch and set "upstream" * Update the version in the macro AC_INIT of configure.ac (advance to next version, e.g. 1.2.15~git) and the libhamlib_la_LDFLAGS value in From 5f2bf62947d81ea268469884f73b897ea9d5abfc Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Wed, 13 Jul 2011 22:03:12 -0500 Subject: [PATCH 02/12] Setup for 1.2.15 development cycle --- c++/Makefile.am | 2 +- configure.ac | 2 +- src/Makefile.am | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/c++/Makefile.am b/c++/Makefile.am index 3e7590871..3f5855d7a 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -1,7 +1,7 @@ lib_LTLIBRARIES = libhamlib++.la libhamlib___la_SOURCES = rigclass.cc rotclass.cc -libhamlib___la_LDFLAGS = -no-undefined -version-info @ABI_VERSION@:14:0 +libhamlib___la_LDFLAGS = -no-undefined -version-info @ABI_VERSION@:15:0 libhamlib___la_LIBADD = $(top_builddir)/src/libhamlib.la check_PROGRAMS = testcpp diff --git a/configure.ac b/configure.ac index 29a806fef..16fe6e57c 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ dnl Please do not use '-' in the version number, 'make rpm' will fail, dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! -AC_INIT([Hamlib],[1.2.14~git],[hamlib-developer@lists.sourceforge.net],[hamlib],[http://www.hamlib.org]) +AC_INIT([Hamlib],[1.2.15~git],[hamlib-developer@lists.sourceforge.net],[hamlib],[http://www.hamlib.org]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) diff --git a/src/Makefile.am b/src/Makefile.am index c04cc3c64..368ac1585 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ RIGSRC = rig.c serial.c misc.c register.c event.c cal.c conf.c tones.c \ lib_LTLIBRARIES = libhamlib.la libhamlib_la_SOURCES = $(RIGSRC) -libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info @ABI_VERSION@:14:0 +libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info @ABI_VERSION@:15:0 libhamlib_la_CFLAGS = -DIN_HAMLIB $(AM_CFLAGS) -DHAMLIB_MODULE_DIR=\"$(pkglibdir)\" libhamlib_la_LIBADD = @LIBLTDL@ $(top_builddir)/lib/libmisc.la \ @NET_LIBS@ @MATH_LIBS@ $(LIBUSB_LIBS) From 1788452d9e9d9c2acc2f6a52f92750da774b16c8 Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:06:39 +0200 Subject: [PATCH 03/12] fix warning (cherry picked from commit 58b3b1c2c253c2560d3d1d216d114e38dd61b8cd) Signed-off-by: Nate Bargmann --- pcr/pcr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcr/pcr.h b/pcr/pcr.h index 580a3d111..1868c0bf6 100644 --- a/pcr/pcr.h +++ b/pcr/pcr.h @@ -37,7 +37,7 @@ struct pcr_priv_data struct pcr_rcvr { freq_t last_freq; - rmode_t last_mode; + int last_mode; int last_filter; int last_shift; From 89bce719bf95951a9f11c0115ef20ce8a11d4a8f Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:08:35 +0200 Subject: [PATCH 04/12] make tt565_transaction() static (cherry picked from commit fde68a09eb9244a12f7e13b6fe21802996e1516b) Signed-off-by: Nate Bargmann --- tentec/orion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tentec/orion.c b/tentec/orion.c index c0e343f36..bf178b1d1 100644 --- a/tentec/orion.c +++ b/tentec/orion.c @@ -111,7 +111,7 @@ double tt565_timenow() /* returns current time in secs+microsecs */ * Otherwise, you'll get a nice seg fault. You've been warned! */ -int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *data_len) +static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *data_len) { int retval, data_len_init, itry; struct rig_state *rs; From 3c5db5456fceb485532f5ba35acfdc9af44fac0c Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:09:50 +0200 Subject: [PATCH 05/12] Let set_ptt() select source, either TX mic or TX data (cherry picked from commit 421909bad2962b74cd7eddc07afec50dc6b80686) Signed-off-by: Nate Bargmann --- include/hamlib/rig.h | 9 ++++++--- kenwood/kenwood.c | 15 ++++++++++----- kenwood/ts480.c | 19 ++----------------- src/conf.c | 2 ++ src/rig.c | 22 ++++++++++++++-------- tests/dumpcaps.c | 3 +++ tests/rigctl.1 | 2 +- 7 files changed, 38 insertions(+), 34 deletions(-) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 2b63fbc04..24be5099b 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -398,8 +398,10 @@ typedef enum { * \brief PTT status */ typedef enum { - RIG_PTT_OFF = 0, /*!< PTT activated */ - RIG_PTT_ON /*!< PTT desactivated */ + RIG_PTT_OFF = 0, /*!< PTT desactivated */ + RIG_PTT_ON, /*!< PTT activated */ + RIG_PTT_ON_MIC, /*!< PTT Mic only, fallbacks on RIG_PTT_ON if unavailable */ + RIG_PTT_ON_DATA /*!< PTT Data (Mic-muted), fallbacks on RIG_PTT_ON if unavailable */ } ptt_t; /** @@ -411,7 +413,8 @@ typedef enum { RIG_PTT_RIG, /*!< Legacy PTT */ RIG_PTT_SERIAL_DTR, /*!< PTT control through serial DTR signal */ RIG_PTT_SERIAL_RTS, /*!< PTT control through serial RTS signal */ - RIG_PTT_PARALLEL /*!< PTT control through parallel port */ + RIG_PTT_PARALLEL, /*!< PTT control through parallel port */ + RIG_PTT_RIG_MICDATA /*!< Legacy PTT, supports RIG_PTT_ON_MIC/RIG_PTT_ON_DATA */ } ptt_type_t; /** diff --git a/kenwood/kenwood.c b/kenwood/kenwood.c index f6aca38eb..6907514d8 100644 --- a/kenwood/kenwood.c +++ b/kenwood/kenwood.c @@ -1750,18 +1750,23 @@ int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } - -/* - * kenwood_set_ptt - */ int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { + const char *ptt_cmd; + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (!rig) return -RIG_EINVAL; - return kenwood_simple_cmd(rig, (ptt == RIG_PTT_ON) ? "TX" : "RX"); + switch (ptt) { + case RIG_PTT_ON: ptt_cmd = "TX"; break; + case RIG_PTT_ON_MIC: ptt_cmd = "TX0"; break; + case RIG_PTT_ON_DATA: ptt_cmd = "TX1"; break; + case RIG_PTT_OFF: ptt_cmd = "RX"; break; + default: return -RIG_EINVAL; + } + return kenwood_simple_cmd(rig, ptt_cmd); } int kenwood_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt) diff --git a/kenwood/ts480.c b/kenwood/ts480.c index 14655d74b..652207557 100644 --- a/kenwood/ts480.c +++ b/kenwood/ts480.c @@ -40,21 +40,6 @@ #define TS480_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC) -/* - * kenwood_ts480_set_ptt - * Assumes rig!=NULL - * - * set PTT with audio from data connector (NOT microphone!!!) - */ -static int -kenwood_ts480_set_ptt (RIG * rig, vfo_t vfo, ptt_t ptt) -{ - if (RIG_PTT_ON == ptt) - return kenwood_simple_cmd(rig, "TX1"); - - return kenwood_simple_cmd(rig, "RX"); -} - /* * kenwood_ts480_get_info * Assumes rig!=NULL @@ -278,7 +263,7 @@ const struct rig_caps ts480_caps = { .copyright = "LGPL", .status = RIG_STATUS_UNTESTED, .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG, + .ptt_type = RIG_PTT_RIG_MICDATA, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 4800, @@ -396,7 +381,7 @@ const struct rig_caps ts480_caps = { .set_vfo = kenwood_set_vfo, .get_vfo = kenwood_get_vfo_if, .get_ptt = kenwood_get_ptt, - .set_ptt = kenwood_ts480_set_ptt, + .set_ptt = kenwood_set_ptt, .get_dcd = kenwood_get_dcd, .set_powerstat = kenwood_set_powerstat, .get_powerstat = kenwood_get_powerstat, diff --git a/src/conf.c b/src/conf.c index 0f732bcbb..7619ba560 100644 --- a/src/conf.c +++ b/src/conf.c @@ -282,6 +282,8 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) case TOK_PTT_TYPE: if (!strcmp(val, "RIG")) rs->pttport.type.ptt = RIG_PTT_RIG; + else if (!strcmp(val, "RIGMICDATA")) + rs->pttport.type.ptt = RIG_PTT_RIG_MICDATA; else if (!strcmp(val, "DTR")) rs->pttport.type.ptt = RIG_PTT_SERIAL_DTR; else if (!strcmp(val, "RTS")) diff --git a/src/rig.c b/src/rig.c index a86c1994f..f6f3b5b0c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1,9 +1,8 @@ /* * Hamlib Interface - main file - * Copyright (c) 2000-2010 by Stephane Fillod + * Copyright (c) 2000-2011 by Stephane Fillod * Copyright (c) 2000-2003 by Frank Singleton * - * $Id: rig.c,v 1.103 2009-02-20 14:14:31 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -31,7 +30,7 @@ * \brief Ham Radio Control Libraries interface * \author Stephane Fillod * \author Frank Singleton - * \date 2000-2010 + * \date 2000-2011 * * Hamlib provides a user-callable API, a set of "front-end" routines that * call rig-specific "back-end" routines which actually communicate with @@ -83,7 +82,7 @@ const char hamlib_version[21] = "Hamlib " PACKAGE_VERSION; * \brief Hamlib copyright notice */ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */ - "Copyright (C) 2000-2010 Stephane Fillod\n" + "Copyright (C) 2000-2011 Stephane Fillod\n" "Copyright (C) 2000-2003 Frank Singleton\n" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; @@ -471,6 +470,7 @@ int HAMLIB_API rig_open(RIG *rig) switch(rs->pttport.type.ptt) { case RIG_PTT_NONE: case RIG_PTT_RIG: + case RIG_PTT_RIG_MICDATA: break; case RIG_PTT_SERIAL_RTS: case RIG_PTT_SERIAL_DTR: @@ -611,6 +611,7 @@ int HAMLIB_API rig_close(RIG *rig) switch(rs->pttport.type.ptt) { case RIG_PTT_NONE: case RIG_PTT_RIG: + case RIG_PTT_RIG_MICDATA: break; case RIG_PTT_SERIAL_RTS: ser_set_rts(&rs->pttport, RIG_PTT_OFF); @@ -1136,12 +1137,16 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) switch (rig->state.pttport.type.ptt) { case RIG_PTT_RIG: + if (ptt == RIG_PTT_ON_MIC || ptt == RIG_PTT_ON_DATA) + ptt = RIG_PTT_ON; + /* fall through */ + case RIG_PTT_RIG_MICDATA: if (caps->set_ptt == NULL) - return -RIG_ENIMPL; + return -RIG_ENIMPL; if ((caps->targetable_vfo&RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) - return caps->set_ptt(rig, vfo, ptt); + return caps->set_ptt(rig, vfo, ptt); if (!caps->set_vfo) return -RIG_ENTARGET; @@ -1157,10 +1162,10 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) break; case RIG_PTT_SERIAL_DTR: - return ser_set_dtr(&rig->state.pttport, ptt==RIG_PTT_ON); + return ser_set_dtr(&rig->state.pttport, ptt!=RIG_PTT_OFF); case RIG_PTT_SERIAL_RTS: - return ser_set_rts(&rig->state.pttport, ptt==RIG_PTT_ON); + return ser_set_rts(&rig->state.pttport, ptt!=RIG_PTT_OFF); case RIG_PTT_PARALLEL: return par_ptt_set(&rig->state.pttport, ptt); @@ -1201,6 +1206,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) switch (rig->state.pttport.type.ptt) { case RIG_PTT_RIG: + case RIG_PTT_RIG_MICDATA: if (caps->get_ptt == NULL) return -RIG_ENIMPL; diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 851dccf82..4d3a73d11 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -103,6 +103,9 @@ int dumpcaps (RIG* rig, FILE *fout) case RIG_PTT_RIG: fprintf(fout, "Rig capable\n"); break; + case RIG_PTT_RIG_MICDATA: + fprintf(fout, "Rig capable (Mic/Data)\n"); + break; case RIG_PTT_PARALLEL: fprintf(fout, "Parallel port (DATA0)\n"); break; diff --git a/tests/rigctl.1 b/tests/rigctl.1 index 53f4095bd..1a4d6f0b8 100644 --- a/tests/rigctl.1 +++ b/tests/rigctl.1 @@ -203,7 +203,7 @@ against the Hamlib backend. Get 'XIT', in Hz. .TP .B T, set_ptt 'PTT' -Set 'PTT', 0 (RX) or 1 (TX). +Set 'PTT', 0 (RX), 1 (TX), 2 (TX mic), 3 (TX data). .TP .B t, get_ptt Get 'PTT' status. From 3a0895eea91a2311f05682306f48ac2dc0211a0f Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:12:27 +0200 Subject: [PATCH 06/12] Make sure scan is stopped at IC-R9000 opening (cherry picked from commit 2051c75fc0586a4818b0e9a0d46787f6ad2ad431) Signed-off-by: Nate Bargmann --- icom/icr9000.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/icom/icr9000.c b/icom/icr9000.c index bd27359c4..041c322fd 100644 --- a/icom/icr9000.c +++ b/icom/icr9000.c @@ -1,8 +1,7 @@ /* * Hamlib CI-V backend - IC-R9000 descriptions - * Copyright (c) 2000-2004 by Stephane Fillod + * Copyright (c) 2000-2011 by Stephane Fillod * - * $Id: icr9000.c,v 1.3 2004-09-26 08:35:03 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -45,10 +44,17 @@ #define ICR9000_PARMS (RIG_PARM_ANN) #define ICR9000_SCAN_OPS (RIG_SCAN_MEM) /* TBC */ -#define ICR9000_ANTS (RIG_ANT_1|RIG_ANT_2) +#define ICR9000_ANTS (RIG_ANT_1|RIG_ANT_2) /* selectable by CI-V ? */ + +#define ICR9000_MEM_CAP { \ + .freq = 1, \ + .mode = 1, \ + .width = 1, \ + .levels = RIG_LEVEL_ATT, \ +} -/* FIXME: S-Meter measurements */ +/* TODO: S-Meter measurements */ #define ICR9000_STR_CAL UNKNOWN_IC_STR_CAL static const struct icom_priv_caps icr9000_priv_caps = { @@ -56,6 +62,9 @@ static const struct icom_priv_caps icr9000_priv_caps = { 0, /* 731 mode */ r9000_ts_sc_list }; + +static int icr9000_open(RIG *rig); + /* * ICR9000A rig capabilities. */ @@ -63,9 +72,9 @@ const struct rig_caps icr9000_caps = { .rig_model = RIG_MODEL_ICR9000, .model_name = "IC-R9000", .mfg_name = "Icom", -.version = BACKEND_VER, +.version = BACKEND_VER ".1", .copyright = "LGPL", -.status = RIG_STATUS_UNTESTED, +.status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, @@ -78,7 +87,7 @@ const struct rig_caps icr9000_caps = { .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, -.timeout = 200, +.timeout = 1000, .retry = 3, .has_get_func = ICR9000_FUNCS, @@ -106,9 +115,9 @@ const struct rig_caps icr9000_caps = { .chan_desc_sz = 0, .chan_list = { - { 1, 99, RIG_MTYPE_MEM }, /* TBC */ - { 0x1000, 0x1009, RIG_MTYPE_EDGE }, /* 2 by 2 */ - { 0x1010, 0x1019, RIG_MTYPE_EDGE }, /* 2 by 2 */ + { 0, 999, RIG_MTYPE_MEM, ICR9000_MEM_CAP }, /* TBC */ + { 1000, 1009, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, /* 2 by 2 */ + { 1010, 1019, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, /* 2 by 2 */ RIG_CHAN_END, }, .rx_range_list1 = { @@ -151,7 +160,7 @@ const struct rig_caps icr9000_caps = { .priv = (void*)&icr9000_priv_caps, .rig_init = icom_init, .rig_cleanup = icom_cleanup, -.rig_open = NULL, +.rig_open = icr9000_open, .rig_close = NULL, .set_freq = icom_set_freq, @@ -185,4 +194,8 @@ const struct rig_caps icr9000_caps = { * Function definitions below */ +int icr9000_open(RIG *rig) +{ + return icom_scan(rig, RIG_VFO_CURR, RIG_SCAN_STOP, 0); +} From cb3795f624c8a4515037b5687c148f8f9dea7220 Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:14:22 +0200 Subject: [PATCH 07/12] WIP (cherry picked from commit 37387ded0c000ee77ab7046fe17c28b8e7ef1735) Signed-off-by: Nate Bargmann --- kenwood/thd72.c | 186 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 158 insertions(+), 28 deletions(-) diff --git a/kenwood/thd72.c b/kenwood/thd72.c index 6db021ea8..4c2c53dd3 100644 --- a/kenwood/thd72.c +++ b/kenwood/thd72.c @@ -25,17 +25,14 @@ #endif #include +#include #include "hamlib/rig.h" #include "kenwood.h" #include "th.h" #include "num_stdio.h" - -#if 1 -#define RIG_ASSERT(x) if (!(x)) { rig_debug(RIG_DEBUG_ERR, "Assertion failed on line %i\n",__LINE__); abort(); } -#else -#define RIG_ASSERT(x) -#endif +#include "iofunc.h" +#include "serial.h" #define THD72_MODES (RIG_MODE_FM|RIG_MODE_AM) @@ -58,7 +55,7 @@ #define THD72_PARMS (RIG_PARM_BACKLIGHT) -#define THD72_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) +#define THD72_VFO_OP (RIG_OP_NONE) /* * TODO: Band A & B @@ -76,6 +73,8 @@ static struct kenwood_priv_caps thd72_priv_caps = { }; static int thd72_open(RIG *rig); +static int thd72_get_chan_all_cb (RIG * rig, chan_cb_t chan_cb, rig_ptr_t arg); + /* * th-d72a rig capabilities. @@ -86,7 +85,7 @@ const struct rig_caps thd72a_caps = { .mfg_name = "Kenwood", .version = TH_VER, .copyright = "LGPL", -.status = RIG_STATUS_UNTESTED, +.status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_HANDHELD|RIG_FLAG_APRS|RIG_FLAG_TNC|RIG_FLAG_DXCLUSTER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -170,31 +169,13 @@ const struct rig_caps thd72a_caps = { .rig_init = kenwood_init, .rig_cleanup = kenwood_cleanup, .rig_open = thd72_open, -.set_freq = th_set_freq, -.get_freq = th_get_freq, -.set_mode = th_set_mode, -.get_mode = th_get_mode, .set_vfo = th_set_vfo, .get_vfo = th_get_vfo, -.set_ctcss_tone = th_set_ctcss_tone, -.get_ctcss_tone = th_get_ctcss_tone, -.set_ctcss_sql = th_set_ctcss_sql, -.get_ctcss_sql = th_get_ctcss_sql, -.set_mem = th_set_mem, -.get_mem = th_get_mem, -.set_channel = th_set_channel, -.get_channel = th_get_channel, -.set_trn = th_set_trn, -.get_trn = th_get_trn, -.get_func = th_get_func, -.get_level = th_get_level, -.get_parm = th_get_parm, +.get_chan_all_cb = thd72_get_chan_all_cb, + .get_info = th_get_info, -.get_dcd = kenwood_get_dcd, - -.decode_event = th_decode_event, }; @@ -211,3 +192,152 @@ int thd72_open(RIG *rig) return RIG_OK; } +#define CMD_SZ 5 +#define BLOCK_SZ 256 +#define BLOCK_COUNT 256 + +static int thd72_get_block (RIG *rig, int block_num, char *block) +{ + hamlib_port_t *rp = &rig->state.rigport; + char cmd[CMD_SZ] = "R\0\0\0\0"; + char resp[CMD_SZ]; + int ret; + + /* fetching block i */ + cmd[2] = block_num & 0xff; + + ret = write_block(rp, cmd, CMD_SZ); + if (ret != RIG_OK) + return ret; + + /* read response first */ + ret = read_block(rp, resp, CMD_SZ); + if (ret != RIG_OK) + return ret; + + if (resp[0] != 'W' || memcmp(cmd+1, resp+1, CMD_SZ-1)) + return -RIG_EPROTO; + + /* read block */ + ret = read_block(rp, block, BLOCK_SZ); + if (ret != BLOCK_SZ) + return ret; + + ret = write_block(rp, "\006", 1); + if (ret != RIG_OK) + return ret; + + ret = read_block(rp, resp, 1); + if (ret != 1) + return ret; + + if (resp[0] != 0x06) + return -RIG_EPROTO; + + return RIG_OK; +} + +int thd72_get_chan_all_cb (RIG * rig, chan_cb_t chan_cb, rig_ptr_t arg) +{ + int i, j, ret; + hamlib_port_t *rp = &rig->state.rigport; + channel_t *chan; + chan_t *chan_list = rig->state.chan_list; + int chan_next = chan_list[0].start; + char block[BLOCK_SZ]; + char resp[CMD_SZ]; + + ret = kenwood_simple_cmd(rig, "0M PROGRAM"); + if (ret != RIG_OK) + return ret; + + rp->parm.serial.rate = 57600; + + serial_setup(rp); + + /* let the pcr settle and flush any remaining data*/ + usleep(100*1000); + serial_flush(rp); + + /* setRTS or Hardware flow control? */ + ret = ser_set_rts(rp, 1); + if (ret != RIG_OK) + return ret; + + /* + * setting chan to NULL means the application + * has to provide a struct where to store data + * future data for channel channel_num + */ + chan = NULL; + ret = chan_cb(rig, &chan, chan_next, chan_list, arg); + if (ret != RIG_OK) + return ret; + if (chan == NULL) + return -RIG_ENOMEM; + + + for (i=0; ivfo = RIG_VFO_MEM; + chan->channel_num = i*CHAN_PER_BLOCK + j; + + /* What are the extra 64 channels ? */ + if (chan->channel_num >= 1000) + break; + + /* non-empty channel ? */ + if (block_chan[0] != 0xff) { + + memcpy(chan->channel_desc, block_chan, 8); + /* TODO: chop off trailing chars */ + chan->channel_desc[8] = '\0'; + + /* TODO: parse block and fill in chan */ + } + + /* notify the end? */ + chan_next = chan_next < chan_list[i].end ? chan_next+1 : chan_next; + + /* + * provide application with channel data, + * and ask for a new channel structure + */ + chan_cb(rig, &chan, chan_next, chan_list, arg); + } + } + + ret = write_block(rp, "E", 1); + if (ret != RIG_OK) + return ret; + + ret = read_block(rp, resp, 1); + if (ret != 1) + return ret; + + if (resp[0] != 0x06) { + return -RIG_EPROTO; + } + + /* setRTS?? getCTS needed? */ + ret = ser_set_rts(rp, 1); + if (ret != RIG_OK) + return ret; + + return RIG_OK; +} + From bd811c2f45383a9c602e2d37bf48b09e4b7c3df0 Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:15:53 +0200 Subject: [PATCH 08/12] advertise for VFO_MEM in range_lists (cherry picked from commit 33aa4ed31eb881ebdadad29ece46e75b700b4d29) Signed-off-by: Nate Bargmann --- kenwood/thf7.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/kenwood/thf7.c b/kenwood/thf7.c index f0e4fc732..30a323e17 100644 --- a/kenwood/thf7.c +++ b/kenwood/thf7.c @@ -113,7 +113,7 @@ const struct rig_caps thf7e_caps = { .rig_model = RIG_MODEL_THF7E, .model_name = "TH-F7E", .mfg_name = "Kenwood", -.version = TH_VER, +.version = TH_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_HANDHELD, @@ -172,34 +172,34 @@ const struct rig_caps thf7e_caps = { .rx_range_list1 = { /* RIG_ANT_2 is internal bar antenna */ - {MHz(144),MHz(146),THF7_MODES_TX,-1,-1,RIG_VFO_A,RIG_ANT_1}, - {MHz(430),MHz(440),THF7_MODES_TX,-1,-1,RIG_VFO_A,RIG_ANT_1}, - {kHz(100),MHz(470),THF7_ALL_MODES,-1,-1,RIG_VFO_B, RIG_ANT_1|RIG_ANT_2}, - {MHz(470),GHz(1.3),THF7_HIGH_MODES,-1,-1,RIG_VFO_B,RIG_ANT_1}, + {MHz(144),MHz(146),THF7_MODES_TX,-1,-1,RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {MHz(430),MHz(440),THF7_MODES_TX,-1,-1,RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {kHz(100),MHz(470),THF7_ALL_MODES,-1,-1,RIG_VFO_MEM|RIG_VFO_B, RIG_ANT_1|RIG_ANT_2}, + {MHz(470),GHz(1.3),THF7_HIGH_MODES,-1,-1,RIG_VFO_MEM|RIG_VFO_B,RIG_ANT_1}, RIG_FRNG_END }, .tx_range_list1 = { /* power actually depends on DC power supply */ - {MHz(144),MHz(146),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_A,RIG_ANT_1}, - {MHz(430),MHz(440),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_A,RIG_ANT_1}, + {MHz(144),MHz(146),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {MHz(430),MHz(440),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, RIG_FRNG_END }, /* region 2 is model TH-F6A in fact */ .rx_range_list2 = { /* RIG_ANT_2 is internal bar antenna */ - {MHz(144),MHz(148),THF7_MODES_TX,-1,-1,RIG_VFO_A,RIG_ANT_1}, - {MHz(222),MHz(225),THF7_MODES_TX,-1,-1,RIG_VFO_A,RIG_ANT_1}, - {MHz(430),MHz(450),THF7_MODES_TX,-1,-1,RIG_VFO_A,RIG_ANT_1}, - {kHz(100),MHz(470),THF7_ALL_MODES,-1,-1,RIG_VFO_B, RIG_ANT_1|RIG_ANT_2}, - {MHz(470),GHz(1.3),THF7_HIGH_MODES,-1,-1,RIG_VFO_B,RIG_ANT_1}, + {MHz(144),MHz(148),THF7_MODES_TX,-1,-1,RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {MHz(222),MHz(225),THF7_MODES_TX,-1,-1,RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {MHz(430),MHz(450),THF7_MODES_TX,-1,-1,RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {kHz(100),MHz(470),THF7_ALL_MODES,-1,-1,RIG_VFO_MEM|RIG_VFO_B, RIG_ANT_1|RIG_ANT_2}, + {MHz(470),GHz(1.3),THF7_HIGH_MODES,-1,-1,RIG_VFO_MEM|RIG_VFO_B,RIG_ANT_1}, RIG_FRNG_END }, .tx_range_list2 = { /* power actually depends on DC power supply */ - {MHz(144),MHz(148),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_A,RIG_ANT_1}, - {MHz(222),MHz(225),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_A,RIG_ANT_1}, - {MHz(430),MHz(450),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_A,RIG_ANT_1}, + {MHz(144),MHz(148),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {MHz(222),MHz(225),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, + {MHz(430),MHz(450),THF7_MODES_TX,W(0.05),W(5),RIG_VFO_MEM|RIG_VFO_A,RIG_ANT_1}, RIG_FRNG_END }, From 742ea96986baf3c6e135ffad0d883881a3a9bb82 Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:16:12 +0200 Subject: [PATCH 09/12] PRM8060 status update (cherry picked from commit c8bdb7e166378ee8b657a9cb7b5f18e423bbcfde) Signed-off-by: Nate Bargmann --- prm80/prm8060.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prm80/prm8060.c b/prm80/prm8060.c index 7312704f8..df42247a3 100644 --- a/prm80/prm8060.c +++ b/prm80/prm8060.c @@ -53,7 +53,7 @@ const struct rig_caps prm8060_caps = { .mfg_name = "Philips/Simoco", .version = "0.1", .copyright = "LGPL", -.status = RIG_STATUS_UNTESTED, +.status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, From 32f135726bb8a0d2e7bdcc7064f2ce1d88e2e2db Mon Sep 17 00:00:00 2001 From: Stephane Fillod Date: Wed, 20 Jul 2011 00:16:29 +0200 Subject: [PATCH 10/12] copyright date update (cherry picked from commit 89888b30419077e9eb7db43211c7a984dd26854b) Signed-off-by: Nate Bargmann --- src/rotator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rotator.c b/src/rotator.c index 3dc26b886..dcf800aca 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -1,6 +1,6 @@ /* * Hamlib Interface - main file - * Copyright (c) 2000-2010 by Stephane Fillod + * Copyright (c) 2000-2011 by Stephane Fillod * Copyright (c) 2000-2003 by Frank Singleton * * @@ -29,7 +29,7 @@ * \file src/rotator.c * \brief Rotator interface * \author Stephane Fillod - * \date 2000-2010 + * \date 2000-2011 * * Hamlib interface is a frontend implementing rotator wrapper functions. */ From 7ad9ae84b4c7c6fd0160f850a28b9b4a7fd84ea3 Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Sun, 31 Jul 2011 10:54:08 -0500 Subject: [PATCH 11/12] Correct typos and SF.net URIs. README.release updated for 1.2.15 future release. --- NEWS | 5 ++++- README.release | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index cb0c773eb..4a704f5e3 100644 --- a/NEWS +++ b/NEWS @@ -15,7 +15,10 @@ Version 1.2.14 libtool files, rigctl improvements, FUNcube string test (works with V0.0 and V1.0), Yaesu newcat.c fixed to use rig->state.current_vfo to store vfo value, add a command to - halt rigctld, + halt rigctld, select PTT source in Kenwood backends (TS-590S), + make sure scan is stopped at IC-9000 opening, thd72 get channel + data (alpha). See ChangeLog for a link to the online log. + Correct typos and SF.net URIs. Version 1.2.13.1 * 2011-05-29 diff --git a/README.release b/README.release index 8e0c4fa60..39df768fc 100644 --- a/README.release +++ b/README.release @@ -56,21 +56,21 @@ remote repository, "origin"): git commit -a # Commit all modified files locally * Create a new branch for the release: - git branch Hamlib-1.2.14 + git branch Hamlib-1.2.15 * Push the changes (check for validity): git push origin # pushes previous commit to sf.net repository - git push -u origin Hamlib-1.2.14 # push the branch and set "upstream" + git push -u origin Hamlib-1.2.15 # push the branch and set "upstream" * Update the version in the macro AC_INIT of configure.ac (advance to next - version, e.g. 1.2.15~git) and the libhamlib_la_LDFLAGS value in + version, e.g. 1.2.16~git) and the libhamlib_la_LDFLAGS value in src/Makefile.am and c++/Makefile.am to match. e.g.: - libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info @ABI_VERSION@:15:0 + libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info @ABI_VERSION@:16:0 Note that -version-info is a libtool flag and reflects ABI compatibility. - In @ABI_VERSION@:15:0, ABI_VERSION is set in configure.ac, 15 is the + In @ABI_VERSION@:16:0, ABI_VERSION is set in configure.ac, 16 is the revision, and :0 should remain 0. When the API is changed, ABI_VERSION - will be advanced, and revision (e.g. :15) will be reset to 0. + will be advanced, and revision (e.g. :16) will be reset to 0. Format is ABI version:revision:age. Setting age to other than 0 causes strange DLL naming in Win32 cross-compile builds. @@ -84,7 +84,7 @@ which will be advanced for the next release candidate or stripped for final release: * Checkout the release branch: - git checkout Hamlib-1.2.14 + git checkout Hamlib-1.2.15 * Edit config.ac, commit it and push it. The branch is now ready for rc testing/release. @@ -126,8 +126,9 @@ See README.build-win32 for information on prerequisites, etc. - Documentation (requires doxygen) make -C doc doc - ssh shell.sourceforge.net mkdir /home/project-web/h/ha/hamlib/htdocs/manuals/x-y-z - scp -r doc/html shell.sourceforge.net:/home/project-web/h/ha/hamlib/htdocs/manuals/x-y-z/. + ssh -t USER,hamlib@shell.sourceforge.net create + mkdir /home/project-web/hamlib/htdocs/manuals/x-y-z + scp -r doc/html/* USER,hamlib@shell.sourceforge.net:/home/project-web/hamlib/htdocs/manuals/x-y-z/. Edit Wiki Documentation section - Supported Radios/Rotators From 938f33058d54d6c774e2feda4f91c4b43b48d2ed Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Sat, 20 Aug 2011 16:04:57 -0500 Subject: [PATCH 12/12] K3/KX3 S-meter calibration. K3 returns S-meter values of 0-15. Tested with grig 0.8.0~rc1. --- kenwood/elecraft.h | 26 ++++++++++++++++++++++++++ kenwood/k3.c | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/kenwood/elecraft.h b/kenwood/elecraft.h index d581c74dd..fa9d0d8c0 100644 --- a/kenwood/elecraft.h +++ b/kenwood/elecraft.h @@ -69,5 +69,31 @@ extern const struct confparams elecraft_ext_levels[]; /* Elecraft extension function declarations */ int elecraft_open(RIG *rig); +/* S-meter calibration tables */ + +/* K3 defines 16 values--0-15. + * Table is RASTR value from SM command and dB relative to S9 == 0 + * (see rig_get_level() in src/settings.c + */ +#define K3_STR_CAL { 16, \ + { \ + { 0, -54 }, \ + { 1, -42 }, \ + { 2, -36 }, \ + { 3, -24 }, \ + { 4, -12 }, \ + { 5, -6 }, \ + { 6, 0 }, \ + { 7, 10 }, \ + { 8, 15 }, \ + { 9, 20 }, \ + { 10, 30 }, \ + { 11, 35 }, \ + { 12, 40 }, \ + { 13, 50 }, \ + { 14, 55 }, \ + { 15, 60 }, \ + } } + #endif /* _ELECRAFT_H */ diff --git a/kenwood/k3.c b/kenwood/k3.c index 0e3d7cfaa..025a9c101 100644 --- a/kenwood/k3.c +++ b/kenwood/k3.c @@ -42,7 +42,7 @@ #define K3_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|RIG_LEVEL_AGC|RIG_LEVEL_SQL|\ RIG_LEVEL_STRENGTH|RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD|\ - RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_MICGAIN) + RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_MICGAIN|RIG_LEVEL_RAWSTR) #define K3_VFO (RIG_VFO_A|RIG_VFO_B) #define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) @@ -183,6 +183,7 @@ const struct rig_caps k3_caps = { {RIG_MODE_FM, kHz(13)}, /* TBC */ RIG_FLT_END, }, + .str_cal = K3_STR_CAL, .priv = (void *)&k3_priv_caps, .rig_init = kenwood_init,