Example #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            getDeviceInfo.getActiveDevice();
            if (getDeviceInfo.activeDeviceListAl.Count == 0)
            {
                MessageBox.Show("Troi oi! Chua cam logger kia thim 2!");
                return;
            }
            device35.hostport = getDeviceInfo.activeDeviceListAl[0].ToString();

            if (device35.USBOpen(device35.hostport) == false)
            {
                MessageBox.Show("Open USB fail");
                device35.Close();
                return;
            }


            if (comboBox1.Text == "With WifiReader")
            {
                device35.version = 1;
            }
            else
            {
                device35.version = 0;
            }

            mGlobal.len = 64;

            if (device35.writeFirmVer())
            {
                MessageBox.Show("OK!!!!!!!!!!");
                this.Close();
            }
            else
            {
                MessageBox.Show("Fail! Please try again!!!");
            }

            device35.Close();
        }