private void BuscarCodigo(ACCESS_DATA accessData, int nAntenna, Boolean bAdd) { #region codes ======================================== int nSize = lstView.Items.Count; Byte[] bEPC = new Byte[accessData.unEPCLength - 4]; Utils.Copy(accessData.pnEPC, 2, bEPC, 0, accessData.unEPCLength - 4); String strEPC = String.Empty; Utils.Byte2Hex(bEPC, ref strEPC); if (txtBuscar.Text == strEPC & m_Encontrado == false) { MessageBeep(); MessageBox.Show("Encontrado " + strEPC); m_Encontrado = true; } #endregion //end codes }
private void BuscarCodigo(ACCESS_DATA accessData, int nAntenna, Boolean bAdd) { #region codes ======================================== int nSize = lstView.Items.Count; Byte[] bEPC = new Byte[accessData.unEPCLength - 4]; Utils.Copy(accessData.pnEPC, 2, bEPC, 0, accessData.unEPCLength - 4); String strEPC = String.Empty; Utils.Byte2Hex(bEPC, ref strEPC); #endregion //end codes }
private void RetrieveData(ref ACCESS_STATUS lpAccessStatus, InsertItemDelegate insertItem, Boolean bAdd) { #region codes ======================================== if (lpAccessStatus.dwStatus == 0 && lpAccessStatus.dwErrorCode == 0) { for (int i = 0; i < lpAccessStatus.unAntennas; i++) { ANTENNA_STATUS stAntennaStatus = new ANTENNA_STATUS(); R1000Reader.RFIDGetAntennaStatus(i, ref stAntennaStatus); for (int j = 0; j < stAntennaStatus.unCount; j++) { ACCESS_DATA accessData = new ACCESS_DATA(); UInt32 nRet = R1000Reader.RFIDGetAccessData(i, j, ref accessData); if (nRet == 1 && accessData.unEPCLength > 0) { this.Invoke(insertItem, new object[] { accessData, stAntennaStatus.unAntenna, bAdd }); } } } } #endregion //end codes }
private void BuscarCodigo(ACCESS_DATA accessData, int nAntenna, Boolean bAdd) { #region codes ======================================== int nSize = lstView.Items.Count; int largo; String Dato; Byte[] bEPC = new Byte[accessData.unEPCLength - 4]; Utils.Copy(accessData.pnEPC, 2, bEPC, 0, accessData.unEPCLength - 4); String strEPC = String.Empty; Utils.Byte2Hex(bEPC, ref strEPC); // MessageBox.Show(strEPC.ToString ()); txtBuscar.Text = txtBuscar.Text.Replace("l2", "13"); txtBuscar.Text = txtBuscar.Text.Replace("L2", "13"); Dato = txtBuscar.Text; largo = Dato.Length; //MessageBox.Show (strEPC.Substring(1, largo ) ) ; if (txtBuscar.Text == (strEPC.Substring(0, largo)) & m_Encontrado == false) { MessageBeep(); MessageBox.Show("Encontrado " + strEPC); m_Encontrado = true; } #endregion //end codes }
private void InsertItem(ACCESS_DATA accessData, int nAntenna, Boolean bAdd) { #region codes ======================================== int i, nCount = 0; int nSize = lstView.Items.Count; Boolean bFind = false; Byte[] bEPC = new Byte[accessData.unEPCLength - 4]; Utils.Copy(accessData.pnEPC, 2, bEPC, 0, accessData.unEPCLength - 4); String strEPC = String.Empty; Utils.Byte2Hex(bEPC, ref strEPC); for (i = 0; i < nSize; i++) { ListViewItem listItem = lstView.Items[i]; if (listItem.SubItems[2].Text == strEPC) { if (bAdd == true) { nCount = Convert.ToInt32(listItem.SubItems[1].Text); nCount++; listItem.SubItems[1].Text = nCount.ToString(); lstView.Items[i] = listItem; } bFind = true; break; } } if (bFind == false) { nCount = 1; ListViewItem listItem = new ListViewItem(nSize.ToString()); listItem.SubItems.Add(nCount.ToString()); listItem.SubItems.Add(strEPC); lstView.Items.Add(listItem); const string PAPY_IP = "192.168.92.136"; const UInt16 PAPY_PORT = 1999; //try //{ // string data = "e" + strEPC + ";" + DateTime.Now; // Socket sender = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); // EndPoint ep = new IPEndPoint(PAPY_IP, PAPY_PORT); // sender.Connect(ep); // sender.Send(Encoding.ASCII.GetBytes(data), SocketFlags.None); // sender.Close(); //} //catch (Exception ex) //{ // lblStatus.Text = ex.Message; //} } #endregion //end codes }