From 032e78826e05ee09ab761ee1abdac26dc3ea4ca8 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Tue, 5 Aug 2025 23:42:06 +0200 Subject: [PATCH] Fix BC and FO commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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=] --- simulators/simtmd710.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/simulators/simtmd710.c b/simulators/simtmd710.c index 3cc216b17..3e5a8b9e7 100644 --- a/simulators/simtmd710.c +++ b/simulators/simtmd710.c @@ -52,21 +52,26 @@ int main(int argc, char *argv[]) if (strncmp(buf, "BC", 2) == 0) { - SNPRINTF(buf, sizeof(buf), "BC %d %d%c", vfo, vfo_tx, 0x0d); + SNPRINTF(buf, sizeof(buf), "BC %d,%d%c", vfo, vfo_tx, 0x0d); printf("R:%s\n", buf); write(fd, buf, strlen(buf)); continue; } else if (strncmp(buf, "FO", 2) == 0) { - if (buf[3] == '0') - { - SNPRINTF(buf, sizeof(buf), "FO 0 %d%c", freqA, 0x0d); - } - else - { - SNPRINTF(buf, sizeof(buf), "FO 1 %d%c", freqB, 0x0d); + char vfo = buf[3]; + int frequency; + char tone_frequency[] = "10"; // 94.8 + char ctcss_frequency[] = "05"; // 79,7 + char dcs_frequency[] = "016"; // 114 + + if (vfo == '0') { + frequency = (int)freqA; + } else { + frequency = (int)freqB; } + SNPRINTF(buf, sizeof(buf), "FO %c,%.10d,0,0,0,0,0,0,%.2s,%.2s,%.3s,00000000,0%c", + vfo, frequency, tone_frequency, ctcss_frequency, dcs_frequency, 0x0d); printf("R:%s\n", buf); write(fd, buf, strlen(buf));