Device Function

Get Protocol CID

dev_GetProtocolCid()

Retrieve the CID of a given protocol layer.

Syntax
#include "device.h"

LCid    dev_GetProtocolCid
    (
        LDevice      device,
        LProtocol    protocol
    );
devicedevice to query
protocolid of protocol
Description

dev_GetProtocolCid() returns the current CID for a given protocol. If the device is not open and attached, the CID will be invalid.

Return Values

If successful, dev_GetProtocolCid() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

dev_GetReadWriteCid()

Example
if (dev_Open(device) < 0)
{
    LOG("Open failure");
}
else
{
    if ((cid = dev_GetProtocolCid(device, lgo_PROTOCOL_X21_BIS) < 0)
    {
        LOG("No X.21 bis layer in device");
    }
}