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

Function ts2000_get_mode

tests/rigctlcom.c:602–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600
601
602static rmode_t ts2000_get_mode()
603{
604 rmode_t mode;
605 pbwidth_t width;
606 rig_get_mode(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
607 &mode, &width);
608 kwidth = width;
609#if 0
610 // Perhaps we should emulate a rig that has PKT modes instead??
611 int kwidth_ssb[] = { 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 };
612 int kwidth_am[] = { 10, 100, 200, 500 };
613
614 // still need to cover packet filter 00=wide, 01=nar
615 switch (mode)
616 {
617 case RIG_MODE_LSB: mode = 1; kwidth = kwidth_ssb[width]; break;
618
619 case RIG_MODE_USB: mode = 2; kwidth = kwidth_ssb[width]; break;
620
621 case RIG_MODE_CW: mode = 3; kwidth = kwidth_am[width];
622 break; // is this correct?
623
624 case RIG_MODE_FM: mode = 4; kwidth = kwidth_ssb[width]; break;
625
626 case RIG_MODE_AM: mode = 5; kwidth = kwidth_am[width]; break;
627
628 case RIG_MODE_RTTY: mode = 6; kwidth = kwidth_ssb[width]; break;
629
630 case RIG_MODE_CWR: mode = 7; kwidth = kwidth_am[width];
631 break; // is this correct?
632
633 case RIG_MODE_NONE: mode = 8; kwidth = kwidth_am[width];
634 break; // is this correct?
635
636 case RIG_MODE_RTTYR: mode = 9; kwidth = kwidth_ssb[width]; break;
637
638 case RIG_MODE_PKTUSB: mode = 2; kwidth = kwidth_ssb[width];
639 break; // need to change to a TS_2000 mode
640
641 case RIG_MODE_PKTLSB: mode = 1; kwidth = kwidth_ssb[width];
642 break; // need to change to a TS_2000 mode
643
644 default: mode = 0; break;
645 }
646
647#else
648 // Perhaps we should emulate a rig that has PKT modes instead??
649 //int kwidth_ssb[] = { 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 };
650 //int kwidth_am[] = { 10, 100, 200, 500 };
651
652 // still need to cover packet filter 00=wide, 01=nar
653 switch (mode)
654 {
655 case RIG_MODE_LSB: mode = 1; break;
656
657 case RIG_MODE_USB: mode = 2; break;
658
659 case RIG_MODE_CW: mode = 3;

Callers 1

handle_ts2000Function · 0.85

Calls 2

rig_get_modeFunction · 0.85
vfo_fixupFunction · 0.85

Tested by

no test coverage detected