Logo Search packages:      
Sourcecode: icomlib version File versions  Download package

bool PCP::PCPSetToneSq ( float  passvalue  ) 

Sets session CTCSS based on a float value.

passvalue tone squelch in Hz
Since the previous method requires the programmer to remember the PCR-1000's internal number that corresponds to the tone squelch frequency, this overloaded method allows the programmer to pass a float, where the float is the frequency (Hz) in question.

true or false based on PCPCheckResponse success or failure. On failure, it turns off CTCSS and returns false.
See also:
pcrdef.h PCRTSQL

Definition at line 537 of file pcp.cpp.

References PCPRadio, PCPSetToneSq(), and PRadInf::PCPToneSqFloat.

#ifdef DEBUG_VER_
      fprintf(stderr, "PCP: PCPSETTONESQ (float) - %f\n", passvalue);
#endif // DEBUG_VER_ 

      int tone;

      tone = (int)(passvalue * 10.0 + .1);  // Hack to remove truncating errors.

      switch (tone)
            case 0: return PCPSetToneSq("00"); break;
            case 670: return PCPSetToneSq("01"); break;
            case 693: return PCPSetToneSq("02"); break;
            case 710: return PCPSetToneSq("03"); break;
            case 719: return PCPSetToneSq("04"); break;
            case 744: return PCPSetToneSq("05"); break;
            case 770: return PCPSetToneSq("06"); break;
            case 797: return PCPSetToneSq("07"); break;
            case 825: return PCPSetToneSq("08"); break;
            case 854: return PCPSetToneSq("09"); break;
            case 885: return PCPSetToneSq("0A"); break;
            case 915: return PCPSetToneSq("0B"); break;
            case 948: return PCPSetToneSq("0C"); break;
            case 974: return PCPSetToneSq("0D"); break;
            case 1000: return PCPSetToneSq("0E"); break;
            case 1035: return PCPSetToneSq("0F"); break;
            case 1072: return PCPSetToneSq("10"); break;
            case 1109: return PCPSetToneSq("11"); break;
            case 1148: return PCPSetToneSq("12"); break;
            case 1188: return PCPSetToneSq("13"); break;
            case 1230: return PCPSetToneSq("14"); break;
            case 1273: return PCPSetToneSq("15"); break;
            case 1318: return PCPSetToneSq("16"); break;
            case 1365: return PCPSetToneSq("17"); break;
            case 1413: return PCPSetToneSq("18"); break;
            case 1462: return PCPSetToneSq("19"); break;
            case 1514: return PCPSetToneSq("1A"); break;
            case 1567: return PCPSetToneSq("1B"); break;
            case 1598: return PCPSetToneSq("1C"); break;
            case 1622: return PCPSetToneSq("1D"); break;
            case 1655: return PCPSetToneSq("1E"); break;
            case 1679: return PCPSetToneSq("1F"); break;
            case 1713: return PCPSetToneSq("20"); break;
            case 1738: return PCPSetToneSq("21"); break;
            case 1773: return PCPSetToneSq("22"); break;
            case 1799: return PCPSetToneSq("23"); break;
            case 1835: return PCPSetToneSq("24"); break;
            case 1862: return PCPSetToneSq("25"); break;
            case 1899: return PCPSetToneSq("26"); break;
            case 1928: return PCPSetToneSq("27"); break;
            case 1966: return PCPSetToneSq("28"); break;
            case 1995: return PCPSetToneSq("29"); break;
            case 2035: return PCPSetToneSq("2A"); break;
            case 2065: return PCPSetToneSq("2B"); break;
            case 2107: return PCPSetToneSq("2C"); break;
            case 2181: return PCPSetToneSq("2D"); break;
            case 2257: return PCPSetToneSq("2E"); break;
            case 2291: return PCPSetToneSq("2F"); break;
            case 2336: return PCPSetToneSq("30"); break;
            case 2418: return PCPSetToneSq("31"); break;
            case 2503: return PCPSetToneSq("32"); break;
            case 2541: return PCPSetToneSq("33"); break;
            default: PCPSetToneSq("00"); break;
      return false;

Generated by  Doxygen 1.6.0   Back to index