Exemple #1
0
        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);
        }
Exemple #2
0
 /// <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));
 }
Exemple #3
0
 /// <summary>
 /// Send data
 /// </summary>
 /// <param name="ci">Communication interface</param>
 /// <param name="data">Data to be sent, byte array</param>
 public static void Send(CommunicationInterface ci, byte[] data)
 {
     ci.Send(data);
 }
 public LLRPClient()
 {
     cI = new TCPIPClient();
 }
 /// <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);
 }
 /// <summary>
 /// Send data
 /// </summary>
 /// <param name="ci">Communication interface</param>
 /// <param name="data">Data to be sent, byte array</param>
 public static void Send(CommunicationInterface ci, byte[] data)
 {
     ci.Send(data);
 }
        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;
        }