kopia lustrzana https://github.com/Hamlib/Hamlib
Fix BC and FO commands
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=]pull/1831/head
rodzic
d5c5eeff15
commit
032e78826e
|
@ -52,21 +52,26 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
if (strncmp(buf, "BC", 2) == 0)
|
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);
|
printf("R:%s\n", buf);
|
||||||
write(fd, buf, strlen(buf));
|
write(fd, buf, strlen(buf));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (strncmp(buf, "FO", 2) == 0)
|
else if (strncmp(buf, "FO", 2) == 0)
|
||||||
{
|
{
|
||||||
if (buf[3] == '0')
|
char vfo = buf[3];
|
||||||
{
|
int frequency;
|
||||||
SNPRINTF(buf, sizeof(buf), "FO 0 %d%c", freqA, 0x0d);
|
char tone_frequency[] = "10"; // 94.8
|
||||||
}
|
char ctcss_frequency[] = "05"; // 79,7
|
||||||
else
|
char dcs_frequency[] = "016"; // 114
|
||||||
{
|
|
||||||
SNPRINTF(buf, sizeof(buf), "FO 1 %d%c", freqB, 0x0d);
|
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);
|
printf("R:%s\n", buf);
|
||||||
write(fd, buf, strlen(buf));
|
write(fd, buf, strlen(buf));
|
||||||
|
|
Ładowanie…
Reference in New Issue