[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 604516ed8f839e4927ecc
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-04-29 22:20:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 604516ed8f839e4927ecca34340f9e1f88576a58 (commit) via 697a194752904a3fe245de779c7b0155017996ef (commit) via 386b08dc4f529876f5c22fb36131b5fba73b064a (commit) via 4e60ebf1d6928bd8c7d3b485c6f4d045a75e7af7 (commit) from 5473249e9ad75a302839804a0811039245f13c04 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 604516ed8f839e4927ecca34340f9e1f88576a58 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 29 17:16:51 2021 -0500 Clean up mingw compiler warning for tones.h https://github.com/Hamlib/Hamlib/issues/659 diff --git a/rigs/kenwood/tmd710.c b/rigs/kenwood/tmd710.c index 846de326..5e794e56 100644 --- a/rigs/kenwood/tmd710.c +++ b/rigs/kenwood/tmd710.c @@ -1219,7 +1219,8 @@ int tmd710_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code) if (fo_struct.dcs) { - *code = common_dcs_list[fo_struct.dcs_val]; + tone_t *dcs_list = common_dcs_list; + *code = dcs_list[fo_struct.dcs_val]; } else { @@ -1234,9 +1235,10 @@ static int tmd710_find_dcs_index(tone_t code, uint32_t *dcs_index) int i = 0; // we only allow exact matches here - while (code != common_dcs_list[i]) + tone_t *dcs_list = common_dcs_list; + while (code != dcs_list[i]) { - if (common_dcs_list[i] == 0) + if (dcs_list[i] == 0) { return -RIG_EINVAL; } @@ -1889,7 +1891,8 @@ int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) if (me_struct.dcs) { - chan->dcs_sql = common_dcs_list[me_struct.dcs_val]; + tone_t *dcs_list = common_dcs_list; + chan->dcs_sql = dcs_list[me_struct.dcs_val]; } else { diff --git a/src/tones.h b/src/tones.h index 1e6288dd..76f10254 100644 --- a/src/tones.h +++ b/src/tones.h @@ -37,12 +37,10 @@ 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, -#if 1 static const tone_t static_full_ctcss_list[] = { FULL_CTCSS_LIST }; -#endif #define FULL_CTCSS_LIST_COUNT 52 @@ -62,12 +60,10 @@ static const tone_t static_full_ctcss_list[] = 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, -#if 1 static const tone_t static_common_ctcss_list[] = { COMMON_CTCSS_LIST }; -#endif #define COMMON_CTCSS_LIST_COUNT 50 @@ -87,12 +83,10 @@ static const tone_t static_common_ctcss_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, -#if 1 static const tone_t static_common_dcs_list[] = { COMMON_DCS_LIST }; -#endif #define COMMON_DCS_LIST_COUNT 104 @@ -111,12 +105,10 @@ static const tone_t static_common_dcs_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, -#if 1 static const tone_t static_full_dcs_list[] = { FULL_DCS_LIST }; -#endif #define FULL_DCS_LIST_COUNT 106 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 01892211..a3f2064c 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4344,6 +4344,9 @@ declare_proto_rig(dump_state) fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq != NULL); fprintf(fout, "has_set_conf=%d\n", rig->caps->set_conf != NULL); fprintf(fout, "has_get_conf=%d\n", rig->caps->get_conf != NULL); + fprintf(fout, "has_set_parm=%d\n", rig->caps->set_parm != NULL); + fprintf(fout, "has_get_parm=%d\n", rig->caps->get_parm != NULL); + fprintf(fout, "parm_gran=0x%x\n", rig->caps->parm_gran); // for the future // fprintf(fout, "has_set_trn=%d\n", rig->caps->set_trn != NULL); // fprintf(fout, "has_get_trn=%d\n", rig->caps->get_trn != NULL); commit 697a194752904a3fe245de779c7b0155017996ef Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 29 17:06:45 2021 -0500 Fix mingw warnings from new ctcss_list definition https://github.com/Hamlib/Hamlib/issues/659 diff --git a/src/tones.h b/src/tones.h index 204b66f7..1e6288dd 100644 --- a/src/tones.h +++ b/src/tones.h @@ -37,7 +37,7 @@ 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, -#if 0 +#if 1 static const tone_t static_full_ctcss_list[] = { FULL_CTCSS_LIST @@ -62,7 +62,7 @@ static const tone_t static_full_ctcss_list[] = 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, -#if 0 +#if 1 static const tone_t static_common_ctcss_list[] = { COMMON_CTCSS_LIST @@ -87,7 +87,7 @@ static const tone_t static_common_ctcss_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, -#if 0 +#if 1 static const tone_t static_common_dcs_list[] = { COMMON_DCS_LIST @@ -111,7 +111,7 @@ static const tone_t static_common_dcs_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, -#if 0 +#if 1 static const tone_t static_full_dcs_list[] = { FULL_DCS_LIST @@ -125,10 +125,10 @@ static const tone_t static_full_dcs_list[] = * because DLL's vars don't have constant address. */ #if (defined(_WIN32) || defined(__CYGWIN__)) // && !defined(IN_HAMLIB) -#define common_ctcss_list static_common_ctcss_list -#define full_ctcss_list static_full_ctcss_list -#define full_dcs_list static_full_dcs_list -#define common_dcs_list static_common_dcs_list +#define common_ctcss_list (tone_t*)static_common_ctcss_list +#define full_ctcss_list (tone_t*)static_full_ctcss_list +#define full_dcs_list (tone_t*)static_full_dcs_list +#define common_dcs_list (tone_t*)static_common_dcs_list #else commit 386b08dc4f529876f5c22fb36131b5fba73b064a Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 29 10:49:29 2021 -0500 Add ctcss_list and dcs_list to rigctld so rigcctld caps reflects the connected rig https://github.com/Hamlib/Hamlib/issues/659 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index ffb08df7..1f1c781e 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -214,6 +214,8 @@ typedef struct s_rig RIG; * * Digitally-Coded Squelch codes are simple direct integers. */ +#define CTCSS_LIST_SIZE 60 +#define DCS_LIST_SIZE 128 typedef unsigned int tone_t; @@ -1639,8 +1641,8 @@ struct rig_caps { const struct confparams *extfuncs; /*!< Extension func list, \sa ext.c */ int *ext_tokens; /*!< Extension token list */ - const tone_t *ctcss_list; /*!< CTCSS tones list, zero ended */ - const tone_t *dcs_list; /*!< DCS code list, zero ended */ + tone_t *ctcss_list; /*!< CTCSS tones list, zero ended */ + tone_t *dcs_list; /*!< DCS code list, zero ended */ int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */ int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */ diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 20c7cd50..e23f1055 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -41,7 +41,7 @@ #include "dummy.h" #define CMD_MAX 64 -#define BUF_MAX 96 +#define BUF_MAX 1024 #define CHKSCN1ARG(a) if ((a) != 1) return -RIG_EPROTO; else do {} while(0) @@ -198,6 +198,48 @@ static int netrigctl_cleanup(RIG *rig) return RIG_OK; } +int parse_array_int(const char *s, const char *delim, int *array, int array_len) +{ + char *p; + char *dup = strdup(s); + char *rest = dup; + int n=0; + ENTERFUNC; + while((p = strtok_r(rest, delim, &rest))) + { + if (n == array_len) { // too many items + return n; + } + array[n] = atoi(p); + //printf("%d\n", array[n]); + ++n; + } + free(dup); + return n; +} + +int parse_array_double(const char *s, const char *delim, double *array, int array_len) +{ + char *p; + char *dup = strdup(s); + char *rest = dup; + int n=0; + ENTERFUNC; + while((p = strtok_r(rest, delim, &rest))) + { + if (n == array_len) { // too many items + return n; + } + array[n] = atof(p); + //printf("%f\n", array[n]); + ++n; + } + free(dup); + return n; +} + + + static int netrigctl_open(RIG *rig) { int ret, len, i; @@ -576,7 +618,7 @@ static int netrigctl_open(RIG *rig) do { - char setting[32], value[256]; + char setting[32], value[1024]; ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1); strtok(buf, "\r\n"); // chop the EOL @@ -587,7 +629,7 @@ static int netrigctl_open(RIG *rig) if (strncmp(buf, "done", 4) == 0) { return RIG_OK; } - if (sscanf(buf, "%31[^=]=%255[^\t\n]", setting, value) == 2) + if (sscanf(buf, "%31[^=]=%1024[^\t\n]", setting, value) == 2) { if (strcmp(setting, "vfo_ops") == 0) { @@ -679,7 +721,7 @@ static int netrigctl_open(RIG *rig) if (!has) { rig->caps->power2mW = NULL; } } - else if (strcmp(setting, "has_mw2power") == 0) + else if (strcmp(setting, "has_mW2power") == 0) { int has = strtol(value, NULL, 0); @@ -692,6 +734,26 @@ static int netrigctl_open(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: timeout value = '%s', final timeout=%d\n", __func__, value, rig->caps->timeout); } + else if (strcmp(setting, "ctcss_list") == 0) + { + int i; + int n; + double ctcss[CTCSS_LIST_SIZE]; + rig->caps->ctcss_list = calloc(CTCSS_LIST_SIZE, sizeof(tone_t)); + n = parse_array_double(value, " \n\r", ctcss, CTCSS_LIST_SIZE); + for(i=0;i<CTCSS_LIST_SIZE && ctcss[i] != 0;++i) rig->caps->ctcss_list[i] = ctcss[i]*10; + if (n < CTCSS_LIST_SIZE) rig->caps->ctcss_list[n] = 0; + } + else if (strcmp(setting,"dcs_list") == 0) + { + int i; + int n; + int dcs[DCS_LIST_SIZE+1]; + rig->caps->dcs_list = calloc(DCS_LIST_SIZE, sizeof(tone_t)); + n = parse_array_int(value, " \n\r", dcs, DCS_LIST_SIZE); + for(i=0;i<DCS_LIST_SIZE && dcs[i] != 0; i++) rig->caps->dcs_list[i] = dcs[i]; + if (n < DCS_LIST_SIZE) rig->caps->dcs_list[n] = 0; + } else { // not an error -- just a warning for backward compatibility diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index c39cbf5c..3ad2842a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -157,7 +157,7 @@ rmode_t kenwood_mode_table[KENWOOD_MODE_TABLE_MAX] = /* * 38 CTCSS sub-audible tones */ -const tone_t kenwood38_ctcss_list[] = +tone_t kenwood38_ctcss_list[] = { 670, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, 1318, @@ -170,7 +170,7 @@ const tone_t kenwood38_ctcss_list[] = /* * 42 CTCSS sub-audible tones */ -const tone_t kenwood42_ctcss_list[] = +tone_t kenwood42_ctcss_list[] = { 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, 1318, @@ -184,7 +184,7 @@ const tone_t kenwood42_ctcss_list[] = * * See enum rig_conf_e and struct confparams in rig.h */ -const struct confparams kenwood_cfg_params[] = +struct confparams kenwood_cfg_params[] = { { TOK_FINE, "fine", "Fine", "Fine step mode", diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index abe0829a..76b6436d 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -50,7 +50,7 @@ #define TOK_FUNC_FILTER_WIDTH_DATA TOKEN_BACKEND(6) // Data communications mode that affects SL/SH/FW commands /* Token structure assigned to .cfgparams in rig_caps */ -extern const struct confparams kenwood_cfg_params[]; +extern struct confparams kenwood_cfg_params[]; /* @@ -173,8 +173,8 @@ struct kenwood_priv_data extern rmode_t kenwood_mode_table[KENWOOD_MODE_TABLE_MAX]; -extern const tone_t kenwood38_ctcss_list[]; -extern const tone_t kenwood42_ctcss_list[]; +extern tone_t kenwood38_ctcss_list[]; +extern tone_t kenwood42_ctcss_list[]; int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, size_t datasize); int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf, diff --git a/rigs/kenwood/pihpsdr.c b/rigs/kenwood/pihpsdr.c index 05830c13..3136e1dc 100644 --- a/rigs/kenwood/pihpsdr.c +++ b/rigs/kenwood/pihpsdr.c @@ -130,8 +130,8 @@ const struct rig_caps pihpsdr_caps = .parm_gran = {}, .vfo_ops = PIHPSDR_VFO_OP, .scan_ops = PIHPSDR_SCAN_OP, - .ctcss_list = static_common_ctcss_list, - .dcs_list = static_common_dcs_list, + .ctcss_list = common_ctcss_list, + .dcs_list = common_dcs_list, .preamp = { 20, RIG_DBLST_END, }, /* FIXME: real preamp? */ .attenuator = { 20, RIG_DBLST_END, }, .max_rit = kHz(20), diff --git a/rigs/kenwood/thf6a.c b/rigs/kenwood/thf6a.c index 9fc73e53..d7eb1513 100644 --- a/rigs/kenwood/thf6a.c +++ b/rigs/kenwood/thf6a.c @@ -71,7 +71,7 @@ .dcs_sql=1, /* CTCSS 01..42 */ -static const tone_t thf6_ctcss_list[] = +static tone_t thf6_ctcss_list[] = { 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, diff --git a/rigs/kenwood/thf7.c b/rigs/kenwood/thf7.c index 68a8d5f5..eda15a8d 100644 --- a/rigs/kenwood/thf7.c +++ b/rigs/kenwood/thf7.c @@ -65,7 +65,7 @@ .dcs_sql=1, /* CTCSS 01..42 */ -static const tone_t thf7_ctcss_list[] = +static tone_t thf7_ctcss_list[] = { 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index 60615366..87c9b0ee 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -65,7 +65,7 @@ static int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); /* * 38 CTCSS sub-audible tones + 1750 tone */ -const tone_t ts2000_ctcss_list[] = +tone_t ts2000_ctcss_list[] = { 670, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, 1318, @@ -79,7 +79,7 @@ const tone_t ts2000_ctcss_list[] = /* * 103 available DCS codes */ -static const tone_t ts2000_dcs_list[] = +tone_t ts2000_dcs_list[] = { 23, 25, 26, 31, 32, 36, 43, 47, 51, 53, 54, 65, 71, 72, 73, 74, 114, 115, 116, 122, 125, 131, diff --git a/rigs/pcr/pcr.c b/rigs/pcr/pcr.c index 8352987f..8add36da 100644 --- a/rigs/pcr/pcr.c +++ b/rigs/pcr/pcr.c @@ -76,7 +76,7 @@ * Don't even touch a single bit! indexes will be used in the protocol! * 51 tones, the 60.0 Hz tone is missing. */ -const tone_t pcr_ctcss_list[] = +tone_t pcr_ctcss_list[] = { 670, 693, 710, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, @@ -91,7 +91,7 @@ const tone_t pcr_ctcss_list[] = * Don't even touch a single bit! indexes will be used in the protocol! * 104 codes */ -const tone_t pcr_dcs_list[] = +tone_t pcr_dcs_list[] = { 23, 25, 26, 31, 32, 36, 43, 47, 51, 53, 54, 65, 71, 72, 73, 74, 114, 115, 116, 122, 125, 131, diff --git a/rigs/pcr/pcr.h b/rigs/pcr/pcr.h index 25516ca1..89714f1f 100644 --- a/rigs/pcr/pcr.h +++ b/rigs/pcr/pcr.h @@ -81,8 +81,8 @@ struct pcr_priv_caps #define pcr_caps(rig) ((struct pcr_priv_caps *)(rig)->caps->priv) -extern const tone_t pcr_ctcss_list[]; -extern const tone_t pcr_dcs_list[]; +extern tone_t pcr_ctcss_list[]; +extern tone_t pcr_dcs_list[]; int pcr_init(RIG *rig); int pcr_cleanup(RIG *rig); diff --git a/rigs/uniden/bc898.c b/rigs/uniden/bc898.c index bfaa4f6b..dd55beac 100644 --- a/rigs/uniden/bc898.c +++ b/rigs/uniden/bc898.c @@ -53,7 +53,7 @@ { 255, 60 }, \ } } -static const tone_t bc898_ctcss_list[] = +static tone_t bc898_ctcss_list[] = { 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 68ecf9da..bdd81e9a 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -55,7 +55,7 @@ uniden_id_string_list[] = }; -const tone_t uniden_ctcss_list[] = +tone_t uniden_ctcss_list[] = { 670, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, @@ -64,7 +64,7 @@ const tone_t uniden_ctcss_list[] = 2418, 2503, 0 }; -const tone_t uniden_dcs_list[] = +tone_t uniden_dcs_list[] = { 23, 25, 26, 31, 32, 36, 43, 47, 51, 53, 54, 65, 71, 72, 73, 74, 114, 115, 116, 122, diff --git a/rigs/uniden/uniden.h b/rigs/uniden/uniden.h index ed3eea64..97d5f329 100644 --- a/rigs/uniden/uniden.h +++ b/rigs/uniden/uniden.h @@ -51,11 +51,11 @@ { 255, 60 }, \ } } -extern const tone_t uniden_ctcss_list[]; -extern const tone_t uniden_dcs_list[]; +extern tone_t uniden_ctcss_list[]; +extern tone_t uniden_dcs_list[]; int uniden_transaction (RIG *rig, const char *cmdstr, int cmd_len, - const char *replystr, char *data, size_t *datasize); +const char *replystr, char *data, size_t *datasize); int uniden_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int uniden_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); int uniden_get_freq_2(RIG *rig, vfo_t vfo, freq_t *freq); diff --git a/rigs/yaesu/ft100.c b/rigs/yaesu/ft100.c index da0a018c..52b18a8b 100644 --- a/rigs/yaesu/ft100.c +++ b/rigs/yaesu/ft100.c @@ -120,7 +120,7 @@ static const yaesu_cmd_set_t ncmd[] = }; -static const tone_t ft100_ctcss_list[] = +static tone_t ft100_ctcss_list[] = { 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, \ 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, \ @@ -129,7 +129,7 @@ static const tone_t ft100_ctcss_list[] = 2503, 0 }; -static const tone_t ft100_dcs_list[] = +static tone_t ft100_dcs_list[] = { 23, 25, 26, 31, 32, 36, 43, 47, 51, 53, \ 54, 65, 71, 72, 73, 74, 114, 115, 116, 122, 125, 131, \ diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 0d59d7eb..814f6b59 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -157,7 +157,7 @@ static const yaesu_cmd_set_t ncmd[] = /** * 33 CTCSS sub-audible tones */ -static const tone_t ft1000mp_ctcss_list[] = +static tone_t ft1000mp_ctcss_list[] = { 670, 719, 770, 825, 885, 948, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c index a406431b..ec4a023e 100644 --- a/rigs/yaesu/ft736.c +++ b/rigs/yaesu/ft736.c @@ -80,7 +80,7 @@ static int ft736_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone); /* Some tones are present twice, the second value is * higher Q (80), according to manual. */ -static const tone_t ft736_ctcss_list[] = +static tone_t ft736_ctcss_list[] = { 670, 719, 770, 825, 885, 948, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, 1318, 1365, 1413, 1462, 1514, 1567, diff --git a/rigs/yaesu/ft767gx.c b/rigs/yaesu/ft767gx.c index 9ddad66b..290f4a6d 100644 --- a/rigs/yaesu/ft767gx.c +++ b/rigs/yaesu/ft767gx.c @@ -249,7 +249,7 @@ struct ft767_priv_data unsigned char ack_cmd[5]; }; -const tone_t static_767gx_ctcss_list[] = +tone_t static_767gx_ctcss_list[] = { CTCSS_TONE_LIST }; diff --git a/rigs/yaesu/ft847.c b/rigs/yaesu/ft847.c index 9ac8e081..da42a36d 100644 --- a/rigs/yaesu/ft847.c +++ b/rigs/yaesu/ft847.c @@ -193,7 +193,7 @@ static const yaesu_cmd_set_t ncmd[] = * 39 CTCSS sub-audible tones * c.f. ft847_set_ctcss_tone() */ -static const tone_t ft847_ctcss_list[] = +static tone_t ft847_ctcss_list[] = { 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, diff --git a/src/tones.c b/src/tones.c index bb3ec009..d5c2ff8b 100644 --- a/src/tones.c +++ b/src/tones.c @@ -44,7 +44,7 @@ /** * 52 CTCSS sub-audible tones */ -const tone_t full_ctcss_list[] = { FULL_CTCSS_LIST }; +tone_t full_ctcss_list[] = { FULL_CTCSS_LIST }; /** * 50 CTCSS sub-audible tones, from 67.0Hz to 254.1Hz @@ -53,17 +53,17 @@ const tone_t full_ctcss_list[] = { FULL_CTCSS_LIST }; * backends depend on it. If you need to, create a copy for your * own caps. --SF */ -const tone_t common_ctcss_list[] = { COMMON_CTCSS_LIST }; +tone_t common_ctcss_list[] = { COMMON_CTCSS_LIST }; /** * 104 DCS codes */ -const tone_t common_dcs_list[] = { COMMON_DCS_LIST }; +tone_t common_dcs_list[] = { COMMON_DCS_LIST }; /** * 106 DCS codes */ -const tone_t full_dcs_list[] = { FULL_DCS_LIST }; +tone_t full_dcs_list[] = { FULL_DCS_LIST }; #endif diff --git a/src/tones.h b/src/tones.h index 85255433..204b66f7 100644 --- a/src/tones.h +++ b/src/tones.h @@ -37,10 +37,12 @@ 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, +#if 0 static const tone_t static_full_ctcss_list[] = { FULL_CTCSS_LIST }; +#endif #define FULL_CTCSS_LIST_COUNT 52 @@ -60,10 +62,12 @@ static const tone_t static_full_ctcss_list[] = 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, +#if 0 static const tone_t static_common_ctcss_list[] = { COMMON_CTCSS_LIST }; +#endif #define COMMON_CTCSS_LIST_COUNT 50 @@ -83,10 +87,12 @@ static const tone_t static_common_ctcss_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, +#if 0 static const tone_t static_common_dcs_list[] = { COMMON_DCS_LIST }; +#endif #define COMMON_DCS_LIST_COUNT 104 @@ -105,10 +111,12 @@ static const tone_t static_common_dcs_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, +#if 0 static const tone_t static_full_dcs_list[] = { FULL_DCS_LIST }; +#endif #define FULL_DCS_LIST_COUNT 106 @@ -124,10 +132,10 @@ static const tone_t static_full_dcs_list[] = #else -extern const HAMLIB_EXPORT_VAR(tone_t) full_ctcss_list[]; -extern const HAMLIB_EXPORT_VAR(tone_t) common_ctcss_list[]; -extern const HAMLIB_EXPORT_VAR(tone_t) full_dcs_list[]; -extern const HAMLIB_EXPORT_VAR(tone_t) common_dcs_list[]; +extern HAMLIB_EXPORT_VAR(tone_t) full_ctcss_list[]; +extern HAMLIB_EXPORT_VAR(tone_t) common_ctcss_list[]; +extern HAMLIB_EXPORT_VAR(tone_t) full_dcs_list[]; +extern HAMLIB_EXPORT_VAR(tone_t) common_dcs_list[]; #endif diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 2e6813b4..01892211 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4350,6 +4350,23 @@ declare_proto_rig(dump_state) fprintf(fout, "has_power2mW=%d\n", rig->caps->power2mW != NULL); fprintf(fout, "has_mW2power=%d\n", rig->caps->mW2power != NULL); fprintf(fout, "timeout=%d\n", rig->caps->timeout); + fprintf(fout, "ctcss_list="); + for (i = 0; i < CTCSS_LIST_SIZE && rig->caps->ctcss_list[i] != 0; i++) + { + fprintf(fout, + " %u.%1u", + rig->caps->ctcss_list[i] / 10, rig->caps->ctcss_list[i] % 10); + } + fprintf(fout, "\n"); + fprintf(fout, "dcs_list="); + for (i = 0; i < DCS_LIST_SIZE && rig->caps->dcs_list[i] != 0; i++) + { + fprintf(fout, + " %u", + rig->caps->dcs_list[i]); + } + fprintf(fout, "\n"); + fprintf(fout, "done\n"); } commit 4e60ebf1d6928bd8c7d3b485c6f4d045a75e7af7 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 29 09:00:59 2021 -0500 Fix rig_get_vfo_info in rig.swg https://github.com/Hamlib/Hamlib/commit/6c13951da8928e8201cc59f9db3ff1dbfe71db9b#commitcomment-50159464 diff --git a/bindings/rig.swg b/bindings/rig.swg index 0d1c05fd..e34168e6 100644 --- a/bindings/rig.swg +++ b/bindings/rig.swg @@ -449,7 +449,7 @@ typedef channel_t * const_channel_t_p; METHOD1VGET(get_xit, shortfreq_t) METHOD1VGET(get_ts, shortfreq_t) extern void get_ant(ant_t *ant_rx, ant_t *ant_tx, ant_t *ant_curr, value_t * OUTPUT, ant_t ant, vfo_t vfo = RIG_VFO_CURR); - extern void get_vfo_info (split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo = RIG_VFO_CURR); + extern void get_vfo_info (int *satmode, split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo = RIG_VFO_CURR); METHOD1VGET(get_mem, int) METHOD1GET(get_powerstat, powerstat_t) METHOD1GET(get_trn, int) @@ -605,9 +605,9 @@ void Rig_get_ant(Rig *self, ant_t *ant_rx, ant_t *ant_tx, ant_t *ant_curr, value { self->error_status = rig_get_ant(self->rig, vfo, ant, option, ant_curr, ant_tx, ant_rx); } -void Rig_get_vfo_info (Rig *self, split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo) +void Rig_get_vfo_info (Rig *self, int *satmode, split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo) { - self->error_status = rig_get_vfo_info(self->rig, vfo, freq, mode, width, split); + self->error_status = rig_get_vfo_info(self->rig, vfo, freq, mode, width, split, satmode); } ----------------------------------------------------------------------- Summary of changes: bindings/rig.swg | 6 ++--- include/hamlib/rig.h | 6 +++-- rigs/dummy/netrigctl.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++--- rigs/kenwood/kenwood.c | 6 ++--- rigs/kenwood/kenwood.h | 6 ++--- rigs/kenwood/pihpsdr.c | 4 +-- rigs/kenwood/thf6a.c | 2 +- rigs/kenwood/thf7.c | 2 +- rigs/kenwood/tmd710.c | 11 +++++--- rigs/kenwood/ts2000.c | 4 +-- rigs/pcr/pcr.c | 4 +-- rigs/pcr/pcr.h | 4 +-- rigs/uniden/bc898.c | 2 +- rigs/uniden/uniden.c | 4 +-- rigs/uniden/uniden.h | 6 ++--- rigs/yaesu/ft100.c | 4 +-- rigs/yaesu/ft1000mp.c | 2 +- rigs/yaesu/ft736.c | 2 +- rigs/yaesu/ft767gx.c | 2 +- rigs/yaesu/ft847.c | 2 +- src/tones.c | 8 +++--- src/tones.h | 16 ++++++------ tests/rigctl_parse.c | 20 +++++++++++++++ 23 files changed, 140 insertions(+), 53 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |