Exemplo n.º 1
0
        public LockForm(AppForm appForm)
        {
            InitializeComponent();
            m_AppForm    = appForm;
            m_LockParams = new TagAccess.LockAccessParams();
            m_LockParams.AccessPassword = 0;

            m_LockDataField = LOCK_DATA_FIELD.LOCK_EPC_MEMORY;
            m_LockPrivilege = LOCK_PRIVILEGE.LOCK_PRIVILEGE_READ_WRITE;
        }
Exemplo n.º 2
0
        private void lockButton_Click(object sender, EventArgs e)
        {
            m_LockParams.LockPrivilege = new LOCK_PRIVILEGE[NUM_MEMORY_BANKS];

            try
            {
                if (tagID_TB.Text.Length == 0)
                {
                    m_AppForm.functionCallStatusLabel.Text = "No TagID is defined";
                    return;
                }
                m_LockParams.AccessPassword = 0;
                if (Password_TB.Text.Length > 0)
                {
                    string password = Password_TB.Text;
                    if (password.StartsWith("0x"))
                    {
                        password = password.Substring(2, password.Length - 2);
                    }
                    m_LockParams.AccessPassword = uint.Parse(
                        password, System.Globalization.NumberStyles.HexNumber);
                }
            }
            catch (Exception ex)
            {
                m_AppForm.functionCallStatusLabel.Text = ex.Message.ToString();
            }
            m_LockDataField = (LOCK_DATA_FIELD)memBank_CB.SelectedIndex;
            m_LockPrivilege = (LOCK_PRIVILEGE)lockPrivilege_CB.SelectedIndex;

            m_LockParams.LockPrivilege[memBank_CB.SelectedIndex]
                = (LOCK_PRIVILEGE)lockPrivilege_CB.SelectedIndex;
            m_AppForm.m_SelectedTagID = this.tagID_TB.Text;

            m_AppForm.accessBackgroundWorker.RunWorkerAsync(ACCESS_OPERATION_CODE.ACCESS_OPERATION_LOCK);
            lockButton.Enabled = false;
        }