[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 0c94ba468ac1cd5e03de2
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-07-07 23:33: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 0c94ba468ac1cd5e03de2e948784ad5e83bf5f11 (commit) from 623ff17f61e227d461fca524c60a331c9a897672 (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 0c94ba468ac1cd5e03de2e948784ad5e83bf5f11 Author: aa5sh <844...@us...> Date: Thu Jul 3 00:21:50 2025 -0500 smartsdr--CWX Updates Needed to replace spaces with 0x7f characters. diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c index b61da374a..8cb105e0f 100644 --- a/rigs/flexradio/smartsdr.c +++ b/rigs/flexradio/smartsdr.c @@ -624,17 +624,28 @@ int sdr1k_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int smartsdr_send_morse(RIG *rig, vfo_t vfo, const char *msg) { - int buf_len; + ENTERFUNC; + int retval; - buf_len = strlen(msg) + 12; + size_t msg_len = strlen(msg); + size_t buf_len = msg_len + 20; + + char newmsg[msg_len + 1]; + strncpy(newmsg, msg, msg_len + 1); + + // Replace spaces with 0x7f + for (size_t i = 0; newmsg[i] != '\0'; i++) { + if (newmsg[i] == ' ') { + newmsg[i] = 0x7f; + } + } + char cmd[buf_len]; - ENTERFUNC; + snprintf(cmd, sizeof(cmd), "cwx send \"%s\"", newmsg); - sprintf(cmd, "cwx send \"%s\"", msg); retval = smartsdr_transaction(rig, cmd); RETURNFUNC(retval); - } int smartsdr_stop_morse(RIG *rig, vfo_t vfo) diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index ca6487a94..8aaa487e9 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -77,4 +77,4 @@ // .set_func = _set_func, .send_morse = smartsdr_send_morse, .stop_morse = smartsdr_stop_morse, - .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS + .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS \ No newline at end of file ----------------------------------------------------------------------- Summary of changes: rigs/flexradio/smartsdr.c | 21 ++++++++++++++++----- rigs/flexradio/smartsdr_caps.h | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |