hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 19)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael B. <mdb...@us...> - 2021-01-28 20:27:32
|
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 0d6958781ded6093395b0e31ea57ecaf3f9d8dd3 (commit) via 7838539a3b963eb1238d7407713a7669b57f280c (commit) via 4b41c0dbfc195cf4088cb82e8230490611f90c99 (commit) via 7b04640cea96e44c50b98b1b1d247c9d51fca0b8 (commit) via 03924db38cc37f2f766dae96d717f5567c254792 (commit) via 58feda1a4ae329e9a146c6c5eaf9a76d3821f0ec (commit) via b5a18c17320222ff5283e1718a95732b0721eb9a (commit) via 887b289920014a92787e01de634a736c3921d251 (commit) from f2b7893a2b81c00e7a9998b376b846a34bab1205 (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 0d6958781ded6093395b0e31ea57ecaf3f9d8dd3 Merge: 7838539a 58feda1a Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 28 14:25:42 2021 -0600 Merge branch 'master' of http://github.com/Hamlib/Hamlib commit 7838539a3b963eb1238d7407713a7669b57f280c Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 28 14:25:26 2021 -0600 Add __FILENAME__ macro diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index c90b5dbd..733bf5ac 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -24,6 +24,8 @@ #ifndef _RIG_H #define _RIG_H 1 +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) + #include <stdio.h> #include <stdarg.h> #include <inttypes.h> commit 4b41c0dbfc195cf4088cb82e8230490611f90c99 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 28 12:24:22 2021 -0600 Let flrig use 5 second timeout from rig instead of overriding it diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 9c452cc7..11a5b2a9 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -404,8 +404,6 @@ static int read_transaction(RIG *rig, char *xml, int xml_len) rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__); - rs->rigport.timeout = 1000; // 1 second read string timeout - retry = 2; delims = "\n"; xml[0] = 0; diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 70c84b0d..bcd35b6b 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210123" +#define BACKEND_VER "20210128" #define EOM "\r" #define TRUE 1 commit 7b04640cea96e44c50b98b1b1d247c9d51fca0b8 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 28 12:22:52 2021 -0600 Fix read_string timeout display value diff --git a/src/iofunc.c b/src/iofunc.c index 060b9d1c..c4eb2b35 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -713,10 +713,10 @@ int HAMLIB_API read_string(hamlib_port_t *p, dump_hex((unsigned char *) rxbuffer, total_count); rig_debug(RIG_DEBUG_WARN, - "%s(): Timed out %d.%d seconds after %d chars\n", + "%s(): Timed out %d.%03d seconds after %d chars\n", __func__, (int)elapsed_time.tv_sec, - (int)elapsed_time.tv_usec, + (int)elapsed_time.tv_usec/1000, total_count); return -RIG_ETIMEOUT; commit 03924db38cc37f2f766dae96d717f5567c254792 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 28 10:25:05 2021 -0600 Modify __FILE__ to use __FILENAME__ macro to avoid full path in misc.c diff --git a/src/misc.h b/src/misc.h index d4ff18e2..085ceb62 100644 --- a/src/misc.h +++ b/src/misc.h @@ -138,10 +138,11 @@ extern HAMLIB_EXPORT(int) parse_hoststr(char *host, char hoststr[256], char port # endif #endif +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) void errmsg(int err, char *s, const char *func, const char *file, int line); -#define ERRMSG(err, s) errmsg(err, s, __func__, __FILE__, __LINE__) -#define ENTERFUNC rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s entered\n", __FILE__, __LINE__, __func__) -#define RETURNFUNC(rc) {rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s return\n", __FILE__, __LINE__, __func__);return rc;} +#define ERRMSG(err, s) errmsg(err, s, __func__, __FILENAME__, __LINE__) +#define ENTERFUNC rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s entered\n", __FILENAME__, __LINE__, __func__) +#define RETURNFUNC(rc) {rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s return\n", __FILENAME__, __LINE__, __func__);return rc;} #define CACHE_RESET {\ elapsed_ms(&rig->state.cache.time_freq, HAMLIB_ELAPSED_INVALIDATE);\ commit 58feda1a4ae329e9a146c6c5eaf9a76d3821f0ec Merge: f2b7893a b5a18c17 Author: Michael Black <mdb...@ya...> Date: Wed Jan 27 12:59:43 2021 -0600 Merge pull request #519 from code-posse/master SatEL motion bugfix commit b5a18c17320222ff5283e1718a95732b0721eb9a Merge: 887b2899 f2b7893a Author: Joshua Lynch <jo...@co...> Date: Wed Jan 27 12:44:07 2021 -0600 merged upstream/master into master commit 887b289920014a92787e01de634a736c3921d251 Author: Joshua Lynch <jo...@co...> Date: Wed Jan 27 12:40:18 2021 -0600 fixed state bug. reconnecting would disable motion every other connect. diff --git a/rotators/satel/satel.c b/rotators/satel/satel.c index 6a0e12db..e350a1f7 100644 --- a/rotators/satel/satel.c +++ b/rotators/satel/satel.c @@ -115,25 +115,64 @@ struct satel_stat }; -static int satel_read_status(ROT *rot, satel_stat_t *stat) +static int satel_cmd(ROT *rot, char *cmd, int cmdlen, char *res, int reslen) { - char resbuf[BUF_SIZE]; - char *p; int ret; struct rot_state *rs; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rs = &rot->state; - - // XXX skip for now - for (int i = 0; i < 3; i++) + rig_flush(&rs->rotport); + + ret = write_block(&rs->rotport, cmd, cmdlen); + if (ret != RIG_OK) + return ret; + + if (reslen > 0 && res != NULL) { - ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + ret = read_string(&rs->rotport, res, reslen, "\n", 1); if (ret < 0) return ret; } + + return RIG_OK; +} + + +static int satel_read_status(ROT *rot, satel_stat_t *stat) +{ + char resbuf[BUF_SIZE]; + char *p; + int ret; + struct rot_state *rs; + + + rs = &rot->state; + + + + // read motion state + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + stat->motion_enabled = strcmp(resbuf, "Motion ENABLED") == 0 ? true : false; + + // XXX skip mode + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + // XXX skip time + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + // read azimuth line ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); if (ret < 0) @@ -152,44 +191,32 @@ static int satel_read_status(ROT *rot, satel_stat_t *stat) p[3] = '\0'; stat->el = (int)strtof(p, NULL); - // XXX skip for now - for (int i = 0; i < 2; i++) - { - ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); - if (ret < 0) - return ret; - } + // skip blank line + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + // XXX skip stored position count + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + return RIG_OK; } -static int satel_cmd(ROT *rot, char *cmd, int cmdlen, char *res, int reslen) +static int satel_get_status(ROT *rot, satel_stat_t *stat) { int ret; - struct rot_state *rs; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - - rs = &rot->state; - - rig_flush(&rs->rotport); - - ret = write_block(&rs->rotport, cmd, cmdlen); + ret = satel_cmd(rot, "z", 1, NULL, 0); if (ret != RIG_OK) return ret; - if (reslen > 0 && res != NULL) - { - ret = read_string(&rs->rotport, res, reslen, "\n", 1); - if (ret < 0) - return ret; - } - - return RIG_OK; + return satel_read_status(rot, stat); } @@ -217,11 +244,6 @@ static int satel_rot_open(ROT *rot) if (ret != RIG_OK) return ret; - // enable motion - ret = satel_cmd(rot, "g", 1, NULL, 0); - if (ret != RIG_OK) - return ret; - return RIG_OK; } @@ -236,6 +258,17 @@ static int satel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__, az, el); + + ret = satel_get_status(rot, &stat); + if (ret < 0) + return ret; + + if (stat.motion_enabled == false) + { + ret = satel_cmd(rot, "g", 1, NULL, 0); + if (ret != RIG_OK) + return ret; + } snprintf(cmdbuf, BUF_SIZE, "p%d %d\r\n", (int)az, (int)el); ret = satel_cmd(rot, cmdbuf, strlen(cmdbuf), NULL, 0); @@ -261,11 +294,7 @@ static int satel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - ret = satel_cmd(rot, "z", 1, NULL, 0); - if (ret != RIG_OK) - return ret; - - ret = satel_read_status(rot, &stat); + ret = satel_get_status(rot, &stat); if (ret < 0) return ret; ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 2 + rigs/dummy/flrig.c | 2 - rigs/dummy/flrig.h | 2 +- rotators/satel/satel.c | 113 +++++++++++++++++++++++++++++++------------------ src/iofunc.c | 4 +- src/misc.h | 7 +-- 6 files changed, 80 insertions(+), 50 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-27 17:01:23
|
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 f2b7893a2b81c00e7a9998b376b846a34bab1205 (commit) via 30eca94210ece61603d2d09d88632125c66072b4 (commit) from 9695828b1994245d0ed9d2cb756ff9170209fc14 (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 f2b7893a2b81c00e7a9998b376b846a34bab1205 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 27 11:00:58 2021 -0600 Another attempt to get clock_gettime compiling for all Mac flavors diff --git a/src/misc.c b/src/misc.c index e5a0a6e7..eccb7ba1 100644 --- a/src/misc.c +++ b/src/misc.c @@ -60,22 +60,23 @@ #ifdef __APPLE__ -#include <AvailabilityMacros.h> +#include <time.h> -#if AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER +#if !defined(CLOCK_REALTIME) && !defined(CLOCK_MONOTONIC) +// +// MacOS < 10.12 does not have clock_gettime +// +// Contribution from github user "ra1nb0w" +// -#else - -# include <mach/mach_time.h> -# ifndef __clockid_t_defined +#define CLOCK_REALTIME 0 +#define CLOCK_MONOTONIC 6 typedef int clockid_t; -#define __clockid_t_defined 1 -# endif /* __clockid_t_defined */ -# define CLOCK_REALTIME 0 -# define CLOCK_MONOTONIC 1 +#include <sys/time.h> +#include <mach/mach_time.h> -int clock_gettime(clockid_t clock_id, struct timespec *tp) +static int clock_gettime(clockid_t clock_id, struct timespec *tp) { if (clock_id == CLOCK_REALTIME) { commit 30eca94210ece61603d2d09d88632125c66072b4 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 26 15:05:43 2021 -0600 Change MacOS detection logic for clock_gettime to hopefully cover all flavors diff --git a/src/misc.c b/src/misc.c index 3206fe67..e5a0a6e7 100644 --- a/src/misc.c +++ b/src/misc.c @@ -57,48 +57,64 @@ #include "misc.h" #include "serial.h" #include "network.h" + #ifdef __APPLE__ -#ifndef HAVE_CLOCK_GETTIME +#include <AvailabilityMacros.h> + +#if AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER + +#else # include <mach/mach_time.h> -# ifndef __clockid_t_defined - typedef enum clockid_t; - #define __clockid_t_defined 1 -# endif /* __clockid_t_defined */ - -# define CLOCK_REALTIME 0 -# define CLOCK_MONOTONIC 6 - -int clock_gettime(clockid_t clock_id, struct timespec* tp) -{ - if (clock_id == CLOCK_REALTIME) { - struct timeval t; - if (gettimeofday(&t, NULL) != 0) - return -1; - tp->tv_sec = t.tv_sec; - tp->tv_nsec = t.tv_usec * 1000; - } - else if (clock_id == CLOCK_MONOTONIC) { - static mach_timebase_info_data_t info = { 0, 0 }; - if (info.denom == 0) - mach_timebase_info(&info); - uint64_t t = mach_absolute_time() * info.numer / info.denom; - tp->tv_sec = t / 1000000000; - tp->tv_nsec = t % 1000000000; - } - else { - errno = EINVAL; - return -1; - } - - return 0; +# ifndef __clockid_t_defined +typedef int clockid_t; +#define __clockid_t_defined 1 +# endif /* __clockid_t_defined */ + +# define CLOCK_REALTIME 0 +# define CLOCK_MONOTONIC 1 + +int clock_gettime(clockid_t clock_id, struct timespec *tp) +{ + if (clock_id == CLOCK_REALTIME) + { + struct timeval t; + + if (gettimeofday(&t, NULL) != 0) + { + return -1; + } + + tp->tv_sec = t.tv_sec; + tp->tv_nsec = t.tv_usec * 1000; + } + else if (clock_id == CLOCK_MONOTONIC) + { + static mach_timebase_info_data_t info = { 0, 0 }; + + if (info.denom == 0) + { + mach_timebase_info(&info); + } + + uint64_t t = mach_absolute_time() * info.numer / info.denom; + tp->tv_sec = t / 1000000000; + tp->tv_nsec = t % 1000000000; + } + else + { + errno = EINVAL; + return -1; + } + + return 0; } + #endif // !HAVE_CLOCK_GETTIME #endif // __APPLE__ - /** * \brief Convert from binary to 4-bit BCD digits, little-endian * \param bcd_data ----------------------------------------------------------------------- Summary of changes: src/misc.c | 87 +++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 35 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-26 13:29:39
|
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 9695828b1994245d0ed9d2cb756ff9170209fc14 (commit) via a81b4db9bebb711681632c7427dd7dc7ec81d446 (commit) via 921220bfa5b04c3737262e9acc7a41b556da0759 (commit) from 610cd2608593139afcec2658a66ba9ba5dbe6a45 (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 9695828b1994245d0ed9d2cb756ff9170209fc14 Merge: a81b4db9 610cd260 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 26 07:29:03 2021 -0600 Merge branch 'master' of http://github.com/Hamlib/Hamlib commit a81b4db9bebb711681632c7427dd7dc7ec81d446 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 26 07:28:55 2021 -0600 Fix clock_gettime for Big Sur and hopefully older MacOS too diff --git a/src/misc.c b/src/misc.c index 2aa1ad56..3206fe67 100644 --- a/src/misc.c +++ b/src/misc.c @@ -59,11 +59,11 @@ #include "network.h" #ifdef __APPLE__ -#if !HAVE_CLOCK_GETTIME +#ifndef HAVE_CLOCK_GETTIME # include <mach/mach_time.h> # ifndef __clockid_t_defined - typedef int clockid_t; + typedef enum clockid_t; #define __clockid_t_defined 1 # endif /* __clockid_t_defined */ commit 921220bfa5b04c3737262e9acc7a41b556da0759 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 25 23:38:43 2021 -0600 Update NEWS diff --git a/NEWS b/NEWS index 4d78c5e0..a3fe9bcb 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ Copyright (C) 2000-2020 Michael Black W9MDB, and others Please send Hamlib bug reports to ham...@li... Version 4.1 + * rigctld and rigs should be more robust for disconnect problemsy * Several fixes for Icom and Yaesu rigs * Nobody should need to use rig->caps or rig->state anymore If you need a variable added please contact us. ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + src/misc.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2021-01-26 13:14:16
|
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 610cd2608593139afcec2658a66ba9ba5dbe6a45 (commit) from c717bb5d76939fa355c56dd84d850b1a3b889338 (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 610cd2608593139afcec2658a66ba9ba5dbe6a45 Author: Nate Bargmann <n0...@n0...> Date: Tue Jan 26 07:12:26 2021 -0600 Supply missing rotators/satel/Android.mk The use of 'make discheck' will detect such missing files before pushing out changes. diff --git a/rotators/satel/Android.mk b/rotators/satel/Android.mk new file mode 100644 index 00000000..7925dd54 --- /dev/null +++ b/rotators/satel/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := satel.c +LOCAL_MODULE := satel + +LOCAL_CFLAGS := -DHAVE_CONFIG_H +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/armeabi + +include $(BUILD_STATIC_LIBRARY) ----------------------------------------------------------------------- Summary of changes: rotators/{amsat => satel}/Android.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) copy rotators/{amsat => satel}/Android.mk (80%) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-26 04:25:26
|
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 c717bb5d76939fa355c56dd84d850b1a3b889338 (commit) from 54fc0e10f63767dd7e63728cd1715559de761c99 (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 c717bb5d76939fa355c56dd84d850b1a3b889338 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 25 22:24:57 2021 -0600 Improve -V version info diff --git a/tests/rigctl.c b/tests/rigctl.c index 799e5250..4411a6ea 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -177,7 +177,7 @@ int main(int argc, char *argv[]) exit(0); case 'V': - version(); + printf("rigctl %s\nLast commit was %s\n", hamlib_version, HAMLIBDATETIME); exit(0); case 'm': @@ -433,8 +433,7 @@ int main(int argc, char *argv[]) rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "rigctl %s\nLast commit was %s\n", hamlib_version, - HAMLIBDATETIME); + rig_debug(RIG_DEBUG_VERBOSE, "rigctl %s\nLast commit was %s\n", hamlib_version,HAMLIBDATETIME); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); diff --git a/tests/rigctld.c b/tests/rigctld.c index bd33cb8f..88cace9a 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -287,7 +287,7 @@ int main(int argc, char *argv[]) exit(0); case 'V': - version(); + printf("rigctl %s\nLast commit was %s\n", hamlib_version, HAMLIBDATETIME); exit(0); case 'm': ----------------------------------------------------------------------- Summary of changes: tests/rigctl.c | 5 ++--- tests/rigctld.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-25 18:26:16
|
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 54fc0e10f63767dd7e63728cd1715559de761c99 (commit) from e38c69602bdfadf0203ac6788f2e8787a3397c87 (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 54fc0e10f63767dd7e63728cd1715559de761c99 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 25 12:23:05 2021 -0600 Add clock change to misc.c to allow building hamlib on some mac platforms diff --git a/src/misc.c b/src/misc.c index a0b31cf8..2aa1ad56 100644 --- a/src/misc.c +++ b/src/misc.c @@ -57,6 +57,46 @@ #include "misc.h" #include "serial.h" #include "network.h" +#ifdef __APPLE__ + +#if !HAVE_CLOCK_GETTIME + +# include <mach/mach_time.h> +# ifndef __clockid_t_defined + typedef int clockid_t; + #define __clockid_t_defined 1 +# endif /* __clockid_t_defined */ + +# define CLOCK_REALTIME 0 +# define CLOCK_MONOTONIC 6 + +int clock_gettime(clockid_t clock_id, struct timespec* tp) +{ + if (clock_id == CLOCK_REALTIME) { + struct timeval t; + if (gettimeofday(&t, NULL) != 0) + return -1; + tp->tv_sec = t.tv_sec; + tp->tv_nsec = t.tv_usec * 1000; + } + else if (clock_id == CLOCK_MONOTONIC) { + static mach_timebase_info_data_t info = { 0, 0 }; + if (info.denom == 0) + mach_timebase_info(&info); + uint64_t t = mach_absolute_time() * info.numer / info.denom; + tp->tv_sec = t / 1000000000; + tp->tv_nsec = t % 1000000000; + } + else { + errno = EINVAL; + return -1; + } + + return 0; +} +#endif // !HAVE_CLOCK_GETTIME + +#endif // __APPLE__ /** ----------------------------------------------------------------------- Summary of changes: src/misc.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-25 17:20:49
|
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 e38c69602bdfadf0203ac6788f2e8787a3397c87 (commit) via 9322479117388eb7688992f420760ddf33c03aa7 (commit) via 14eb9af7fe21470b2cff03a3e66589ce4c5f4788 (commit) via ed5728c321a39905db7006f122c601d37ee13c06 (commit) via e6fa200152fb926ec8d6f76dd28eef0ab0303fe3 (commit) from 11be167354c87f6c2914a70d50f947486c332131 (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 e38c69602bdfadf0203ac6788f2e8787a3397c87 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 25 11:20:28 2021 -0600 astyle k3.c diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 1691f7b0..dc37c67d 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -2129,6 +2129,7 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = pwr; return retval; } + case RIG_LEVEL_RFPOWER_METER_WATTS: { struct kenwood_priv_data *priv = rig->state.priv; commit 9322479117388eb7688992f420760ddf33c03aa7 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 25 11:19:32 2021 -0600 Fix kx3/kx2 RFPOWER_METER_WATTS and buffer size diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index abe1f491..1691f7b0 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -181,7 +181,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1584,7 +1584,7 @@ static int k3_get_maxpower(RIG *rig) { int retval; int maxpower = 12; // K3 default power level - char levelbuf[16]; + char levelbuf[KENWOOD_MAX_BUF_LEN]; struct kenwood_priv_data *priv = rig->state.priv; // default range is 0-12 if there is no KPA3 installed @@ -2129,6 +2129,23 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = pwr; return retval; } + case RIG_LEVEL_RFPOWER_METER_WATTS: + { + struct kenwood_priv_data *priv = rig->state.priv; + char levelbuf[KENWOOD_MAX_BUF_LEN]; + int pwr; + + retval = kenwood_safe_transaction(rig, "PO", levelbuf, sizeof(levelbuf), 5); + + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf + 2, "%d", &pwr); + val->f = priv->has_kpa100 ? pwr : pwr / 10.0; + return retval; + } } return k3_get_level(rig, vfo, level, val); commit 14eb9af7fe21470b2cff03a3e66589ce4c5f4788 Merge: 11be1673 ed5728c3 Author: Michael Black <mdb...@ya...> Date: Mon Jan 25 11:15:17 2021 -0600 Merge pull request #518 from code-posse/master SatEL rotator support commit ed5728c321a39905db7006f122c601d37ee13c06 Author: Joshua Lynch <jo...@co...> Date: Sun Jan 24 23:54:07 2021 -0600 factored io functions out. improve reliability...i hope. diff --git a/rotators/satel/satel.c b/rotators/satel/satel.c index 1a9aa0e2..6a0e12db 100644 --- a/rotators/satel/satel.c +++ b/rotators/satel/satel.c @@ -1,5 +1,5 @@ /* - * Hamlib Sat/El backend - main file + * Hamlib SatEL backend - main file * Copyright (c) 2021 Joshua Lynch * * @@ -19,6 +19,7 @@ * */ +#include "hamlib/rig.h" #include <strings.h> #ifdef HAVE_CONFIG_H #include "config.h" @@ -32,6 +33,7 @@ #include <ctype.h> #include <stddef.h> #include <stdint.h> +#include <stdbool.h> #include "hamlib/rotator.h" #include "serial.h" @@ -41,14 +43,132 @@ #include "satel.h" -static int satel_rot_open(ROT *rot) +/** + * Protocol documentation. + * + * Apparently, the system is modeled after this one: + * “An Inexpensive Az-El Rotator System” + * "Dec, 1999, QST article by Jim Koehler, VE5FP + * + * '?' - returns 'SatEL\r\n'. a good test to see if there's + * connectivity. + * + * 'g' - enable motion. nothing happens without this enabled. + * + * 'z' - display rotator status. contains current Az/El among other + * things. here's an example: + * + * Motion ENABLED + * Mode 0 - azimuth break at NORTH + * Time: 2001/00/00 00:00:07 + * Azimuth = 000 Absolute = 000 + * Elevation = 000 + * + * Number of stored positions: 00 + * + * + * '*' - reset the rotator controller. + * + * 'pAZ EL\r\n' - tell the rotator where to point where AZ is the + * integer azimuth and EL is the integer + * elevation. e.g. 'p010 045\n'. the controller will + * report the current pointing status after the + * operation has completed. + * + * NOTE: The SatEL system changed a few commands as described in the + * user's manual. They are not used here. You can find the manual for + * this rotator here: + * + * http://www.codeposse.com/~jlynch/SatEL%20Az-EL.pdf + * + */ + +/** + * Idiosyncrasies + * + * - the controller does zero input checking. you can put it into an + * incredibly bad state very easily. + * + * - the controller doesn't accept any data whilst moving the + * rotators. In fact, you can put the controller into a bad state on + * occasion if you try and send it commands while its slewing the + * rotators. this means we have a really long read timeout so we can + * wait for the rotators to slew around before accepting any more + * commands. + * + */ + + + +#define BUF_SIZE 256 + + +typedef struct satel_stat satel_stat_t; +struct satel_stat +{ + bool motion_enabled; + int mode; + time_t time; + int absolute; + int az; + int el; +}; + + +static int satel_read_status(ROT *rot, satel_stat_t *stat) { - #define RES_BUF_SIZE 256 - char buf[RES_BUF_SIZE]; + char resbuf[BUF_SIZE]; + char *p; int ret; struct rot_state *rs; + rs = &rot->state; + + + // XXX skip for now + for (int i = 0; i < 3; i++) + { + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + } + + // read azimuth line + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + p = resbuf + 10; + p[3] = '\0'; + stat->az = (int)strtof(p, NULL); + + // read elevation line + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + p = resbuf + 12; + p[3] = '\0'; + stat->el = (int)strtof(p, NULL); + + // XXX skip for now + for (int i = 0; i < 2; i++) + { + ret = read_string(&rs->rotport, resbuf, BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + } + + return RIG_OK; +} + + +static int satel_cmd(ROT *rot, char *cmd, int cmdlen, char *res, int reslen) +{ + int ret; + struct rot_state *rs; + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -57,136 +177,123 @@ static int satel_rot_open(ROT *rot) rig_flush(&rs->rotport); - // check if we're connected to the rotator - ret = write_block(&rs->rotport, "?", 1); + ret = write_block(&rs->rotport, cmd, cmdlen); if (ret != RIG_OK) return ret; - ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); - if (ret < 0) + if (reslen > 0 && res != NULL) + { + ret = read_string(&rs->rotport, res, reslen, "\n", 1); + if (ret < 0) + return ret; + } + + + return RIG_OK; +} + + +static int satel_rot_open(ROT *rot) +{ + char resbuf[BUF_SIZE]; + int ret; + + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + + // are we connected? + ret = satel_cmd(rot, "?", 1, resbuf, BUF_SIZE); + if (ret != RIG_OK) return ret; - ret = strncasecmp("SatEL", buf, 5); + ret = strncasecmp("SatEL", resbuf, 5); if (ret != 0) - return RIG_EIO; + return -RIG_EIO; - // yep, now enable motion - ret = write_block(&rs->rotport, "g", 1); + // yep, reset system + ret = satel_cmd(rot, "*", 1, NULL, 0); + if (ret != RIG_OK) + return ret; + + // enable motion + ret = satel_cmd(rot, "g", 1, NULL, 0); if (ret != RIG_OK) return ret; - return RIG_OK; } + static int satel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) { -#define BUF_CMD_SIZE 20 - char buf[BUF_CMD_SIZE]; - struct rot_state *rs; + char cmdbuf[BUF_SIZE]; + int ret; + satel_stat_t stat; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__, az, el); - rs = &rot->state; + snprintf(cmdbuf, BUF_SIZE, "p%d %d\r\n", (int)az, (int)el); + ret = satel_cmd(rot, cmdbuf, strlen(cmdbuf), NULL, 0); + if (ret != RIG_OK) + return ret; - rig_flush(&rs->rotport); + // wait-for, read and discard the status message + ret = satel_read_status(rot, &stat); + if (ret < 0) + return ret; + - snprintf(buf, BUF_CMD_SIZE, "p%03d %03d\r\n", (int)az, (int)el); - return write_block(&rs->rotport, buf, strlen(buf)); + return RIG_OK; } + static int satel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { - #define RES_BUF_SIZE 256 - char buf[RES_BUF_SIZE]; - char *p; int ret; - struct rot_state *rs; - + satel_stat_t stat; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - rs = &rot->state; - - rig_flush(&rs->rotport); - - ret = write_block(&rs->rotport, "z", 1); + ret = satel_cmd(rot, "z", 1, NULL, 0); if (ret != RIG_OK) return ret; - - // skip header information - for (int i = 0; i < 3; i++) - { - ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); - if (ret < 0) - return ret; - } - - - // read azimuth line - ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); + ret = satel_read_status(rot, &stat); if (ret < 0) return ret; - p = buf + 10; - p[3] = '\0'; - *az = strtof(p, NULL); - - rig_debug(RIG_DEBUG_VERBOSE, "AZIMUTH %f[%s]", *az, p); - - - // read elevation line - ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); - if (ret < 0) - return ret; - - p = buf + 12; - p[3] = '\0'; - *el = strtof(p, NULL); + *az = stat.az; + *el = stat.el; - rig_debug(RIG_DEBUG_VERBOSE, "ELEVATION %f[%s]", *el, p); - // skip trailer information - for (int i = 0; i < 2; i++) - { - ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); - if (ret < 0) - return ret; - } - - return RIG_OK; } static int satel_rot_stop(ROT *rot) { - struct rot_state *rs; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - rs = &rot->state; - - rig_flush(&rs->rotport); - - return write_block(&rs->rotport, "*", 1); + // send reset command + return satel_cmd(rot, "*", 1, NULL, 0); } + static const char *satel_rot_get_info(ROT *rot) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - return "Satel rotator"; + return "SatEL rotator"; } + /* * Satel rotator capabilities. */ @@ -206,9 +313,9 @@ const struct rot_caps satel_rot_caps = .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, - .write_delay = 250, + .write_delay = 0, .post_write_delay = 0, - .timeout = 1000, + .timeout = 60000, .retry = 0, .min_az = 0., .max_az = 360., diff --git a/rotators/satel/satel.h b/rotators/satel/satel.h index 8f5dfd93..402f234b 100644 --- a/rotators/satel/satel.h +++ b/rotators/satel/satel.h @@ -1,5 +1,5 @@ /* - * Hamlib Sat/El backend - main header + * Hamlib SatEL backend - main header * Copyright (c) 2021 Joshua Lynch * * commit e6fa200152fb926ec8d6f76dd28eef0ab0303fe3 Author: Joshua Lynch <jo...@co...> Date: Sat Jan 23 23:26:01 2021 -0600 initial SatEL rotator support diff --git a/configure.ac b/configure.ac index cea90ff5..3c4a6ee0 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,7 @@ dnl Beware of duplication should a backend directory include both rig and dnl rotor definitions, e.g. "dummy". Optional backends will not be listed dnl here but will be added later, e.g. "winradio". RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu" -ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron" +ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft" @@ -842,6 +842,7 @@ rotators/sartek/Makefile rotators/spid/Makefile rotators/ts7400/Makefile rotators/indi/Makefile +rotators/satel/Makefile rigs/adat/Makefile rigs/alinco/Makefile rigs/aor/Makefile diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index bab32d20..29de6eba 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -491,6 +491,20 @@ #define ROT_MODEL_INDI ROT_MAKE_MODEL(ROT_INDI, 1) +/** + * \def ROT_MODEL_SATEL + * \brief A macro that returns the model number of the SatEL backend. + * + * The SatEL backend can be used with rotators that support the VE5FP + * interface. + */ +//! @cond Doxygen_Suppress +#define ROT_SATEL 21 +#define ROT_BACKEND_SATEL "satel" +//! @endcond +#define ROT_MODEL_SATEL ROT_MAKE_MODEL(ROT_SATEL, 1) + + /** diff --git a/rotators/satel/Makefile.am b/rotators/satel/Makefile.am new file mode 100644 index 00000000..920baa1c --- /dev/null +++ b/rotators/satel/Makefile.am @@ -0,0 +1,6 @@ +SATELSRC = satel.c satel.h + +noinst_LTLIBRARIES = libhamlib-satel.la +libhamlib_satel_la_SOURCES = $(SATELSRC) + +EXTRA_DIST = Android.mk diff --git a/rotators/satel/satel.c b/rotators/satel/satel.c new file mode 100644 index 00000000..1a9aa0e2 --- /dev/null +++ b/rotators/satel/satel.c @@ -0,0 +1,232 @@ +/* + * Hamlib Sat/El backend - main file + * Copyright (c) 2021 Joshua Lynch + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include <strings.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <math.h> +#include <ctype.h> +#include <stddef.h> +#include <stdint.h> + +#include "hamlib/rotator.h" +#include "serial.h" +#include "misc.h" +#include "register.h" + +#include "satel.h" + + +static int satel_rot_open(ROT *rot) +{ + #define RES_BUF_SIZE 256 + char buf[RES_BUF_SIZE]; + int ret; + struct rot_state *rs; + + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + + rs = &rot->state; + + rig_flush(&rs->rotport); + + // check if we're connected to the rotator + ret = write_block(&rs->rotport, "?", 1); + if (ret != RIG_OK) + return ret; + + ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + ret = strncasecmp("SatEL", buf, 5); + if (ret != 0) + return RIG_EIO; + + // yep, now enable motion + ret = write_block(&rs->rotport, "g", 1); + if (ret != RIG_OK) + return ret; + + + return RIG_OK; +} + +static int satel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) +{ +#define BUF_CMD_SIZE 20 + char buf[BUF_CMD_SIZE]; + struct rot_state *rs; + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__, + az, el); + + + rs = &rot->state; + + rig_flush(&rs->rotport); + + snprintf(buf, BUF_CMD_SIZE, "p%03d %03d\r\n", (int)az, (int)el); + return write_block(&rs->rotport, buf, strlen(buf)); +} + +static int satel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) +{ + #define RES_BUF_SIZE 256 + char buf[RES_BUF_SIZE]; + char *p; + int ret; + struct rot_state *rs; + + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + + rs = &rot->state; + + rig_flush(&rs->rotport); + + ret = write_block(&rs->rotport, "z", 1); + if (ret != RIG_OK) + return ret; + + + // skip header information + for (int i = 0; i < 3; i++) + { + ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + } + + + // read azimuth line + ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + p = buf + 10; + p[3] = '\0'; + *az = strtof(p, NULL); + + rig_debug(RIG_DEBUG_VERBOSE, "AZIMUTH %f[%s]", *az, p); + + + // read elevation line + ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + + p = buf + 12; + p[3] = '\0'; + *el = strtof(p, NULL); + + rig_debug(RIG_DEBUG_VERBOSE, "ELEVATION %f[%s]", *el, p); + + // skip trailer information + for (int i = 0; i < 2; i++) + { + ret = read_string(&rs->rotport, buf, RES_BUF_SIZE, "\n", 1); + if (ret < 0) + return ret; + } + + + return RIG_OK; +} + + +static int satel_rot_stop(ROT *rot) +{ + struct rot_state *rs; + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + + rs = &rot->state; + + rig_flush(&rs->rotport); + + return write_block(&rs->rotport, "*", 1); +} + +static const char *satel_rot_get_info(ROT *rot) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + return "Satel rotator"; +} + +/* + * Satel rotator capabilities. + */ +const struct rot_caps satel_rot_caps = +{ + ROT_MODEL(ROT_MODEL_SATEL), + .model_name = "SatEL", + .mfg_name = "SatEL", + .version = "20210123.0", + .copyright = "LGPL", + .status = RIG_STATUS_ALPHA, + .rot_type = ROT_TYPE_AZEL, + .port_type = RIG_PORT_SERIAL, + .serial_rate_max = 9600, + .serial_rate_min = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 250, + .post_write_delay = 0, + .timeout = 1000, + .retry = 0, + .min_az = 0., + .max_az = 360., + .min_el = 0., + .max_el = 90., + .rot_open = satel_rot_open, + .get_position = satel_rot_get_position, + .set_position = satel_rot_set_position, + .stop = satel_rot_stop, + .get_info = satel_rot_get_info, + .priv = NULL, /* priv */ +}; + +DECLARE_INITROT_BACKEND(satel) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); + + rot_register(&satel_rot_caps); + + return RIG_OK; +} diff --git a/rotators/satel/satel.h b/rotators/satel/satel.h new file mode 100644 index 00000000..8f5dfd93 --- /dev/null +++ b/rotators/satel/satel.h @@ -0,0 +1,28 @@ +/* + * Hamlib Sat/El backend - main header + * Copyright (c) 2021 Joshua Lynch + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef _ROT_SATEL_H +#define _ROT_SATEL_H 1 + +extern const struct rot_caps satel_rot_caps; + + +#endif /* _ROT_SATEL_H */ diff --git a/src/rot_reg.c b/src/rot_reg.c index 3353e7bc..8a341872 100644 --- a/src/rot_reg.c +++ b/src/rot_reg.c @@ -84,6 +84,7 @@ DEFINE_INITROT_BACKEND(cnctrk); DEFINE_INITROT_BACKEND(prosistel); DEFINE_INITROT_BACKEND(meade); DEFINE_INITROT_BACKEND(ioptron); +DEFINE_INITROT_BACKEND(satel); #if HAVE_LIBINDI DEFINE_INITROT_BACKEND(indi); #endif @@ -126,6 +127,7 @@ static struct { ROT_PROSISTEL, ROT_BACKEND_PROSISTEL, ROT_FUNCNAMA(prosistel) }, { ROT_MEADE, ROT_BACKEND_MEADE, ROT_FUNCNAMA(meade) }, { ROT_IOPTRON, ROT_BACKEND_IOPTRON, ROT_FUNCNAMA(ioptron) }, + { ROT_SATEL, ROT_BACKEND_SATEL, ROT_FUNCNAMA(satel) }, #if HAVE_LIBINDI { ROT_INDI, ROT_BACKEND_INDI, ROT_FUNCNAMA(indi) }, #endif ----------------------------------------------------------------------- Summary of changes: configure.ac | 3 +- include/hamlib/rotlist.h | 14 ++ rigs/kenwood/k3.c | 22 ++- rotators/satel/Makefile.am | 6 + rotators/satel/satel.c | 339 ++++++++++++++++++++++++++++++++ rotators/{m2/rc2800.h => satel/satel.h} | 12 +- src/rot_reg.c | 2 + 7 files changed, 390 insertions(+), 8 deletions(-) create mode 100644 rotators/satel/Makefile.am create mode 100644 rotators/satel/satel.c copy rotators/{m2/rc2800.h => satel/satel.h} (80%) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2021-01-25 13:14:21
|
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 11be167354c87f6c2914a70d50f947486c332131 (commit) from fda709c7af2fee6fe8d09226c8de6b9833613fce (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 11be167354c87f6c2914a70d50f947486c332131 Author: Nate Bargmann <n0...@n0...> Date: Mon Jan 25 07:13:26 2021 -0600 Correct typo causing compilation failure diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 173b3ce2..3871e810 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -76,7 +76,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX-101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".8z + .version = NEWCAT_VER ".8z", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ftdx101.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-25 04:43:35
|
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 fda709c7af2fee6fe8d09226c8de6b9833613fce (commit) from 1b89407a8d64a6895f935afc8dec8f032336be16 (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 fda709c7af2fee6fe8d09226c8de6b9833613fce Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 22:43:07 2021 -0600 Change FTDX101 to 2 stop bits diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 24a77bd3..173b3ce2 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -76,7 +76,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX-101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".7", + .version = NEWCAT_VER ".8z .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -86,7 +86,7 @@ const struct rig_caps ftdx101d_caps = .serial_rate_min = 4800, .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, + .serial_stop_bits = 2, .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FTDX101_WRITE_DELAY, ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ftdx101.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-24 23:20:22
|
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 1b89407a8d64a6895f935afc8dec8f032336be16 (commit) via b5c60e50fb83bd9aa80af7f7c7199e5920835dc2 (commit) via 018c053d7b60abb47ebe7efa48065a78f1d19147 (commit) via d75a23d15615a03cf95f11ee5216b893960dcf47 (commit) via 7e6adc6d2a69e6bb41809f59e9103c8cc156fae3 (commit) from f1fd159b9a964328b3811181ea9354773c253686 (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 1b89407a8d64a6895f935afc8dec8f032336be16 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 17:19:58 2021 -0600 Fix compilation of rigctld.c on mingw diff --git a/tests/rigctld.c b/tests/rigctld.c index 7e74f03b..bd33cb8f 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -972,6 +972,7 @@ int main(int argc, char *argv[]) static FILE*get_fsockout(struct handle_data *handle_data_arg) { #ifdef __MINGW32__ + int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY); return _fdopen(sock_osfhandle, "wb"); #else return fdopen(handle_data_arg->sock, "wb"); @@ -986,7 +987,7 @@ static FILE* get_fsockin(struct handle_data *handle_data_arg) if (sock_osfhandle == -1) { rig_debug(RIG_DEBUG_ERR, "_open_osfhandle error: %s\n", strerror(errno)); - goto handle_exit; + return NULL; } return _fdopen(sock_osfhandle, "rb"); commit b5c60e50fb83bd9aa80af7f7c7199e5920835dc2 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 16:01:19 2021 -0600 Fix newcat.c compile error diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 1edde1b3..973217a8 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -781,9 +781,9 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo)); // when in split we can change VFOB but not VFOA - if (rig->state.split == RIG_SPLIT_ON && target_vfo == '0') return -RIG_ENTARGET; + if (rig->state.cache.split == RIG_SPLIT_ON && target_vfo == '0') return -RIG_ENTARGET; // when not in split we can't change VFOA at all - if (rig->state.split == RIG_SPLIT_OFF && target_vfo == '0') return -RIG_ENTARGET; + if (rig->state.cache.split == RIG_SPLIT_OFF && target_vfo == '0') return -RIG_ENTARGET; if (vfo != rig->state.tx_vfo) return -RIG_ENTARGET; } commit 018c053d7b60abb47ebe7efa48065a78f1d19147 Merge: d75a23d1 f1fd159b Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 12:58:53 2021 -0600 Merge branch 'master' of http://github.com/Hamlib/Hamlib commit d75a23d15615a03cf95f11ee5216b893960dcf47 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 12:52:44 2021 -0600 Fix ftdx101d set_freq behavior depending on split mode and VFO requested diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e0773367..1edde1b3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -779,8 +779,11 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // but they can change the TX vfo if (is_ftdx101 && rig->state.cache.ptt == RIG_PTT_ON) { - // then we can't change freq on the non-tx VFO rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo)); + // when in split we can change VFOB but not VFOA + if (rig->state.split == RIG_SPLIT_ON && target_vfo == '0') return -RIG_ENTARGET; + // when not in split we can't change VFOA at all + if (rig->state.split == RIG_SPLIT_OFF && target_vfo == '0') return -RIG_ENTARGET; if (vfo != rig->state.tx_vfo) return -RIG_ENTARGET; } commit 7e6adc6d2a69e6bb41809f59e9103c8cc156fae3 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 12:25:29 2021 -0600 Prevent ftdx101d from setting frequency on the non-tx vfo when in split mode diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3d9c04ea..e0773367 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -775,6 +775,15 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) target_vfo = 'A' == c ? '0' : '1'; + // some rigs like FTDX101D cannot change non-TX vfo freq + // but they can change the TX vfo + if (is_ftdx101 && rig->state.cache.ptt == RIG_PTT_ON) + { + // then we can't change freq on the non-tx VFO + rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo)); + if (vfo != rig->state.tx_vfo) return -RIG_ENTARGET; + } + if (rig->state.cache.ptt == RIG_PTT_ON) // we have a few rigs that can't set TX VFO while PTT_ON { @@ -6687,6 +6696,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) /* * newcat_set_tx_vfo does not set priv->curr_vfo + * does set rig->state.tx_vfo */ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) { @@ -6762,9 +6772,10 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", command, p1, cat_term); - rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); + rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s, vfo=%s\n", priv->cmd_str, rig_strvfo(tx_vfo)); + + rig->state.tx_vfo = tx_vfo; - /* Set TX VFO */ RETURNFUNC(newcat_set_cmd(rig)); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index bf6005ae..ba2e5096 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210123" +#define NEWCAT_VER "20210124" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 5 ++++- tests/rigctld.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-24 18:27:03
|
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 f1fd159b9a964328b3811181ea9354773c253686 (commit) via 2be172ac4ecfd5203d6ead8c172ee71343286a67 (commit) from c20125a264443133205aee0641647d8d01b0c50a (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 f1fd159b9a964328b3811181ea9354773c253686 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 12:25:29 2021 -0600 Prevent ftdx101d from setting frequency on the non-tx vfo when in split mode diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3d9c04ea..e0773367 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -775,6 +775,15 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) target_vfo = 'A' == c ? '0' : '1'; + // some rigs like FTDX101D cannot change non-TX vfo freq + // but they can change the TX vfo + if (is_ftdx101 && rig->state.cache.ptt == RIG_PTT_ON) + { + // then we can't change freq on the non-tx VFO + rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo)); + if (vfo != rig->state.tx_vfo) return -RIG_ENTARGET; + } + if (rig->state.cache.ptt == RIG_PTT_ON) // we have a few rigs that can't set TX VFO while PTT_ON { @@ -6687,6 +6696,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) /* * newcat_set_tx_vfo does not set priv->curr_vfo + * does set rig->state.tx_vfo */ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) { @@ -6762,9 +6772,10 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", command, p1, cat_term); - rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); + rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s, vfo=%s\n", priv->cmd_str, rig_strvfo(tx_vfo)); + + rig->state.tx_vfo = tx_vfo; - /* Set TX VFO */ RETURNFUNC(newcat_set_cmd(rig)); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index bf6005ae..ba2e5096 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210123" +#define NEWCAT_VER "20210124" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 2be172ac4ecfd5203d6ead8c172ee71343286a67 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 24 10:51:19 2021 -0600 Improve robustness of rigctld Now retries opening indefinitely Improved client side too Error message should now show timeout if rig disappears diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 5e2d661f..9c452cc7 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -541,6 +541,11 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, if (retval != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: write_transaction error=%d\n", __func__, retval); + + // if we get RIG_EIO the socket has probably disappeared + // so bubble up the error so port can re re-opened + if (retval == -RIG_EIO) { return retval; } + hl_usleep(50 * 1000); // 50ms sleep if error } diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 10f2dda1..70c84b0d 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210117" +#define BACKEND_VER "20210123" #define EOM "\r" #define TRUE 1 diff --git a/src/rig.c b/src/rig.c index 451617a4..735ddc8f 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1653,12 +1653,16 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); +#if 0 // don't think we really need this check + if (CHECK_RIG_ARG(rig) || !freq) { rig_debug(RIG_DEBUG_TRACE, "%s: rig or freq ptr invalid\n", __func__); RETURNFUNC(-RIG_EINVAL); } +#endif + curr_vfo = rig->state.current_vfo; // save vfo for restore later vfo = vfo_fixup(rig, vfo); diff --git a/tests/rigctl.c b/tests/rigctl.c index a23d0696..799e5250 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -615,6 +615,23 @@ int main(int argc, char *argv[]) { exitcode = 2; } + + rig_debug(RIG_DEBUG_ERR, "%s: XXXXXXXXX#1 retcode=%d\n", __func__, retcode); + if (retcode == -RIG_EIO || retcode == 2) + { + rig_debug(RIG_DEBUG_ERR, "%s: i/o error\n", __func__) + + do + { + retcode = rig_close(my_rig); + hl_usleep(1000 * 1000); + rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode); + retcode = rig_open(my_rig); + rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d\n", __func__, retcode); + } + while (retcode != RIG_OK); + + } } while (retcode == 0 || retcode == 2 || retcode == -RIG_ENAVAIL); diff --git a/tests/rigctld.c b/tests/rigctld.c index 4739e41b..7e74f03b 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -969,6 +969,31 @@ int main(int argc, char *argv[]) return 0; } +static FILE*get_fsockout(struct handle_data *handle_data_arg) +{ +#ifdef __MINGW32__ + return _fdopen(sock_osfhandle, "wb"); +#else + return fdopen(handle_data_arg->sock, "wb"); +#endif +} + +static FILE* get_fsockin(struct handle_data *handle_data_arg) +{ +#ifdef __MINGW32__ + int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY); + + if (sock_osfhandle == -1) + { + rig_debug(RIG_DEBUG_ERR, "_open_osfhandle error: %s\n", strerror(errno)); + goto handle_exit; + } + + return _fdopen(sock_osfhandle, "rb"); +#else + return fdopen(handle_data_arg->sock, "rb"); +#endif +} /* * This is the function run by the threads @@ -985,19 +1010,7 @@ void *handle_socket(void *arg) int ext_resp = 0; char resp_sep = '\n'; -#ifdef __MINGW32__ - int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY); - - if (sock_osfhandle == -1) - { - rig_debug(RIG_DEBUG_ERR, "_open_osfhandle error: %s\n", strerror(errno)); - goto handle_exit; - } - - fsockin = _fdopen(sock_osfhandle, "rb"); -#else - fsockin = fdopen(handle_data_arg->sock, "rb"); -#endif + fsockin = get_fsockin(handle_data_arg); if (!fsockin) { @@ -1006,11 +1019,7 @@ void *handle_socket(void *arg) goto handle_exit; } -#ifdef __MINGW32__ - fsockout = _fdopen(sock_osfhandle, "wb"); -#else - fsockout = fdopen(handle_data_arg->sock, "wb"); -#endif + fsockout = get_fsockout(handle_data_arg); if (!fsockout) { @@ -1055,7 +1064,7 @@ void *handle_socket(void *arg) do { - rig_debug(RIG_DEBUG_TRACE, "%s: vfo_mode=%d\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: doing rigctl_parse vfo_mode=%d\n", __func__, handle_data_arg->vfo_mode); retcode = rigctl_parse(handle_data_arg->rig, fsockin, fsockout, NULL, 0, sync_callback, @@ -1063,24 +1072,42 @@ void *handle_socket(void *arg) if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: rigctl_parse retcode=%d\n", __func__, retcode); } + +#if 0 // disabled -- don't think we need this + + // see https://github.com/Hamlib/Hamlib/issues/516 if (retcode == -1) { //sleep(1); // probably don't need this delay - continue; + //continue; + } + +#endif + + // if socket error or rigctld gets RIG_EIO we'll try to reopen + if (ferror(fsockin)) + { + rig_debug(RIG_DEBUG_ERR, "%s: sockin err=%s\n", __func__, strerror(errno)); + RETURNFUNC(NULL); } - if (ferror(fsockin) || ferror(fsockout)) + if (ferror(fsockin) || ferror(fsockout) || retcode == 2) { + if (ferror(fsockout)) fsockout = get_fsockout(handle_data_arg); rig_debug(RIG_DEBUG_ERR, "%s: socket error in=%d, out=%d\n", __func__, ferror(fsockin), ferror(fsockout)); - retcode = rig_close(my_rig); - rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode); - retcode = rig_open(my_rig); - rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d\n", __func__, retcode); + do + { + retcode = rig_close(my_rig); + hl_usleep(1000 * 1000); + rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode); + retcode = rig_open(my_rig); + rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d\n", __func__, retcode); + } + while (retcode != RIG_OK); } } - while (retcode == 0 || retcode == 2 || retcode == -RIG_ENAVAIL); #ifdef HAVE_PTHREAD ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 5 ++++ rigs/dummy/flrig.h | 2 +- rigs/yaesu/newcat.c | 15 ++++++++-- rigs/yaesu/newcat.h | 2 +- src/rig.c | 4 +++ tests/rigctl.c | 17 ++++++++++++ tests/rigctld.c | 79 +++++++++++++++++++++++++++++++++++------------------ 7 files changed, 94 insertions(+), 30 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-24 00:02:38
|
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 c20125a264443133205aee0641647d8d01b0c50a (commit) from e2475ac190d2542af2214d2fd3f08f67bf7189c1 (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 c20125a264443133205aee0641647d8d01b0c50a Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 23 18:01:26 2021 -0600 In newcat.c prevent FT-2000 and FTDX1200 from sending BS commands on 60M but let them send 60M FA/FB commands diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 15079b6c..3d9c04ea 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -863,7 +863,10 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) && !rig->state.disable_yaesu_bandselect // remove the split check here -- hopefully works OK //&& !rig->state.cache.split + // some rigs can't do BS command on 60M && !(is_ftdx3000 && newcat_band_index(freq) == 2) + && !(is_ft2000 && newcat_band_index(freq) == 2) + && !(is_ftdx1200 && newcat_band_index(freq) == 2) && !is_ft891 // 891 does not remember bandwidth so don't do this && rig->caps->get_vfo != NULL && rig->caps->set_vfo != NULL) // gotta' have get_vfo too ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-23 15:32:56
|
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 e2475ac190d2542af2214d2fd3f08f67bf7189c1 (commit) from d58f6a1d3c7c52c5d846d237a36eb1429d1e37d6 (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 e2475ac190d2542af2214d2fd3f08f67bf7189c1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 23 09:32:09 2021 -0600 Disable 60m check for FT450 and FTDX5000 to see if they behave now on 60M diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e8e08358..15079b6c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -743,8 +743,9 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // did have FTDX3000 as not capable of 60M set_freq but as of 2021-01-21 it works // special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX3000); /* duplicate the following line to add more rigs */ - special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX5000); - special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); + // disabled to check 2019 firmware on FTDX5000 and FT450 behavior + //special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX5000); + //special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); rig_debug(RIG_DEBUG_TRACE, "%s: special_60m=%d, 60m freq=%d, is_ftdx3000=%d\n", __func__, special_60m, freq >= 5300000 && freq <= 5410000, newcat_is_rig(rig, RIG_MODEL_FTDX3000)); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 1e2f87d4..bf6005ae 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210121" +#define NEWCAT_VER "20210123" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 5 +++-- rigs/yaesu/newcat.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-22 21:10:07
|
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 d58f6a1d3c7c52c5d846d237a36eb1429d1e37d6 (commit) via 7181589c4caa5111a90f14807b7999161cea0ad4 (commit) from 9d58b30489b090b994017691454d8436bb04b49c (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 d58f6a1d3c7c52c5d846d237a36eb1429d1e37d6 Merge: 7181589c 9d58b304 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 15:09:46 2021 -0600 Merge branch 'master' of http://github.com/Hamlib/Hamlib commit 7181589c4caa5111a90f14807b7999161cea0ad4 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 14:27:29 2021 -0600 Change ftdx3000/5000 to reject setting freq while transmitting and cover VFOA and VFOB More rigs will probably be added to this list https://github.com/Hamlib/Hamlib/issues/513 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 423a6154..e8e08358 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -779,9 +779,9 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { // should be true whether we're on VFOA or VFOB but only restricting VFOB right now // we return RIG_OK as we dont' want - if (is_ftdx3000 && target_vfo == 'B') { return RIG_OK; } + if (is_ftdx3000) { return RIG_ENTARGET; } - if (is_ftdx5000 && target_vfo == 'B') { return RIG_OK; } + if (is_ftdx5000) { return RIG_ENTARGET; } } if (RIG_MODEL_FT450 == caps->rig_model) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-22 20:28:23
|
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 9d58b30489b090b994017691454d8436bb04b49c (commit) from e7b6e61ed09ea217b7bbdba613c1669dce0b1b47 (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 9d58b30489b090b994017691454d8436bb04b49c Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 14:27:29 2021 -0600 Change ftdx3000/5000 to reject setting freq while transmitting More rigs will probably be added to this list diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 423a6154..e8e08358 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -779,9 +779,9 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { // should be true whether we're on VFOA or VFOB but only restricting VFOB right now // we return RIG_OK as we dont' want - if (is_ftdx3000 && target_vfo == 'B') { return RIG_OK; } + if (is_ftdx3000) { return RIG_ENTARGET; } - if (is_ftdx5000 && target_vfo == 'B') { return RIG_OK; } + if (is_ftdx5000) { return RIG_ENTARGET; } } if (RIG_MODEL_FT450 == caps->rig_model) ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-22 17:01:44
|
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 e7b6e61ed09ea217b7bbdba613c1669dce0b1b47 (commit) from e1c21605f4e45ed7ab98326e021c176c05e0e0ee (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 e7b6e61ed09ea217b7bbdba613c1669dce0b1b47 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 10:41:30 2021 -0600 astyle files prepping for 4.1 release diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 41f09cbb..5e2d661f 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -551,7 +551,8 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, xml_parse(xml, value, value_len); } } - while (((value && strlen(value) == 0) || (strlen(xml)==0)) && retry--); // we'll do retries if needed + while (((value && strlen(value) == 0) || (strlen(xml) == 0)) + && retry--); // we'll do retries if needed if (value && strlen(value) == 0) { return RIG_EPROTO; } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index ffa35a01..aecf0540 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -3112,11 +3112,13 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) else { float scale = 100; + if (rig->caps->rig_model == RIG_MODEL_IC705 || rig->caps->rig_model == RIG_MODEL_IC703) { scale = 10; } + val->f = rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * scale; } diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index 0a026921..36db7fe2 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -376,7 +376,8 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) if (statebuf_len < 20) { - rig_debug(RIG_DEBUG_ERR, "%s: statebuf_len < 20, statebuf='%s'\n", __func__, statebuf); + rig_debug(RIG_DEBUG_ERR, "%s: statebuf_len < 20, statebuf='%s'\n", __func__, + statebuf); RETURNFUNC(-RIG_EPROTO); } @@ -409,7 +410,8 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) { // Set rig to channel values rig_debug(RIG_DEBUG_ERR, - "%s: please contact hamlib mailing list to implement this, rxfreq=%.0f, txfreq=%.0f\n", __func__, chan->freq, chan->tx_freq); + "%s: please contact hamlib mailing list to implement this, rxfreq=%.0f, txfreq=%.0f\n", + __func__, chan->freq, chan->tx_freq); rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); //return -RIG_ENIMPL; diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 81240f16..423a6154 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -774,11 +774,14 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) target_vfo = 'A' == c ? '0' : '1'; - if(rig->state.cache.ptt == RIG_PTT_ON) // we have a few rigs that can't set TX VFO while PTT_ON - { // should be true whether we're on VFOA or VFOB but only restricting VFOB right now - // we return RIG_OK as we dont' want - if (is_ftdx3000 && target_vfo == 'B') return RIG_OK; - if (is_ftdx5000 && target_vfo == 'B') return RIG_OK; + if (rig->state.cache.ptt == + RIG_PTT_ON) // we have a few rigs that can't set TX VFO while PTT_ON + { + // should be true whether we're on VFOA or VFOB but only restricting VFOB right now + // we return RIG_OK as we dont' want + if (is_ftdx3000 && target_vfo == 'B') { return RIG_OK; } + + if (is_ftdx5000 && target_vfo == 'B') { return RIG_OK; } } if (RIG_MODEL_FT450 == caps->rig_model) diff --git a/src/misc.c b/src/misc.c index 445c8492..a0b31cf8 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1638,7 +1638,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // Handle device names 1st if (strstr(hoststr, "/dev")) { return -1; } - if (strstr(hoststr, "/")) { return -1; } // probably a path so not a hoststr + if (strstr(hoststr, "/")) { return -1; } // probably a path so not a hoststr if (strncasecmp(hoststr, "com", 3) == 0) { return -1; } diff --git a/tests/testrigcaps.c b/tests/testrigcaps.c index 1f1d7290..30099336 100644 --- a/tests/testrigcaps.c +++ b/tests/testrigcaps.c @@ -20,8 +20,10 @@ int main() #else int expected = 13280; // should be most 64-bit compilers #endif - if (offset == 9384) expected = 9384; // 32-bit Intel - if (offset == 10144) expected = 10144; // 32-bit Arm + + if (offset == 9384) { expected = 9384; } // 32-bit Intel + + if (offset == 10144) { expected = 10144; } // 32-bit Arm if (offset != expected) { @@ -41,8 +43,10 @@ int main() #else expected = 13696; #endif - if (offset == 9676) expected = 9676; // 32-bit Intel - if (offset == 10448) expected = 10448; // 32-bit Arm + + if (offset == 9676) { expected = 9676; } // 32-bit Intel + + if (offset == 10448) { expected = 10448; } // 32-bit Arm if (offset != expected) { diff --git a/tests/testrigopen.c b/tests/testrigopen.c index 65845ee2..03d4bfae 100644 --- a/tests/testrigopen.c +++ b/tests/testrigopen.c @@ -20,7 +20,7 @@ int callback(const struct rig_caps *caps, rig_ptr_t rigp) { - RIG *rig = (RIG*) rigp; + RIG *rig = (RIG *) rigp; rig = rig_init(caps->rig_model); @@ -35,13 +35,13 @@ int callback(const struct rig_caps *caps, rig_ptr_t rigp) strcpy(rig->state.rigport.pathname, port); printf("%20s:", caps->model_name); - fflush(stdout); - struct timeval start,end; - gettimeofday(&start,NULL); + fflush(stdout); + struct timeval start, end; + gettimeofday(&start, NULL); rig_open(rig); - gettimeofday(&end,NULL); - double dstart = start.tv_sec + start.tv_usec/1e6; - double dend = end.tv_sec + end.tv_usec/(double)1e6; + gettimeofday(&end, NULL); + double dstart = start.tv_sec + start.tv_usec / 1e6; + double dend = end.tv_sec + end.tv_usec / (double)1e6; printf(" %.1f\n", dend - dstart); rig_close(rig); /* close port */ ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 3 ++- rigs/icom/icom.c | 2 ++ rigs/prm80/prm80.c | 6 ++++-- rigs/yaesu/newcat.c | 13 ++++++++----- src/misc.c | 2 +- tests/testrigcaps.c | 12 ++++++++---- tests/testrigopen.c | 14 +++++++------- 7 files changed, 32 insertions(+), 20 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-22 14:58:20
|
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 e1c21605f4e45ed7ab98326e021c176c05e0e0ee (commit) via de3205e2b8ba14d6a6bcc8b81bb01bb3bedb754a (commit) via 1fe2efb315c966d35a5c561d675426381f6dfb18 (commit) from 85205abd458f55a0f8226847d9116314f948b3b2 (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 e1c21605f4e45ed7ab98326e021c176c05e0e0ee Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 08:57:53 2021 -0600 Restrict FTDX3000 and FTDX5000 to not set_freq on VFO while PTT_ON diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index aee81afa..81240f16 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -774,6 +774,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) target_vfo = 'A' == c ? '0' : '1'; + if(rig->state.cache.ptt == RIG_PTT_ON) // we have a few rigs that can't set TX VFO while PTT_ON + { // should be true whether we're on VFOA or VFOB but only restricting VFOB right now + // we return RIG_OK as we dont' want + if (is_ftdx3000 && target_vfo == 'B') return RIG_OK; + if (is_ftdx5000 && target_vfo == 'B') return RIG_OK; + } + if (RIG_MODEL_FT450 == caps->rig_model) { /* The FT450 only accepts F[A|B]nnnnnnnn; commands for the commit de3205e2b8ba14d6a6bcc8b81bb01bb3bedb754a Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 08:30:01 2021 -0600 Reduce debug level in newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 6c77b680..aee81afa 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9654,7 +9654,7 @@ int newcat_set_cmd_validate(RIG *rig) } else { - rig_debug(RIG_DEBUG_ERR, "%s: %s not implemented\n", __func__, priv->cmd_str); + rig_debug(RIG_DEBUG_TRACE, "%s: %s not implemented\n", __func__, priv->cmd_str); RETURNFUNC(-RIG_ENIMPL); } commit 1fe2efb315c966d35a5c561d675426381f6dfb18 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 08:26:03 2021 -0600 Reduce a debug level in serial.c diff --git a/src/serial.c b/src/serial.c index 08c811a0..421e75ca 100644 --- a/src/serial.c +++ b/src/serial.c @@ -807,7 +807,7 @@ int ser_close(hamlib_port_t *p) } else { - rig_debug(RIG_DEBUG_WARN, "%s: no options for fd to restore\n", __func__); + rig_debug(RIG_DEBUG_TRACE, "%s: no options for fd to restore\n", __func__); } rc = CLOSE(p->fd); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 9 ++++++++- src/serial.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-22 13:52:38
|
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 85205abd458f55a0f8226847d9116314f948b3b2 (commit) via 0005733f9a45c16e90bf943bbd8137927a9f9d2d (commit) from d6baea110e2d799975b80c61262cde3cf386c591 (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 85205abd458f55a0f8226847d9116314f948b3b2 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 07:52:15 2021 -0600 Keep debug msg for rig_check_rig_caps on all the time for now diff --git a/src/rig.c b/src/rig.c index bc451e14..451617a4 100644 --- a/src/rig.c +++ b/src/rig.c @@ -325,7 +325,7 @@ int rig_check_rig_caps() rig_debug(RIG_DEBUG_WARN, "%s: shared libary change#2\n", __func__); } - if (rc != RIG_OK) + //if (rc != RIG_OK) { rig_debug(RIG_DEBUG_TRACE, "%s: p1=%p, p2=%p, rig_model=%p, macro_name=%p\n", __func__, caps_test_rig_model, caps_test_macro_name, &caps_test.rig_model, commit 0005733f9a45c16e90bf943bbd8137927a9f9d2d Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 22 07:50:44 2021 -0600 Finish implementing RETURNFUNC in newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 22fb53bd..6c77b680 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -781,7 +781,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) and select the correct VFO before setting the frequency */ // Plus we can't do the VFO swap if transmitting - if (target_vfo == 'B' && rig->state.cache.ptt == RIG_PTT_ON) { return -RIG_ENTARGET; } + if (target_vfo == 'B' && rig->state.cache.ptt == RIG_PTT_ON) { RETURNFUNC(-RIG_ENTARGET); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS%c", cat_term); @@ -1301,7 +1301,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) rig_strvfo(vfo)); // we can't change VFO while transmitting - if (rig->state.cache.ptt == RIG_PTT_ON) { return RIG_OK; } + if (rig->state.cache.ptt == RIG_PTT_ON) { RETURNFUNC(RIG_OK); } if (!newcat_valid_command(rig, command)) { @@ -2346,7 +2346,7 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) oldvfo = newcat_set_vfo_if_needed(rig, vfo); - if (oldvfo < 0) { return oldvfo; } + if (oldvfo < 0) { RETURNFUNC(oldvfo); } if (rit > rig->caps->max_rit) { @@ -2377,7 +2377,7 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) oldvfo = newcat_set_vfo_if_needed(rig, oldvfo); - if (oldvfo < 0) { return oldvfo; } + if (oldvfo < 0) { RETURNFUNC(oldvfo); } RETURNFUNC(ret); } @@ -2460,7 +2460,7 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) oldvfo = newcat_set_vfo_if_needed(rig, vfo); - if (oldvfo < 0) { return oldvfo; } + if (oldvfo < 0) { RETURNFUNC(oldvfo); } if (xit > rig->caps->max_xit) { @@ -2492,7 +2492,7 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) oldvfo = newcat_set_vfo_if_needed(rig, vfo); - if (oldvfo < 0) { return oldvfo; } + if (oldvfo < 0) { RETURNFUNC(oldvfo); } RETURNFUNC(ret); } @@ -6141,7 +6141,7 @@ int newcat_get_trn(RIG *rig, int *trn) // if we failed to get AI we turn it off and try again snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s0%c", command, cat_term); hl_usleep(500 * 1000); // is 500ms enough for the rig to stop sending info? - newcat_set_cmd(rig); // don't care about the return here + newcat_set_cmd(rig); // don't care about any errors here snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); err = newcat_get_cmd(rig); RETURNFUNC(err); @@ -6667,7 +6667,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) //rig_debug(RIG_DEBUG_TRACE, "%s(%d):%s called\n", __FILE__, __LINE__, __func__); is_rig = (model == rig->caps->rig_model) ? TRUE : FALSE; - return (is_rig); + return (is_rig); // RETURN is too verbose here } @@ -6905,7 +6905,7 @@ int newcat_scale_float(int scale, float fval) f = scale * (fval + fudge); } - return (int) f; + return (int) f; // RETURN is too verbose here } @@ -9202,9 +9202,9 @@ int newcat_set_faststep(RIG *rig, ncboolean fast_step) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "FS%c%c", c, cat_term); - rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -9267,7 +9267,7 @@ int newcat_get_rigid(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "rig_id = %d, *s = %s\n", priv->rig_id, s == NULL ? "NULL" : s); - return priv->rig_id; + RETURNFUNC(priv->rig_id); } @@ -9362,7 +9362,7 @@ int newcat_vfomem_toggle(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } /* @@ -9690,7 +9690,7 @@ int newcat_set_cmd_validate(RIG *rig) // for the BS command we can only run it once // so we'll assume it worked // maybe Yaeus will make this command more intelligent - if (strstr(priv->cmd_str, "BS")) { return RIG_OK; } + if (strstr(priv->cmd_str, "BS")) { RETURNFUNC(RIG_OK); } // if the first two chars match we are validated if (strncmp(priv->cmd_str, "VS", 2) == 0 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 28 ++++++++++++++-------------- src/rig.c | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-22 06:02:44
|
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 d6baea110e2d799975b80c61262cde3cf386c591 (commit) via 63b3bfcaa4e3b26635667845dae046e2629c8764 (commit) via c93060937949c977d9c231eae3335c6ab7512f15 (commit) via 04bb1b3e791f2fa039110e962075df2fd3f56806 (commit) via b030d731445d84c46c617bb434c2d2e8cf7d738a (commit) via 9a870577d0dbbe4368ac186e92e05497c7d90257 (commit) via b56a577ebb78c667a7b153c0cd4db5e18bfab7a0 (commit) via bf52ea58d728a4a74701a223708bfdbce389967e (commit) from 0058cffcc7255ba855bc75129c9ece878e0b829d (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 d6baea110e2d799975b80c61262cde3cf386c591 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 23:54:21 2021 -0600 Add 32-bit Intel and 32-bit Arm checks to rigtestcaps.c diff --git a/tests/testrigcaps.c b/tests/testrigcaps.c index 947c0ecc..1f1d7290 100644 --- a/tests/testrigcaps.c +++ b/tests/testrigcaps.c @@ -20,6 +20,8 @@ int main() #else int expected = 13280; // should be most 64-bit compilers #endif + if (offset == 9384) expected = 9384; // 32-bit Intel + if (offset == 10144) expected = 10144; // 32-bit Arm if (offset != expected) { @@ -39,6 +41,8 @@ int main() #else expected = 13696; #endif + if (offset == 9676) expected = 9676; // 32-bit Intel + if (offset == 10448) expected = 10448; // 32-bit Arm if (offset != expected) { commit 63b3bfcaa4e3b26635667845dae046e2629c8764 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 23:45:02 2021 -0600 In newcat.c try to handle the case were AI is on and we need to turn it off diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a95db6c3..22fb53bd 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -745,7 +745,9 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) /* duplicate the following line to add more rigs */ special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX5000); special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); - rig_debug(RIG_DEBUG_TRACE, "%s: special_60m=%d, 60m freq=%d, is_ftdx3000=%d\n", __func__, special_60m, freq >= 5300000 && freq <= 5410000, newcat_is_rig(rig, RIG_MODEL_FTDX3000)); + rig_debug(RIG_DEBUG_TRACE, "%s: special_60m=%d, 60m freq=%d, is_ftdx3000=%d\n", + __func__, special_60m, freq >= 5300000 + && freq <= 5410000, newcat_is_rig(rig, RIG_MODEL_FTDX3000)); if (special_60m && (freq >= 5300000 && freq <= 5410000)) { @@ -779,7 +781,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) and select the correct VFO before setting the frequency */ // Plus we can't do the VFO swap if transmitting - if (target_vfo == 'B' && rig->state.cache.ptt == RIG_PTT_ON) return -RIG_ENTARGET; + if (target_vfo == 'B' && rig->state.cache.ptt == RIG_PTT_ON) { return -RIG_ENTARGET; } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS%c", cat_term); @@ -6136,6 +6138,12 @@ int newcat_get_trn(RIG *rig, int *trn) /* Get Auto Information */ if (RIG_OK != (err = newcat_get_cmd(rig))) { + // if we failed to get AI we turn it off and try again + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s0%c", command, cat_term); + hl_usleep(500 * 1000); // is 500ms enough for the rig to stop sending info? + newcat_set_cmd(rig); // don't care about the return here + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); + err = newcat_get_cmd(rig); RETURNFUNC(err); } commit c93060937949c977d9c231eae3335c6ab7512f15 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 23:11:20 2021 -0600 Update debug in newcat.c to add some more info diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b425100f..a95db6c3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -745,7 +745,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) /* duplicate the following line to add more rigs */ special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX5000); special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); - rig_debug(RIG_DEBUG, "%s: special_60m=%d, 60m freq=%d\n", special_60m, freq >= 5300000 && freq <= 5410000)); + rig_debug(RIG_DEBUG_TRACE, "%s: special_60m=%d, 60m freq=%d, is_ftdx3000=%d\n", __func__, special_60m, freq >= 5300000 && freq <= 5410000, newcat_is_rig(rig, RIG_MODEL_FTDX3000)); if (special_60m && (freq >= 5300000 && freq <= 5410000)) { commit 04bb1b3e791f2fa039110e962075df2fd3f56806 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 23:09:04 2021 -0600 Add some debug for special_60m in newcat.c FTDX3000 was not being detected correctly diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 36ee162b..b425100f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -745,6 +745,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) /* duplicate the following line to add more rigs */ special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX5000); special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); + rig_debug(RIG_DEBUG, "%s: special_60m=%d, 60m freq=%d\n", special_60m, freq >= 5300000 && freq <= 5410000)); if (special_60m && (freq >= 5300000 && freq <= 5410000)) { commit b030d731445d84c46c617bb434c2d2e8cf7d738a Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 22:59:34 2021 -0600 Have FTDX3000 ignore BS02 command Allow FTDX3000 to set 60M frequencies diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5c55976b..36ee162b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -740,9 +740,10 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) /* vfo should now be modified to a valid VFO constant. */ /* DX3000/DX5000/450 can only do VFO_MEM on 60M */ /* So we will not change freq in that case */ - special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX3000); + // did have FTDX3000 as not capable of 60M set_freq but as of 2021-01-21 it works + // special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX3000); /* duplicate the following line to add more rigs */ - special_60m |= newcat_is_rig(rig, RIG_MODEL_FTDX5000); + special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX5000); special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); if (special_60m && (freq >= 5300000 && freq <= 5410000)) @@ -848,6 +849,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) && !rig->state.disable_yaesu_bandselect // remove the split check here -- hopefully works OK //&& !rig->state.cache.split + && !(is_ftdx3000 && newcat_band_index(freq) == 2) && !is_ft891 // 891 does not remember bandwidth so don't do this && rig->caps->get_vfo != NULL && rig->caps->set_vfo != NULL) // gotta' have get_vfo too commit 9a870577d0dbbe4368ac186e92e05497c7d90257 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 22:42:19 2021 -0600 Fix FTDX3000 SH commands diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c9814757..5c55976b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7862,7 +7862,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c%d%02d;", main_sub_vfo, on, w); } - else if (is_ft2000 || is_ftdx10) + else if (is_ft2000 || is_ftdx10 || is_ftdx3000) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH0%02d;", w); } @@ -8092,7 +8092,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (sh_command_valid) { - if (is_ft2000 || is_ftdx10) + if (is_ft2000 || is_ftdx10 || is_ftdx3000) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s0%c", cmd, cat_term); } commit b56a577ebb78c667a7b153c0cd4db5e18bfab7a0 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 22:39:43 2021 -0600 Fix FTDX10 FT command diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index aff33cde..c9814757 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6722,6 +6722,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) newcat_is_rig(rig, RIG_MODEL_FTDX5000) || newcat_is_rig(rig, RIG_MODEL_FTDX1200) || newcat_is_rig(rig, RIG_MODEL_FT991) || + newcat_is_rig(rig, RIG_MODEL_FTDX10) || newcat_is_rig(rig, RIG_MODEL_FTDX3000)) { p1 = p1 + 2; /* use non-Toggle commands */ commit bf52ea58d728a4a74701a223708bfdbce389967e Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 22:36:24 2021 -0600 Fix FTDX10 SH commands diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 704908d6..aff33cde 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7854,14 +7854,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } /* end else */ - if (is_ftdx101 || is_ft891 || is_ftdx10) + if (is_ftdx101 || is_ft891) { // some rigs now require the bandwidth be turned "on" int on = is_ft891; snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c%d%02d;", main_sub_vfo, on, w); } - else if (is_ft2000) + else if (is_ft2000 || is_ftdx10) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH0%02d;", w); } @@ -8091,7 +8091,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (sh_command_valid) { - if (is_ft2000) + if (is_ft2000 || is_ftdx10) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s0%c", cmd, cat_term); } ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 24 ++++++++++++++++++------ tests/testrigcaps.c | 4 ++++ 2 files changed, 22 insertions(+), 6 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-21 23:20:14
|
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 0058cffcc7255ba855bc75129c9ece878e0b829d (commit) from 39e4aad778699793e7a4136552e28e11e7a2f3ec (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 0058cffcc7255ba855bc75129c9ece878e0b829d Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 17:18:45 2021 -0600 Add rig_check_rig_caps to check that shared library compatibility is good Returns -RIG_EINTERNAL if bad, RIG_OK if good Prints out WARN level message if bad diff --git a/src/rig.c b/src/rig.c index 228e4957..bc451e14 100644 --- a/src/rig.c +++ b/src/rig.c @@ -88,6 +88,8 @@ const char hamlib_version[21] = "Hamlib " PACKAGE_VERSION; const char *hamlib_version2 = "Hamlib " PACKAGE_VERSION; //! @endcond +struct rig_caps caps_test; + /** * \brief Hamlib copyright notice */ @@ -301,6 +303,37 @@ const char *HAMLIB_API rigerror(int errnum) return rigerror_table[errnum]; } +// We use a couple of defined pointer to determine if the shared library changes +void *caps_test_rig_model = &caps_test.rig_model; +void *caps_test_macro_name = &caps_test.macro_name; + +// check and show WARN if rig_caps structure doesn't match +// this tests for shared library incompatibility +int rig_check_rig_caps() +{ + int rc = RIG_OK; + + if (&caps_test.rig_model != caps_test_rig_model) + { + rc = -RIG_EINTERNAL; + rig_debug(RIG_DEBUG_WARN, "%s: shared libary change#1\n", __func__); + } + + if (&caps_test.macro_name != caps_test_macro_name) + { + rc = -RIG_EINTERNAL; + rig_debug(RIG_DEBUG_WARN, "%s: shared libary change#2\n", __func__); + } + + if (rc != RIG_OK) + { + rig_debug(RIG_DEBUG_TRACE, "%s: p1=%p, p2=%p, rig_model=%p, macro_name=%p\n", + __func__, caps_test_rig_model, caps_test_macro_name, &caps_test.rig_model, + &caps_test.macro_name); + } + + return rc; +} /** * \brief allocate a new RIG handle @@ -323,6 +356,8 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) ENTERFUNC; + rig_check_rig_caps(); + rig_check_backend(rig_model); caps = rig_get_caps(rig_model); ----------------------------------------------------------------------- Summary of changes: src/rig.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-21 18:05:25
|
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 39e4aad778699793e7a4136552e28e11e7a2f3ec (commit) from fbce397f3b8868807899bbd73fb2329fe5c46958 (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 39e4aad778699793e7a4136552e28e11e7a2f3ec Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 12:04:46 2021 -0600 Another attempt to get testrigcaps to recognize compiler differences diff --git a/tests/testrigcaps.c b/tests/testrigcaps.c index e1d2eae1..947c0ecc 100644 --- a/tests/testrigcaps.c +++ b/tests/testrigcaps.c @@ -13,10 +13,10 @@ int main() void *p2 = &rig->state.vfo_list; unsigned long offset = p2 - p1; printf("offset vfo_list=%ld\n", offset); -#if defined(__MINGW32__) - int expected = 10144; // mingw32 -#elif defined(__MINGW64__) +#if defined(WIN64) || defined (_WIN64) || defined (__WIN64__) int expected = 13264; // mingw64 +#elif defined(WIN32) || defined (_WIN32) || defined(__WIN32__) + int expected = 10144; // mingw32 #else int expected = 13280; // should be most 64-bit compilers #endif @@ -32,10 +32,10 @@ int main() offset = p2 - p1; printf("offset power_max=%ld\n", offset); -#if defined(__MINGW32__) - expected = 10448; // mingw32 -#elif defined(__MINGW64__) +#if defined(WIN64) || defined (_WIN64) || defined (__WIN64__) expected = 13664; // mingw64 +#elif defined(WIN32) || defined (_WIN32) || defined(__WIN32__) + expected = 10448; // mingw32 #else expected = 13696; #endif ----------------------------------------------------------------------- Summary of changes: tests/testrigcaps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-21 15:37:57
|
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 fbce397f3b8868807899bbd73fb2329fe5c46958 (commit) from 619e130483a1c97a14896e67c9eefbafd0058c1f (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 fbce397f3b8868807899bbd73fb2329fe5c46958 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 09:36:46 2021 -0600 Fix testrigcaps for ming32, ming64, and all others Structure packing may be different yet on some other compilers diff --git a/tests/testrigcaps.c b/tests/testrigcaps.c index 5ea84b43..e1d2eae1 100644 --- a/tests/testrigcaps.c +++ b/tests/testrigcaps.c @@ -13,12 +13,18 @@ int main() void *p2 = &rig->state.vfo_list; unsigned long offset = p2 - p1; printf("offset vfo_list=%ld\n", offset); - int expected = 13280; - int expected32 = 10144; - if (offset != expected && offset != expected32) +#if defined(__MINGW32__) + int expected = 10144; // mingw32 +#elif defined(__MINGW64__) + int expected = 13264; // mingw64 +#else + int expected = 13280; // should be most 64-bit compilers +#endif + + if (offset != expected) { printf("offset of vfo_list has changed!!!\n"); - printf("64-bit was %d, 32-bit was %d, now %lu\n", expected, expected32, offset ); + printf("was %d, now %lu\n", expected, offset); retcode = 1; } @@ -26,12 +32,18 @@ int main() offset = p2 - p1; printf("offset power_max=%ld\n", offset); +#if defined(__MINGW32__) + expected = 10448; // mingw32 +#elif defined(__MINGW64__) + expected = 13664; // mingw64 +#else expected = 13696; - expected32 = 10448; - if (offset != expected && offset != expected32) +#endif + + if (offset != expected) { printf("offset of power_max has changed!!!\n"); - printf("64-bit was %d, 32-bit was %d, now %lu\n", expected, expected32, offset ); + printf("was %d, now %lu\n", expected, offset); retcode = 1; } ----------------------------------------------------------------------- Summary of changes: tests/testrigcaps.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-21 14:16:59
|
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 619e130483a1c97a14896e67c9eefbafd0058c1f (commit) from 4df4820ad9e71b7131ee7b298cc4fe1caf982d81 (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 619e130483a1c97a14896e67c9eefbafd0058c1f Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 08:15:55 2021 -0600 Add 32-bit values to testrigcaps.c This may still need changes for different compilers with different structure packing diff --git a/tests/testrigcaps.c b/tests/testrigcaps.c index 4a223461..5ea84b43 100644 --- a/tests/testrigcaps.c +++ b/tests/testrigcaps.c @@ -14,10 +14,11 @@ int main() unsigned long offset = p2 - p1; printf("offset vfo_list=%ld\n", offset); int expected = 13280; - if (offset != expected) + int expected32 = 10144; + if (offset != expected && offset != expected32) { printf("offset of vfo_list has changed!!!\n"); - printf("was %d, now %lu\n", expected, offset ); + printf("64-bit was %d, 32-bit was %d, now %lu\n", expected, expected32, offset ); retcode = 1; } @@ -26,10 +27,11 @@ int main() printf("offset power_max=%ld\n", offset); expected = 13696; - if (offset != expected) + expected32 = 10448; + if (offset != expected && offset != expected32) { printf("offset of power_max has changed!!!\n"); - printf("was %d, now %lu\n", expected, offset ); + printf("64-bit was %d, 32-bit was %d, now %lu\n", expected, expected32, offset ); retcode = 1; } ----------------------------------------------------------------------- Summary of changes: tests/testrigcaps.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-21 12:48:17
|
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 4df4820ad9e71b7131ee7b298cc4fe1caf982d81 (commit) via 20d5bc0b9ea20a7b69dc4d433c3e4112600e32c1 (commit) from 599974bceaea829ce07cfab6f6a8d29f5494d5c4 (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 4df4820ad9e71b7131ee7b298cc4fe1caf982d81 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 06:45:50 2021 -0600 Move Yaesu special_60m handling to cover any newcat_get_freq request get_freq with 60M freq will not attempt freq change on certain rigs as they have to use MEM mode to select 60m. But RIG_OK will be returned. diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 385543b3..704908d6 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -745,6 +745,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) special_60m |= newcat_is_rig(rig, RIG_MODEL_FTDX5000); special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); + if (special_60m && (freq >= 5300000 && freq <= 5410000)) + { + rig_debug(RIG_DEBUG_TRACE, "%s: 60M VFO_MEM exception, no freq change done\n", + __func__); + RETURNFUNC(RIG_OK); /* make it look like we changed */ + } + switch (vfo) { case RIG_VFO_A: @@ -757,17 +764,6 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) c = 'B'; break; - case RIG_VFO_MEM: - if (special_60m && (freq >= 5300000 && freq <= 5410000)) - { - rig_debug(RIG_DEBUG_TRACE, "%s: 60M VFO_MEM exception, no freq change done\n", - __func__); - RETURNFUNC(RIG_OK); /* make it look like we changed */ - } - - c = 'A'; - break; - default: RETURNFUNC(-RIG_ENIMPL); /* Only VFO_A or VFO_B are valid */ } commit 20d5bc0b9ea20a7b69dc4d433c3e4112600e32c1 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 21 06:37:26 2021 -0600 Fix double ;; in FT450 exception handling Add FT450 to special 60m exceptions diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5ee11f7d..385543b3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -738,11 +738,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } /* vfo should now be modified to a valid VFO constant. */ - /* DX3000/DX5000 can only do VFO_MEM on 60M */ + /* DX3000/DX5000/450 can only do VFO_MEM on 60M */ /* So we will not change freq in that case */ special_60m = newcat_is_rig(rig, RIG_MODEL_FTDX3000); /* duplicate the following line to add more rigs */ special_60m |= newcat_is_rig(rig, RIG_MODEL_FTDX5000); + special_60m |= newcat_is_rig(rig, RIG_MODEL_FT450); switch (vfo) { @@ -998,19 +999,19 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { if (c == 'B') { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS1;F%c%0*"PRIll"%c;VS0;", c, - priv->width_frequency, (int64_t)freq, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS1;F%c%0*"PRIll";VS0;", c, + priv->width_frequency, (int64_t)freq); } else { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "F%c%0*"PRIll"%c", c, - priv->width_frequency, (int64_t)freq, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "F%c%0*"PRIll";", c, + priv->width_frequency, (int64_t)freq); } } else { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "F%c%0*"PRIll"%c", c, - priv->width_frequency, (int64_t)freq, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "F%c%0*"PRIll";", c, + priv->width_frequency, (int64_t)freq); } rig_debug(RIG_DEBUG_TRACE, "%s:%d cmd_str = %s\n", __func__, __LINE__, diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 15615a35..1e2f87d4 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210120" +#define NEWCAT_VER "20210121" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 33 +++++++++++++++------------------ rigs/yaesu/newcat.h | 2 +- 2 files changed, 16 insertions(+), 19 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-21 04:55:09
|
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 599974bceaea829ce07cfab6f6a8d29f5494d5c4 (commit) from 140ccbefd4e62a1dcdf8f6eaaa593d7ef99b7262 (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 599974bceaea829ce07cfab6f6a8d29f5494d5c4 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 20 22:54:37 2021 -0600 Fix compilation error in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 014169bc..ffa35a01 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -3119,7 +3119,6 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } val->f = rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * scale; - } } break; ----------------------------------------------------------------------- Summary of changes: rigs/icom/icom.c | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |