[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. f25f21264f7de6f5b85f8
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: n0nb <n0...@us...> - 2025-07-20 21:02:43
|
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 f25f21264f7de6f5b85f82bd3c0514c786306c05 (commit)
via c14949a86d34996764d0aa67e92bc8cfde361603 (commit)
from 5c06f66aa831c586bf4504007289675cb5e148ff (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 f25f21264f7de6f5b85f82bd3c0514c786306c05
Author: Diane Bruce <db...@db...>
Date: Sun Jul 20 14:59:10 2025 -0400
Provide for updated FreeBSD USB device naming
FreeBSD will eventually have the less verbose bNumDeviceCaps instead of
bNumDeviceCapabilities The other changes are (hopefully) to be
upstreamed renaming bU2devExitLat to wU2devExitLat
FreeBSD in the head of the tree has
/usr/include/libusb20_desc.h:#define bNumDeviceCapabilities bNumDeviceCaps
So we have backward compatibility for this.
diff --git a/tests/rigtestlibusb.c b/tests/rigtestlibusb.c
index 7065d09b3..45d82906e 100644
--- a/tests/rigtestlibusb.c
+++ b/tests/rigtestlibusb.c
@@ -32,6 +32,15 @@
#include <libusb-1.0/libusb.h>
#endif
+#ifdef __FreeBSD__
+# ifndef bU2DevExitLat
+# define bU2DevExitLat wU2DevExitLat
+# endif
+# ifndef bNumDeviceCaps
+# define bNumDeviceCaps bNumDeviceCapabilities
+# endif
+#endif
+
#if HAVE_LIBUSB
int verbose = 0;
commit c14949a86d34996764d0aa67e92bc8cfde361603
Author: Michael Morgan <844...@us...>
Date: Fri Jul 18 14:28:49 2025 -0500
Rewrite
Rewrote it some to see if MinGW ok.
diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c
index 8cb105e0f..dac05d1db 100644
--- a/rigs/flexradio/smartsdr.c
+++ b/rigs/flexradio/smartsdr.c
@@ -628,26 +628,38 @@ int smartsdr_send_morse(RIG *rig, vfo_t vfo, const char *msg)
int retval;
size_t msg_len = strlen(msg);
- size_t buf_len = msg_len + 20;
+ size_t buf_len = msg_len + 20;
- char newmsg[msg_len + 1];
- strncpy(newmsg, msg, msg_len + 1);
+ char *newmsg = malloc(msg_len + 1);
+ if (!newmsg)
+ return -RIG_ENOMEM;
+
+ memcpy(newmsg, msg, msg_len + 1); // Copy including null terminator
- // Replace spaces with 0x7f
for (size_t i = 0; newmsg[i] != '\0'; i++) {
if (newmsg[i] == ' ') {
newmsg[i] = 0x7f;
}
}
- char cmd[buf_len];
- snprintf(cmd, sizeof(cmd), "cwx send \"%s\"", newmsg);
+ char *cmd = malloc(buf_len);
+ if (!cmd) {
+ free(newmsg);
+ return -RIG_ENOMEM;
+ }
+
+ snprintf(cmd, buf_len, "cwx send \"%s\"", newmsg);
+
+ free(newmsg);
retval = smartsdr_transaction(rig, cmd);
+ free(cmd);
+
RETURNFUNC(retval);
}
+
int smartsdr_stop_morse(RIG *rig, vfo_t vfo)
{
int retval;
-----------------------------------------------------------------------
Summary of changes:
rigs/flexradio/smartsdr.c | 24 ++++++++++++++++++------
tests/rigtestlibusb.c | 9 +++++++++
2 files changed, 27 insertions(+), 6 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|