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

bool PCP::PCPSetFilter ( const char *  filter  ) 

Sets current session's filter.

Parameters:
filter character string version of the filter
Valid arguments for filter:
  • 3 3.0 kHz
  • 6 6.0 kHz
  • 15 15.0 kHz
  • 50 50.0 kHz
  • 230 230.0 kHz
The concept is the same as above ( PCPSetMode ) it accepts standard text for "3"/"6" etc... Use of the pcrdef codes are not necessary, they will be decoded based on filter.

Returns:
true or false based on success or failure
See also:
PCPRadio pcrdef.h

Definition at line 441 of file pcp.cpp.

References PCPCheckResponse(), PCPComm, PRadInf::PCPFilter, PRadInf::PCPFreq, PRadInf::PCPMode, PCPRadio, PCPTemp, and PComm::PCTell().

{
    char freqConv[32];
    char temp[8];

    memset(PCPTemp, '\0', sizeof(PCPTemp));
    sprintf(freqConv, "%0.10lu", PCPRadio->PCPFreq);
    strcpy(PCPTemp, PCRFRQ);
    strcat(PCPTemp, freqConv);
    strcat(PCPTemp, PCPRadio->PCPMode);

    if ( strncmp(filter, "3", 1)==0 ) {
        strcat(PCPTemp, PCRFLTR3);
      strcpy(temp, PCRFLTR3);
    } else if ( strncmp(filter, "6", 1)== 0 ) {
        strcat(PCPTemp, PCRFLTR6);
      strcpy(temp, PCRFLTR6);
    } else if ( strncmp(filter, "15", 2)==0 ) {
        strcat(PCPTemp, PCRFLTR15);
      strcpy(temp, PCRFLTR15);
    } else if ( strncmp(filter, "50", 2)==0 ) {
        strcat(PCPTemp, PCRFLTR50);
      strcpy(temp, PCRFLTR50);
    } else if ( strncmp(filter, "230", 3)==0 ) {
        strcat(PCPTemp, PCRFLTR230);
      strcpy(temp, PCRFLTR230);
    } else {
        return false;
    }

    strcat(PCPTemp, "00");
    PCPComm->PCTell(PCPTemp);
    if (PCPCheckResponse()) {
#ifdef DEBUG_VER_
      fprintf(stderr, "Storing PCPRadio->PCPFilter: %s\n", temp);
#endif DEBUG_VER_
        strcpy(PCPRadio->PCPFilter,temp);
        return true;
    }

    return false;
}


Generated by  Doxygen 1.6.0   Back to index