/// <summary> /// Waits for incoming connection /// </summary> /// <param name="portID">Class that represents the logical connection</param> /// <param name="timeout">Desired time to wait</param> /// <param name="B1_conf">B1 protocol configuration</param> /// <param name="B2_conf">B2 protocol configuration</param> /// <param name="B3_conf">B3 protocol configuration</param> /// <param name="userDBufferPool">Buffer pool for data</param> /// <returns>Success if parties are connected, otherwise appropriate error code</returns> public TSessionError ConnectInd (out object portID, int timeout, IB1_Proto B1_conf, IB2_Proto B2_conf, IB3_Proto B3_conf, SesDBufferPool userDBufferPool) { portID = null; if (!CAPI_Interface.IsRegistered) { return(TSessionError.Session_NotRegistered); } //MPNI to jest zle - trzeba szukaæ czy ind nie pojawi³o siê wczeœniej C_PLCIState port = Connections.NewPLCIPort(); portID = port; if (port == null) { return(TSessionError.ConnectReq_Failure); } port.B1_config = B1_conf; port.B2_config = B2_conf; port.B3_config = B3_conf; port.userDBufferPool = userDBufferPool; port.SM_PLCI(CAPI_Wrapper.comsub.INTERNAL_WaitFConnInd); if (port.IsConnectedWait(timeout)) { return(TSessionError.Success); } else { //port.Release(); Connections.ClosePLCIPort(ref port); return(TSessionError.ConnectReq_Failure); } }
/// <summary> /// Requests for connection /// </summary> /// <param name="portID">Class that represents the logical connection</param> /// <param name="telNum">Called party number</param> /// <param name="B1_conf">B1 protocol configuration</param> /// <param name="B2_conf">B2 protocol configuration</param> /// <param name="B3_conf">B3 protocol configuration</param> /// <param name="userDBufferPool">Buffer pool for data</param> /// <param name="timeout">timeout</param> /// <returns>Success if parties are connected, otherwise appropriate error code</returns> public TSessionError ConnectReq ( out object portID, string telNum, IB1_Proto B1_conf, IB2_Proto B2_conf, IB3_Proto B3_conf, SesDBufferPool userDBufferPool, int timeout ) { portID = null; if (!CAPI_Interface.IsRegistered) { return(TSessionError.Session_NotRegistered); } C_PLCIState port = Connections.NewPLCIPort(); portID = port; if (port == null) { return(TSessionError.ConnectReq_Failure); } port.portTelNumber = telNum; port.B1_config = B1_conf; port.B2_config = B2_conf; port.B3_config = B3_conf; port.userDBufferPool = userDBufferPool; port.SM_PLCI(CAPI_Wrapper.comsub.CONNECT_REQ); if (port.IsConnectedWait(timeout)) { return(TSessionError.Success); } else { // port.Release(); Connections.ClosePLCIPort(ref port); } return(TSessionError.ConnectReq_Failure); }