Example #1
0
        private void btnQueryRF_Click(object sender, EventArgs e)
        {
            #region reader mode
            {
                IRP1.SysQuery_800 msg = new IRP1.SysQuery_800(0x19);
                if (reader.Send(msg))
                {
                    switch (msg.ReceivedMessage.QueryData[0])
                    {
                    case 0x04:
                        cbReaderMode.SelectedIndex = 0;
                        break;

                    case 0x05:
                        cbReaderMode.SelectedIndex = 1;
                        break;

                    case 0x02:
                        cbReaderMode.SelectedIndex = 2;
                        break;

                    case 0xff:
                        cbReaderMode.SelectedIndex = 3;
                        break;

                    case 0x09:
                        cbReaderMode.SelectedIndex = 4;
                        break;

                    default:
                        cbReaderMode.SelectedIndex = -1;
                        break;
                    }
                    cbReaderMode.Enabled = true;
                }
                else
                {
                    cbReaderMode.Enabled = false;
                }
            }
            #endregion

            #region Session
            {
                IRP1.TagOperationQuery_6C msg = new IRP1.TagOperationQuery_6C(0x12);
                if (reader.Send(msg))
                {
                    // query session
                    cbSession.SelectedIndex = msg.ReceivedMessage.QueryData[0];
                    // query inventory flag
                    cbFlag.SelectedIndex = msg.ReceivedMessage.QueryData[1];
                    //        MessageBox.Show(msg.ReceivedMessage.QueryData[0].ToString() + " " + msg.ReceivedMessage.QueryData[1].ToString());
                }
                else
                {
                    MessageBox.Show("Query Error - Session and Flag");
                }
            }
            #endregion
        }
Example #2
0
        private void btnAntQuery_Click(object sender, EventArgs e)
        {
            // Brett: Query successfully gets the antenna power and Q value
            // it does not get the selected antenna ports, memory bank or continuous or single read status.
            Boolean isSuc = false;

            IRP1.SysQuery_800 order = new IRP1.SysQuery_800(0x68, 0x00);
            if (reader.Send(order))
            {
                isSuc      = true;
                isNewPower = true;

                list = new Double[order.ReceivedMessage.QueryData.Length];
                for (int i = 0; i < list.Length; i++)
                {
                    list[i] = (Double)i;
                }

                // query power
                IRP1.SysQuery_800 order1 = new IRP1.SysQuery_800(0x65, 0x00);// power param
                if (reader.Send(order1))
                {
                    this.nudAnt1.Text = list[order1.ReceivedMessage.QueryData[0]].ToString();
                    this.nudAnt2.Text = list[order1.ReceivedMessage.QueryData[1]].ToString();
                    this.nudAnt3.Text = list[order1.ReceivedMessage.QueryData[2]].ToString();
                    this.nudAnt4.Text = list[order1.ReceivedMessage.QueryData[3]].ToString();
                }

                IRP1.TagOperationQuery_6C msg = new IRP1.TagOperationQuery_6C(0x10);
                if (reader.Send(msg))
                {
                    numQ.Value = msg.ReceivedMessage.QueryData[0];
                }
                else
                {
                    MessageBox.Show("Error getting Q");
                }
            }
        }