ICOM test via rigctl
Rig command: w \0xfe\0xfe\0x58\0xe0\0x03\0xfd
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: W \0xfe\0xfe\0x58\0xe0\0x03\0xfd 17
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: w FA;
send_cmd: error = Invalid parameter
Rig command: W FA; 14
send_cmd_rx: error = Invalid parameter
ICOM test via rigctld
Rig command: w \0xfe\0xfe\0x58\0xe0\0x03\0xfd
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: W \0xfe\0xfe\0x58\0xe0\0x03\0xfd 17
Reply:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x50\0x09\0x14\0x00\0xFD 17
Rig command: w FA;
Reply:RPRT -1
Rig command: W FA; 14
Reply:RPRT -1
Kenwood test via rigctl
Rig command: w FA;
Reply:FA00014074000;
Rig command: W FA; 14
Reply:FA00014074000;
Rig command: w \0x46\0x41\0x3b
Reply:FA00014074000;
Rig command: W \0x46\0x41\0x3b 14
Reply:FA00014074000;
Kenwood test via rigctld
Rig command: w FA;
Reply:FA00014074000;
Rig command: W FA; 14
Reply:FA00014074000;
Rig command: w \0x46\0x41\0x3b
Reply:FA00014074000;
Rig command: W \0x46\0x41\0x3b 14
Reply:FA00014074000;
So we can now do this...write once to see how many bytes you get back
Rig command: w \0xfe\0xfe\0x58\0xe0\0x03\0xfd
Cmd:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x00\0x09\0x14\0x00\0xFD 17
Then use 'W' to write the command with the # of bytes to expect -- no timeout this way
Rig command: W \0xfe\0xfe\0x58\0xe0\0x03\0xfd 17
Cmd:\0xFE\0xFE\0x58\0xE0\0x03\0xFD\0xFE\0xFE\0xE0\0x58\0x03\0x00\0x00\0x09\0x14\0x00\0xFD 17
Fix declarations after statements
Remove some !rig checks...we either don't need them or need them everywhere with a new error code
If you pass a NULL rig you get what you deserve :-)
Now responds with hex string just like the input and the # of bytes
Will get hex string response for any binary data from rig from any command
Next step is to implement W command for known # of bytes in response to avoid the timeout
This found tons of errors in rig_debug statements
So this patch cleans up all the files that were producing warnings or errors
This should fix a few segfaults when running with debug turned on
The \chk_vfo command to rigctl_parse() accepts an extended response
prefix but does not act upon it, instead it is held over until the
next command. This seems unnecessary as an extended response prefix
can just as easily be added to the following command if required. By
removing this carried over state the processing of commands can be
greatly simplified as per this commit.
Virtual com ports providing a TS-2000 Emulator
Example connecting N1MM or such to FLRig via COM5/COM6 virtual COM pair
rigctlcom -m 4 -R COM5 -S 115200
N1MM connects to COM6 TS-2000 115200 8N1
The warning was:
CC rotctl_parse.o
../../hamlib/tests/rotctl_parse.c:1012:50: warning: format string is not a string literal (potentially insecure)
[-Wformat-security]
snprintf(cmd_name, sizeof(cmd_name), parsed_input[0] + 1);
^~~~~~~~~~~~~~~~~~~
../../hamlib/tests/rotctl_parse.c:1012:50: note: treat the string as an argument to avoid this
snprintf(cmd_name, sizeof(cmd_name), parsed_input[0] + 1);
^
"%s",
1 warning generated.
On Debian Buster gcc ((Debian 8.2.0-8) 8.2.0) was throwing the following
warning:
CC rigctl.o
../../hamlib/tests/rigctl.c:125:18: warning: ‘have_rl’ defined but not used [-Wunused-const-variable=]
static const int have_rl = 0;
^~~~~~~
and:
CC rotctl.o
../../hamlib/tests/rotctl.c:113:18: warning: ‘have_rl’ defined but not used [-Wunused-const-variable=]
static const int have_rl = 0;
^~~~~~~
Turns out I didn't have the readline-dev package installed. As the have_rl
variable is wrapped in CPP macros, it indeed is not used when readline is not
available.