Skip to content

TM-D710: Rewrite backend#5

Merged
N0NB merged 2 commits into
Hamlib:masterfrom
mikaelnousiainen:tmd710-rewrite
Mar 17, 2018
Merged

TM-D710: Rewrite backend#5
N0NB merged 2 commits into
Hamlib:masterfrom
mikaelnousiainen:tmd710-rewrite

Conversation

@mikaelnousiainen

Copy link
Copy Markdown
Collaborator

Rewrite the whole Kenwood TM-D710 backend, since most of it was not working anyway.
TM-D710 protocol is significantly different from TM-D700 or the TH handheld ones.

Most features work, but the control protocol is quite limited:

  • It is not possible to change the selected frequency band of a VFO
  • Selecting MEM VFO uses the previously selected band (VFOA/VFOB), since there are no separate MEM VFO definitions for A/B bands

Added FMN mode to string constants, so that it can be used with the set_mode command.

…anyway. TM-D710 protocol is significantly different from TM-D700 or the TH handheld ones. Most features work, but the control protocol is quite limited: for example, it is not possible to change the selected frequency band of a VFO. Additionally, selecting MEM VFO uses the previously selected band (VFOA/VFOB), since there are no separate MEM VFO definitions for A/B bands. Added FMN mode to string constants, so that it can be used with the set_mode command.
Comment thread kenwood/tmd710.c Outdated
#include "tones.h"
#include "num_stdio.h"
#include "misc.h"
#include "../include/hamlib/rig.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace this with #include <hamlib/rig.h> as this is an installed header and should be included in this manner per GNU documentation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. That was inserted by the IDE and I didn't catch it :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the file was already included, so just removing the line.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that now and even there it is included incorrectly. Sigh. I'll get that corrected "one of these days". One thing to be aware of is that relative include paths like that will probably break VPATH builds and would be caught by running make distcheck which is the main way that I check for regressions.

@N0NB N0NB merged commit 3eeea56 into Hamlib:master Mar 17, 2018
@N0NB

N0NB commented Mar 17, 2018

Copy link
Copy Markdown
Contributor

Thanks, Mikael.

@mdblack98 mdblack98 mentioned this pull request Aug 13, 2021
dforsi added a commit to dforsi/Hamlib that referenced this pull request Aug 12, 2025
Need to convert the level number 0..63 to the level bit mask.
Steps to reproduce
tests/rigctld -m 1 &
tests/rigctl -m 2 dump_caps

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 [..]
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:174
 Hamlib#1  0x00007f532c46e300 in __printf_buffer (buf=buf@entry=0x7ffc320ad970, format=0x7f532c8aba22 "%s(%s) ", ap=0x7ffc320ada30, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 Hamlib#2  0x00007f532c491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc320ada30, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 Hamlib#3  0x00007f532c469642 in __GI___snprintf (
     s=s@entry=0x7ffc320aec94 "BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0.000000/0.000000) PBT_IN(0.000000..0.000000/0.000000) PBT_OUT(0.000000..0.000000/0.000000) CWPITCH(0..0/10) RFPOWER(0.050000..1.000000/0.001957) MICG"...,
     maxlen=maxlen@entry=3948, format=format@entry=0x7f532c8aba22 "%s(%s) ") at ./stdio-common/snprintf.c:31
 Hamlib#4  0x00007f532c6dc14a in rig_sprintf_parm_gran (
     str=str@entry=0x7ffc320aec00 "ANN(0..0/0) APO(0..0/0) BACKLIGHT(0..0/0) BEEP(0..1316880384/1315832322) TIME(0..0/0) BAT(0..0/0) KEYLIGHT(0..0/0) SCREENSAVER(0..4/0) AFIF(0..0/0) BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0."...,
     nlen=nlen@entry=4096, parm=9223372036854775807, gran=gran@entry=0x55f1f3cac338) at sprintflst.c:646
 Hamlib#5  0x000055f1eb6cd487 in dumpstate (rig=rig@entry=0x55f1f3ca5b20, fout=fout@entry=0x7f532c5f25c0 <_IO_2_1_stdout_>) at dumpstate.c:408
 Hamlib#6  0x000055f1eb6b4b81 in rigctl_dump_caps (rig=0x55f1f3ca5b20, fout=0x7f532c5f25c0 <_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=0x55f1eb6dc0e0 <test_list+5760>, vfo=536870912, arg1=0x0, arg2=0x55f1eb6d1ce8 "", arg3=0x55f1eb6d1ce8 "") at rigctl_parse.c:4622
 Hamlib#7  0x000055f1eb6c65f6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc320b2138, 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
 Hamlib#8  0x000055f1eb6b0adc in main (argc=<optimized out>, argv=0x7ffc320b2138) at rigctl.c:801
N0NB pushed a commit that referenced this pull request Aug 12, 2025
Need to convert the level number 0..63 to the level bit mask.
Steps to reproduce
tests/rigctld -m 1 &
tests/rigctl -m 2 dump_caps

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 [..]
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:174
 #1  0x00007f532c46e300 in __printf_buffer (buf=buf@entry=0x7ffc320ad970, format=0x7f532c8aba22 "%s(%s) ", ap=0x7ffc320ada30, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 #2  0x00007f532c491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc320ada30, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 #3  0x00007f532c469642 in __GI___snprintf (
     s=s@entry=0x7ffc320aec94 "BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0.000000/0.000000) PBT_IN(0.000000..0.000000/0.000000) PBT_OUT(0.000000..0.000000/0.000000) CWPITCH(0..0/10) RFPOWER(0.050000..1.000000/0.001957) MICG"...,
     maxlen=maxlen@entry=3948, format=format@entry=0x7f532c8aba22 "%s(%s) ") at ./stdio-common/snprintf.c:31
 #4  0x00007f532c6dc14a in rig_sprintf_parm_gran (
     str=str@entry=0x7ffc320aec00 "ANN(0..0/0) APO(0..0/0) BACKLIGHT(0..0/0) BEEP(0..1316880384/1315832322) TIME(0..0/0) BAT(0..0/0) KEYLIGHT(0..0/0) SCREENSAVER(0..4/0) AFIF(0..0/0) BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0."...,
     nlen=nlen@entry=4096, parm=9223372036854775807, gran=gran@entry=0x55f1f3cac338) at sprintflst.c:646
 #5  0x000055f1eb6cd487 in dumpstate (rig=rig@entry=0x55f1f3ca5b20, fout=fout@entry=0x7f532c5f25c0 <_IO_2_1_stdout_>) at dumpstate.c:408
 #6  0x000055f1eb6b4b81 in rigctl_dump_caps (rig=0x55f1f3ca5b20, fout=0x7f532c5f25c0 <_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=0x55f1eb6dc0e0 <test_list+5760>, vfo=536870912, arg1=0x0, arg2=0x55f1eb6d1ce8 "", arg3=0x55f1eb6d1ce8 "") at rigctl_parse.c:4622
 #7  0x000055f1eb6c65f6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc320b2138, 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
 #8  0x000055f1eb6b0adc in main (argc=<optimized out>, argv=0x7ffc320b2138) at rigctl.c:801
dforsi added a commit to dforsi/Hamlib that referenced this pull request Aug 13, 2025
Steps to reproduce:
tests/rigctl -m 1 \
set_parm KEYERTYPE BUG

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 warning: 142    ../sysdeps/x86_64/multiarch/strlen-sse2.S: File o directory non esistente
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 Hamlib#1  0x00007ffac346e300 in __printf_buffer (buf=buf@entry=0x7ffc3bcf40d0, format=0x7ffac38aef17 "%s", ap=0x7ffc3bcf4190, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 Hamlib#2  0x00007ffac3491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc3bcf4190, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 Hamlib#3  0x00007ffac3469642 in __GI___snprintf (s=s@entry=0x7ffc3bcf4290 "", maxlen=maxlen@entry=32, format=format@entry=0x7ffac38aef17 "%s") at ./stdio-common/snprintf.c:31
 Hamlib#4  0x00007ffac370b7b9 in dummy_set_parm (rig=0x558fe1991b20, parm=2048, val=...) at dummy.c:1704
 Hamlib#5  0x0000558fb536afbe in rigctl_set_parm (rig=0x558fe1991b20, fout=0x7ffac35f25c0 <_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=0x558fb5388000 <test_list+1440>, vfo=536870912, arg1=0x7ffc3bcf4e10 "KEYERTYPE", arg2=0x558fb537fdb1 "1", arg3=0x558fb537ece8 "") at rigctl_parse.c:3829
 Hamlib#6  0x0000558fb53727d6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc3bcf6fd8, 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
 Hamlib#7  0x0000558fb535cadc in main (argc=<optimized out>, argv=0x7ffc3bcf6fd8) at rigctl.c:801
N0NB pushed a commit that referenced this pull request Aug 14, 2025
Steps to reproduce:
tests/rigctl -m 1 \
set_parm KEYERTYPE BUG

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 warning: 142    ../sysdeps/x86_64/multiarch/strlen-sse2.S: File o directory non esistente
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 #1  0x00007ffac346e300 in __printf_buffer (buf=buf@entry=0x7ffc3bcf40d0, format=0x7ffac38aef17 "%s", ap=0x7ffc3bcf4190, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 #2  0x00007ffac3491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc3bcf4190, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 #3  0x00007ffac3469642 in __GI___snprintf (s=s@entry=0x7ffc3bcf4290 "", maxlen=maxlen@entry=32, format=format@entry=0x7ffac38aef17 "%s") at ./stdio-common/snprintf.c:31
 #4  0x00007ffac370b7b9 in dummy_set_parm (rig=0x558fe1991b20, parm=2048, val=...) at dummy.c:1704
 #5  0x0000558fb536afbe in rigctl_set_parm (rig=0x558fe1991b20, fout=0x7ffac35f25c0 <_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=0x558fb5388000 <test_list+1440>, vfo=536870912, arg1=0x7ffc3bcf4e10 "KEYERTYPE", arg2=0x558fb537fdb1 "1", arg3=0x558fb537ece8 "") at rigctl_parse.c:3829
 #6  0x0000558fb53727d6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc3bcf6fd8, 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
 #7  0x0000558fb535cadc in main (argc=<optimized out>, argv=0x7ffc3bcf6fd8) at rigctl.c:801
(cherry picked from commit 12ba558)
jfrancis42 pushed a commit to jfrancis42/Hamlib that referenced this pull request Jun 22, 2026
Need to convert the level number 0..63 to the level bit mask.
Steps to reproduce
tests/rigctld -m 1 &
tests/rigctl -m 2 dump_caps

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 [..]
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:174
 Hamlib#1  0x00007f532c46e300 in __printf_buffer (buf=buf@entry=0x7ffc320ad970, format=0x7f532c8aba22 "%s(%s) ", ap=0x7ffc320ada30, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 Hamlib#2  0x00007f532c491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc320ada30, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 Hamlib#3  0x00007f532c469642 in __GI___snprintf (
     s=s@entry=0x7ffc320aec94 "BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0.000000/0.000000) PBT_IN(0.000000..0.000000/0.000000) PBT_OUT(0.000000..0.000000/0.000000) CWPITCH(0..0/10) RFPOWER(0.050000..1.000000/0.001957) MICG"...,
     maxlen=maxlen@entry=3948, format=format@entry=0x7f532c8aba22 "%s(%s) ") at ./stdio-common/snprintf.c:31
 Hamlib#4  0x00007f532c6dc14a in rig_sprintf_parm_gran (
     str=str@entry=0x7ffc320aec00 "ANN(0..0/0) APO(0..0/0) BACKLIGHT(0..0/0) BEEP(0..1316880384/1315832322) TIME(0..0/0) BAT(0..0/0) KEYLIGHT(0..0/0) SCREENSAVER(0..4/0) AFIF(0..0/0) BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0."...,
     nlen=nlen@entry=4096, parm=9223372036854775807, gran=gran@entry=0x55f1f3cac338) at sprintflst.c:646
 Hamlib#5  0x000055f1eb6cd487 in dumpstate (rig=rig@entry=0x55f1f3ca5b20, fout=fout@entry=0x7f532c5f25c0 <_IO_2_1_stdout_>) at dumpstate.c:408
 Hamlib#6  0x000055f1eb6b4b81 in rigctl_dump_caps (rig=0x55f1f3ca5b20, fout=0x7f532c5f25c0 <_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=0x55f1eb6dc0e0 <test_list+5760>, vfo=536870912, arg1=0x0, arg2=0x55f1eb6d1ce8 "", arg3=0x55f1eb6d1ce8 "") at rigctl_parse.c:4622
 Hamlib#7  0x000055f1eb6c65f6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc320b2138, 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
 Hamlib#8  0x000055f1eb6b0adc in main (argc=<optimized out>, argv=0x7ffc320b2138) at rigctl.c:801
jfrancis42 pushed a commit to jfrancis42/Hamlib that referenced this pull request Jun 22, 2026
Steps to reproduce:
tests/rigctl -m 1 \
set_parm KEYERTYPE BUG

Fixes:
 Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault.
 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 warning: 142    ../sysdeps/x86_64/multiarch/strlen-sse2.S: File o directory non esistente
 (gdb) bt
 #0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142
 Hamlib#1  0x00007ffac346e300 in __printf_buffer (buf=buf@entry=0x7ffc3bcf40d0, format=0x7ffac38aef17 "%s", ap=0x7ffc3bcf4190, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435
 Hamlib#2  0x00007ffac3491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc3bcf4190, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96
 Hamlib#3  0x00007ffac3469642 in __GI___snprintf (s=s@entry=0x7ffc3bcf4290 "", maxlen=maxlen@entry=32, format=format@entry=0x7ffac38aef17 "%s") at ./stdio-common/snprintf.c:31
 Hamlib#4  0x00007ffac370b7b9 in dummy_set_parm (rig=0x558fe1991b20, parm=2048, val=...) at dummy.c:1704
 Hamlib#5  0x0000558fb536afbe in rigctl_set_parm (rig=0x558fe1991b20, fout=0x7ffac35f25c0 <_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=0x558fb5388000 <test_list+1440>, vfo=536870912, arg1=0x7ffc3bcf4e10 "KEYERTYPE", arg2=0x558fb537fdb1 "1", arg3=0x558fb537ece8 "") at rigctl_parse.c:3829
 Hamlib#6  0x0000558fb53727d6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc3bcf6fd8, 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
 Hamlib#7  0x0000558fb535cadc in main (argc=<optimized out>, argv=0x7ffc3bcf6fd8) at rigctl.c:801
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants