[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 923700ea2f9111b067967
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2020-06-28 17:19: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 923700ea2f9111b0679671722f6bdc0a773c04e9 (commit) from a789cb06bb654ae82df3a0da0009bec63290eec4 (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 923700ea2f9111b0679671722f6bdc0a773c04e9 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 28 12:17:24 2020 -0500 Add logic for port only call like rigctl -m 2 -r :4532 https://github.com/Hamlib/Hamlib/issues/331 diff --git a/src/misc.c b/src/misc.c index c665346e..9c0ffdeb 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1470,6 +1470,14 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) return RIG_OK; } + if (sscanf(hoststr, ":%5[0-9]%s", port, + dummy) == 1) // just a port if you please + { + sprintf(hoststr, "%s:%s\n", "localhost", port); + rig_debug(RIG_DEBUG_VERBOSE, "%s: hoststr=%s\n", __func__, hoststr); + return RIG_OK; + } + // if we're here then we must have a hostname n = sscanf(hoststr, "%255[^:]:%5[0-9]%1s", host, port, dummy); @@ -1494,8 +1502,10 @@ int HAMLIB_API rig_flush(hamlib_port_t *port) if (port->type.rig != RIG_PORT_SERIAL) { - rig_debug(RIG_DEBUG_WARN, "%s: Expected serial port type!!\nWhat is this rig?\n", __func__); + rig_debug(RIG_DEBUG_WARN, + "%s: Expected serial port type!!\nWhat is this rig?\n", __func__); } + return serial_flush(port); // we must be on serial port } ----------------------------------------------------------------------- Summary of changes: src/misc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |