MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / handle_ts2000

Function handle_ts2000

tests/rigctlcom.c:712–1690  ·  view source on GitHub ↗

* This handles the TS-2000 emulation */

Source from the content-addressed store, hash-verified

710 * This handles the TS-2000 emulation
711 */
712static int handle_ts2000(void *arg)
713{
714 rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s\n", __func__, (char *)arg);
715
716 // Handle all the queries
717 if (strcmp(arg, "ID;") == 0)
718 {
719 char *reply = "ID019;";
720 return write_block2((void *)__func__, &my_com, reply, strlen(reply));
721 }
722
723 if (strcmp(arg, "AI;") == 0)
724 {
725 char *reply = "AI0;";
726 return write_block2((void *)__func__, &my_com, reply, strlen(reply));
727 }
728 else if (strcmp(arg, "IF;") == 0)
729 {
730 freq_t freq; // P1(11)
731 int freq_step = 10; // P2(4) just use default value for now
732 //int rit_xit_freq = 0; // P3(6) dummy value for now
733 int rit = 0; // P4(1) dummy value for now
734 int xit = 0; // P5(1) dummy value for now
735 int bank1 = 0; // P6(1) dummy value for now
736 int bank2 = 0; // P7(2) dummy value for now
737 ptt_t ptt; // P8(1)
738 rmode_t mode; // P9(1)
739 vfo_t vfo; // P10(1)
740 int scan = 0; // P11(1) dummy value for now
741 split_t split = 0; // P12(1)
742 int p13 = 0; // P13(1) Tone dummy value for now
743 int p14 = 0; // P14(2) Tone Freq dummy value for now
744 int p15 = 0; // P15(1) Shift status dummy value for now
745 int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A,
746 CACHE(my_rig)->split),
747 &freq);
748 char response[64];
749 char *fmt =
750 // cppcheck-suppress *
751 "IF%011"PRIll"%04d %1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;";
752
753 if (retval != RIG_OK)
754 {
755 return retval;
756 }
757
758 mode = ts2000_get_mode();
759 retval = rig_get_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
760 &ptt);
761
762 if (retval != RIG_OK)
763 {
764 return retval;
765 }
766
767 // we need to know split status -- don't care about the vfo
768 retval = rig_get_split_vfo(my_rig, RIG_VFO_CURR, &split, &vfo);
769

Callers 1

mainFunction · 0.85

Calls 15

rig_debugFunction · 0.85
write_block2Function · 0.85
rig_get_freqFunction · 0.85
vfo_fixupFunction · 0.85
ts2000_get_modeFunction · 0.85
rig_get_pttFunction · 0.85
rig_get_split_vfoFunction · 0.85
rig_get_vfoFunction · 0.85
rigerrorFunction · 0.85
rig_set_pttFunction · 0.85
rig_set_funcFunction · 0.85
rig_set_vfoFunction · 0.85

Tested by

no test coverage detected