From cd1dc4c05df3ed96a0c1384b45f589e86bb0aa17 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sat, 29 Oct 2022 23:09:53 -0500 Subject: [PATCH] Add ability to enter terminator char for W send_cmd_rx so one can do 'W FA; ;' without a timeout needed --- doc/man1/rigctl.1 | 4 ++-- tests/rigctl_parse.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index b80a640c3..29ad20905 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1131,8 +1131,8 @@ option above, will terminate each command string sent to the radio. This character should not be a part of the input string. . .TP -.BR W ", " send_cmd_rx " \(aq" \fICmd\fP\(aq " " \fInbytes\FP -Send a raw command string to the radio and expect nbytes returned. +.BR W ", " send_cmd_rx " \(aq" \fICmd\fP\(aq " " \fI[nbytes or terminator char\FP +Send a raw command string to the radio and expect nbytes returned or the terminator char (e.g. ;). .IP This is useful for testing and troubleshooting radio commands and responses when developing a backend. If the # of bytes requested is <= the number actually returned no timeout will occur. diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 99fb07027..08db0201e 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4891,6 +4891,7 @@ declare_proto_rig(send_cmd) ++rxbytes; // need length + 1 for end of string eom_buf[0] = 0; } + if (arg2[0] == ';') eom_buf[0] = ';'; /* Assumes CR or LF is end of line char for all ASCII protocols. */ retval = read_string(&rs->rigport, buf, rxbytes, eom_buf,