lgo_AttachProtocol()
Attach to a communication service.
#include "laygo.h" LCid lgo_AttachProtocol ( LProtocol protocol, LMajorId major, LMinorId minor );
protocol | id of protocol to attach to |
major | id of major device |
minor | id of minor device |
lgo_AttachProtocol() attaches to a service which was previously opened with lgo_OpenProtocol() and detached with lgo_Detach().
lgo_AttachProtocol() returns a CID exactly as lgo_OpenProtocol() does. However, the connection may not be in the open state. lgo_State() can be used to determine what state the connection is in.
If successful, lgo_AttachProtocol() returns a non-negative connection identifier (CID) which uniquely identifies the connection during subsequent transactions. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
LCid cid; if ((cid = lgo_AttachProtocol(lgo_PROTOCOL_X21_BIS, 0, 0) < 0) { return (FAILURE); }