public bool Create(string llrp_reader_name, bool server) { try { if (server) { cI = new TCPIPServer(); cI.Open("", LLRP1_TCP_PORT); } else { cI = new TCPIPClient(); cI.Open(llrp_reader_name, LLRP1_TCP_PORT); } cI.OnMessageReceived += new delegateMessageReceived(cI_OnMessageReceived); cI.OnClientConnected += new delegateClientConnected(cI_OnClientConnected); } catch { return(false); } return(true); }
private void init() { this.cI = (CommunicationInterface) new TCPIPClient(); this.notificationQueue = new BlockingQueue(); this.notificationThread = new Thread(new ThreadStart(this.ProcessNotificationQueue)); this.notificationThread.IsBackground = true; this.notificationThread.Start(); }
/// <summary> /// Construct an LLRP transaction object for the purpose of performing a transaction /// via LLRP. /// </summary> /// <param name="ci">The communications interface to use for the transaction</param> /// <param name="send_msg_id">the message ID of the sent message (also of the response)</param> /// <param name="response_type">the expected response type</param> public Transaction(CommunicationInterface ci, UInt32 send_msg_id, ENUM_LLRP_MSG_TYPE response_type) { msg_id = send_msg_id; commIF = ci; msg_response_type = response_type; rsp_event = new ManualResetEvent(false); err_event = new ManualResetEvent(false); }
public Transaction( CommunicationInterface ci, uint send_msg_id, ENUM_LLRP_MSG_TYPE response_type) { this.msg_id = send_msg_id; this.commIF = ci; this.msg_response_type = response_type; this.rsp_event = new ManualResetEvent(false); this.err_event = new ManualResetEvent(false); }
public bool Create(string llrp_reader_name, bool server) { try { if (server) { this.cI = (CommunicationInterface) new TCPIPServer(); this.cI.Open("", this.LLRP1_TCP_PORT); } else { this.cI = (CommunicationInterface) new TCPIPClient(); this.cI.Open(llrp_reader_name, this.LLRP1_TCP_PORT); } this.cI.OnFrameReceived += new delegateMessageReceived(this.cI_OnMessageReceived); this.cI.OnClientConnected += new delegateClientConnected(this.cI_OnClientConnected); } catch { return(false); } return(true); }
public static int Receive(CommunicationInterface ci, out byte[] buffer) => ci.Receive(out buffer);
public static void Send(CommunicationInterface ci, byte[] data) => ci.Send(data);
/// <summary> /// Receive data /// </summary> /// <param name="ci">Communication interface</param> /// <param name="buffer">Buffer for receiving data</param> /// <returns></returns> public static int Receive(CommunicationInterface ci, out byte[] buffer) { return(ci.Receive(out buffer)); }