private void okButton_Click(object sender, EventArgs e)
        {
            if (activeThresholdValue != newThreshold.Value)
            {
                rfid.Constants.Result status = rfid.Constants.Result.OK;

                try
                {
                    status = reader.API_AntennaPortSetSenseThreshold((uint)newThreshold.Value);
                }
                catch (Exception)
                {
                    status = rfid.Constants.Result.RADIO_FAILURE;
                }

                if (rfid.Constants.Result.OK != status)
                {
                    MessageBox.Show
                    (
                        "Reader Error.\n\n" +
                        "An error occurred while updating the antenna threshold value.\n\n" +
                        "The follow error occurred: " + status,
                        "Antenna Threshold Setting Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error
                    );

                    return;
                }
            }

            DialogResult = DialogResult.OK;
        }
        private void RestoreDefaultButton_Click(object sender, EventArgs e)
        {
            this.antennaList.Clear();

            this.antennaList.AddRange(Source_AntennaList.DEFAULT_ANTENNA_LIST);

            rfid.Constants.Result result =
                this.antennaList.store(LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle);

            if (rfid.Constants.Result.OK != result)
            {
                Console.WriteLine("Error {0} while setting default antenna configurations");
            }

            // Magic numbers - argh - just adding this for 'uniformity'
            // so that everything on the panel

            //Antenna Sense threshold
            globalSenseThresholdVal = 0xFFFFF;
            rfid.Constants.Result status = rfid.Constants.Result.OK;

            try
            {
                status = reader.API_AntennaPortSetSenseThreshold(globalSenseThresholdVal);
            }
            catch (Exception)
            {
                status = rfid.Constants.Result.RADIO_FAILURE;

                globalSenseThreshold.Text = "UNKNOWN";

                return;
            }

            this.updateThreshold();



            //RfPowerThreshold
            UInt32 oem_rf_threshold = 0;

            numericUpDownRfPowerThreshold.Value = 0x0000001E;
            oem_rf_threshold = (UInt32)numericUpDownRfPowerThreshold.Value;

            //clark not sure. Wait firmware support this function.
            //status = reader.MacWriteOemData( (ushort) enumOEM_ADDR.ENUM_OEM_ADDR_RF_REVPWR_THRESHOLD,
            //                                          oem_rf_threshold                               );


            view.Refresh();
        }