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

bool PCP::PCPInit ( bool  autoUpdate = false  ) 

Initialise the radio.

Parameters:
autoUpdate Initialise the radio in autoUpdate mode
This function sends the initialsation command(s). Due to the hardware taking some time to initialize, we sleep for one second to let it catch up, then check to see if the radio was on. If it *was* on then it checks for a response.

After PCPCheckResponse tells it that the command succeeded, it sets PCPRadio->PCPAutoUpdate mode appropriately.

Returns:
On success : true otherwise false.
See also:
PCPAutoUpdate PCPCheckResponse PCPStatus

Definition at line 90 of file pcp.cpp.

References PRadInf::PCPAutoUpdate, PCPCheckResponse(), PCPComm, PCPRadio, PCPStatus, and PComm::PCTell().

{
    if (autoUpdate==false) {
        PCPComm->PCTell(PCRINITM);
      fprintf(stderr, "Radio is coming up. Please wait...\n");
      sleep(1); 
      if (PCPStatus) 
        if (PCPCheckResponse()) {
            PCPRadio->PCPAutoUpdate=false;
            return true;
        }
    } else {
        PCPComm->PCTell(PCRINITA);
      sleep(1);
      if (PCPStatus)
        if (PCPCheckResponse()) {
            PCPRadio->PCPAutoUpdate=true;
            return true;
        }
    }

    return false;
}


Generated by  Doxygen 1.6.0   Back to index