This is the case for BANDSELECT and KEYERTYPE.
Use SNPRINTF() which deals with NULLs printing (null) and it is
used with the other datatypes..
Steps to reproduce:
tests/rigctl -m 1 set_parm KEYERTYPE '?'
tests/rigctl -m 1 set_parm BANDSELECT 1
Fixes:
Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
__strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:302
warning: 302 ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: File o directory non esistente
(gdb) bt
#0 __strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:302
#1 0x00007f8ab4d0b7ab in dummy_set_parm (rig=0x55d19b6cab20, parm=2048, val=...) at dummy.c:1704
#2 0x000055d175b8c03d in rigctl_set_parm (rig=0x55d19b6cab20, fout=0x7f8ab4bf25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0,
resp_sep=10 '\n', cmd=0x55d175ba9000 <test_list+1440>, vfo=536870912, arg1=0x7ffd730281e0 "KEYERTYPE", arg2=0x7ffd730283e0 "'?'", arg3=0x55d175b9fce8 "") at rigctl_parse.c:3828
#3 0x000055d175b93756 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffd7302a3a8, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>,
vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847
#4 0x000055d175b7dadc in main (argc=<optimized out>, argv=0x7ffd7302a3a8) at rigctl.c:801
Allows to send either string or bytes and to receive a response
converted to the same datatype. Also the "term" argument can be
of either type (but it can't contain NULs, it's a single char
or byte anyway).
Closes#1624.
With the old value of RIG_PTT_NONE, dummy_get_ptt() and dummy_set_ptt()
were never called because rig_get_ptt() and rig_set_ptt() do check
.ptt_type and return -RIG_ENAVAIL in that case.
Do not change .ptt_type for RIG_MODEL_DUMMY_NOVFO so that both cases
can be tested if needed.
It makes it easier in future to conditionally run some tests(eg.
to not test PTT for receiver-only rigs), or to run tests in
isolation (after renaming them).
It makes it easier to look at failing tests because pytest prints
the code of the failing test up to the failure including any
function that called the failed test (in this case would print
everything from def test_with_open() up to the line with the
failed assert.
Fixes:
simic905.c:108:9: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
simic910.c:112:9: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
When the software on the other side of the pty closes the device,
the simulator would close and reopen its side but it is unneeded
because it can continue to call read() without doing anything special.
Fixes an infinite stream of debug output because it erroneously
appeared to have read 1 byte instead of 0:
n=1
00
Not 8 bytes? bytes=1
Unknown cmd=00
Tested with:
tests/rigctl -m 37001 -r /dev/pts/6 f
(however it doesn't read the frequency because it looks like the
protocol is different or incomplete, rigs/anytone/d578.c is still
in beta)
The following command work from rigctl: get_freq get_ctcss_tone get_rig_info.
Uses the information from the manual linked at the top of rig/kenwood/tmd710.c.
Fixes:
simtmd710.c:64:44: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘double’ [-Wformat=]
simtmd710.c:68:44: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘double’ [-Wformat=]