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

PComm::PComm ( char *  pcrDev,
tcflag_t  baudRate = B9600,
const char *  name = 0 

The PComm Constructor.

pcrDev name of device to be opened (char string)
baudRate speed of device to be opened
name internal object name (for your use)
This is the easiest way to open the serial device for communications with the radio. If the serial device cannot be opened for processing the object will abort with a -1 status code to the operating system.

You must send it at least the device name which is to be opened as the first argument. Optionally, you can send it an initial baudrate and an internal object name.

Definition at line 29 of file pcomm.cpp.

References callCount, int_name, PCOpen(), pcrDevice, and pcrSpeed.

    if (name==NULL) {
        strcpy(int_name, "PComm_Obj");
    } else {
        strcpy(int_name, name);

    bzero(pcrDevice, sizeof(pcrDevice));
    strncpy(pcrDevice, pcrDev, sizeof(pcrDevice)-1);
    pcrSpeed = baudRate;

    if (!PCOpen(pcrDev, baudRate))
        { exit(-1); }


Generated by  Doxygen 1.6.0   Back to index