[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 8e707636197345c982c18
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Michael B. <mdb...@us...> - 2021-01-29 15:39: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 8e707636197345c982c187119c12e49ab8ce3ef4 (commit)
via 431b5dfc37151b5e13f011c6a67c27a27e914b58 (commit)
via acbe8da8a1aa513f47f4dd5b31cd7697d47fc76f (commit)
via 883574049b04756be80dfafd24badbb8c5f8a096 (commit)
via f228bda1a2555afd8f23411af2e12156cc956cbb (commit)
from 0575f9defd8d163a57bfeec196d4e9c4e0ab2231 (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 8e707636197345c982c187119c12e49ab8ce3ef4
Author: Michael Black W9MDB <mdb...@ya...>
Date: Fri Jan 29 09:35:46 2021 -0600
Add debug msg to rig_error
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 733bf5ac..e806a8f0 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -2855,11 +2855,13 @@ extern HAMLIB_EXPORT(int)
rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
-
+#define DEBUGMSGSAVE_SIZE 16384
+extern char debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug msg
#ifndef __cplusplus
#ifdef __GNUC__
// doing the debug macro with a dummy sprintf allows gcc to check the format string
-#define rig_debug(debug_level,fmt,...) { char xxxbuf[16384]="";snprintf(xxxbuf,sizeof(xxxbuf),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
+//#define rig_debug(debug_level,fmt,...) { char xxxbuf[16384]="";snprintf(xxxbuf,sizeof(xxxbuf),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
+#define rig_debug(debug_level,fmt,...) { snprintf(debugmsgsave,sizeof(debugmsgsave),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
#endif
#endif
extern HAMLIB_EXPORT(void)
commit 431b5dfc37151b5e13f011c6a67c27a27e914b58
Author: Michael Black W9MDB <mdb...@ya...>
Date: Fri Jan 29 08:30:35 2021 -0600
Make lack of tx_range_list non-fatal -- some rigs don't have this
diff --git a/src/rig.c b/src/rig.c
index e5ae4705..69d25ee7 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -290,6 +290,8 @@ int foreach_opened_rig(int (*cfunc)(RIG *, rig_ptr_t), rig_ptr_t data)
*
* \todo support gettext/localization
*/
+char debugmsgsave[DEBUGMSGSAVE_SIZE];
+
const char *HAMLIB_API rigerror(int errnum)
{
errnum = abs(errnum);
@@ -300,7 +302,9 @@ const char *HAMLIB_API rigerror(int errnum)
return "ERR_OUT_OF_RANGE";
}
- return rigerror_table[errnum];
+ static char msg[20000];
+ snprintf(msg, sizeof(msg), "%s\n%s", rigerror_table[errnum], debugmsgsave);
+ return msg;
}
// We use a couple of defined pointer to determine if the shared library changes
@@ -474,7 +478,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
if (rs->tx_range_list[0].startf == 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: rig does not have tx_range!!\n", __func__);
- RETURNFUNC(NULL);
+ //RETURNFUNC(NULL); // this is not fatal
}
#if 0 // this is no longer applicable -- replace it with something?
commit acbe8da8a1aa513f47f4dd5b31cd7697d47fc76f
Author: Michael Black W9MDB <mdb...@ya...>
Date: Fri Jan 29 08:23:19 2021 -0600
astyle rc2800.c
https://github.com/Hamlib/Hamlib/issues/451
diff --git a/rotators/m2/rc2800.c b/rotators/m2/rc2800.c
index 66903c3e..a65b0bdc 100644
--- a/rotators/m2/rc2800.c
+++ b/rotators/m2/rc2800.c
@@ -207,7 +207,7 @@ transaction_write:
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
// some models seem to echo -- so we'll check and read again if echoed
- if (strcmp(data, cmdstr)==0)
+ if (strcmp(data, cmdstr) == 0)
{
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
commit 883574049b04756be80dfafd24badbb8c5f8a096
Author: Michael Black W9MDB <mdb...@ya...>
Date: Fri Jan 29 08:22:56 2021 -0600
Fix compile error on rc2800
https://github.com/Hamlib/Hamlib/issues/451
diff --git a/rotators/m2/rc2800.c b/rotators/m2/rc2800.c
index ab8c87f4..66903c3e 100644
--- a/rotators/m2/rc2800.c
+++ b/rotators/m2/rc2800.c
@@ -207,7 +207,7 @@ transaction_write:
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
// some models seem to echo -- so we'll check and read again if echoed
- if (strcmp(data_len, cmdstr)==0)
+ if (strcmp(data, cmdstr)==0)
{
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
commit f228bda1a2555afd8f23411af2e12156cc956cbb
Author: Michael Black W9MDB <mdb...@ya...>
Date: Fri Jan 29 08:20:56 2021 -0600
Add detection of echo for rc2800 -- seems some versions do echo
https://github.com/Hamlib/Hamlib/issues/451
diff --git a/rotators/m2/rc2800.c b/rotators/m2/rc2800.c
index a839c8df..ab8c87f4 100644
--- a/rotators/m2/rc2800.c
+++ b/rotators/m2/rc2800.c
@@ -202,27 +202,17 @@ transaction_write:
data_len = BUFSZ;
}
-#if 0 // manual says no echos
- /* first reply is an echo */
+ /* then comes the answer */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
- if (retval < 0)
+ // some models seem to echo -- so we'll check and read again if echoed
+ if (strcmp(data_len, cmdstr)==0)
{
- if (retry_read++ < rot->state.rotport.retry)
- {
- goto transaction_write;
- }
-
- goto transaction_quit;
+ memset(data, 0, data_len);
+ retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
}
-#endif
-
- /* then comes the answer */
- memset(data, 0, data_len);
- retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
-
if (retval < 0)
{
if (retry_read++ < rot->state.rotport.retry)
@@ -413,9 +403,9 @@ const struct rot_caps rc2800_rot_caps =
ROT_MODEL(ROT_MODEL_RC2800),
.model_name = "RC2800",
.mfg_name = "M2",
- .version = "20201130",
+ .version = "20210129",
.copyright = "LGPL",
- .status = RIG_STATUS_BETA,
+ .status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 9600,
-----------------------------------------------------------------------
Summary of changes:
include/hamlib/rig.h | 6 ++++--
rotators/m2/rc2800.c | 24 +++++++-----------------
src/rig.c | 8 ++++++--
3 files changed, 17 insertions(+), 21 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|