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

PComm::PCAsk ( char *  mesg  ) 

Issue a status request from the radio.

Parameters:
mesg a query command string
This function makes sure that mesg isnt empty, as well as making sure that mesg is two bytes long. Any queries sent to the radio should be the header of the information requested to be returned.

It then zero's out the ask buffer, and copies the message into the ask buffer. Then it concatenates the PCRQST command terminator, and calls Write() sending it the ask buffer.

Returns:
the number of bytes asked minus the PCRQST command terminator.
See also:
PCRQST pcrdef.h

Definition at line 217 of file pcomm.cpp.

References askBuf, and Write().

Referenced by PCP::PCPQueryOn(), PCP::PCPQuerySquelch(), PCP::PCPSigStrength(), and PCP::PCPSigStrengthStr().

{
    #ifdef DEBUG_VER_2
    fprintf(stderr, "Ask: %s\n", mesg);
    assert(mesg!=0);
    assert(strlen(mesg)==2);
    #endif /* DEBUG_VER_ */

    bzero(askBuf, sizeof(askBuf));
    strcpy(askBuf, mesg);
    strcat(askBuf, PCRQST);

    return (Write(askBuf)-1);
}


Generated by  Doxygen 1.6.0   Back to index