public bool StartLocation(String currentepc)
        {
            ushort[] antennaList = new ushort[1] {
                1
            };
            OPERATION_QUALIFER[] opList = new OPERATION_QUALIFER[1] {
                OPERATION_QUALIFER.LOCATE_TAG
            };
            AntennaInfo antennaInfo = new AntennaInfo(antennaList, opList);

            try
            {
                m_ReaderAPI.Actions.TagLocationing.Perform(currentepc, antennaInfo);
                isReading = true;
            }
            catch (InvalidOperationException ioe)
            {
                //m_AppForm.notifyUser(ioe.Message, "Locate Operation");
                MessageBox.Show("Tag Invalida", "Busqueda de EPC");
                return(false);
            }
            catch (OperationFailureException ofe)
            {
                //m_AppForm.notifyUser(ofe.StatusDescription, "Locate Operation");
                MessageBox.Show("Tag Invalida", "Busqueda de EPC");
                return(false);
            }
            catch (InvalidUsageException iue)
            {
                //m_AppForm.notifyUser(iue.Info, "Locate Operation");
                MessageBox.Show("Tag Invalida", "Busqueda de EPC");
                return(false);
            }
            catch (Exception ex)
            {
                //m_AppForm.notifyUser(ex.Message, "Locate Operation");
                MessageBox.Show("Tag Invalida", "Busqueda de EPC");
                return(false);
            }
            return(true);
        }
Example #2
0
 private void locateButton_Click(object sender, EventArgs e)
 {
     if (locateButton.Text == "Start")
     {
         try
         {
             ushort[] antennaList = new ushort[1] {
                 1
             };
             OPERATION_QUALIFER[] opList = new OPERATION_QUALIFER[1] {
                 OPERATION_QUALIFER.LOCATE_TAG
             };
             AntennaInfo antennaInfo = new AntennaInfo(antennaList, opList);
             m_AppForm.m_ReaderAPI.Actions.TagLocationing.Perform(tagID_TB.Text, antennaInfo);
             locateButton.Text = "Stop";
         }
         catch (InvalidOperationException ioe)
         {
             m_AppForm.functionCallStatusLabel.Text = ioe.Message;
         }
         catch (OperationFailureException ofe)
         {
             m_AppForm.functionCallStatusLabel.Text = ofe.StatusDescription;
         }
         catch (InvalidUsageException iue)
         {
             m_AppForm.functionCallStatusLabel.Text = iue.Info;
         }
         catch (Exception ex)
         {
             m_AppForm.functionCallStatusLabel.Text = ex.Message;
         }
     }
     else if (locateButton.Text == "Stop")
     {
         m_AppForm.m_ReaderAPI.Actions.TagLocationing.Stop();
         locateButton.Text = "Start";
         Locate_PB.Value   = 0;
     }
 }