Пример #1
0
 private void disconnectBTN_Click(object sender, EventArgs e)
 {
     tagReader.DisConnect();
     tagReader             = null;
     connected             = false;
     connectBTN.Enabled    = !connected;
     disconnectBTN.Enabled = connected;
     Log("Disconneted");
 }
Пример #2
0
        private void connectBTN_Click(object sender, EventArgs e)
        {
            if (portsCB.SelectedIndex < 0 || baudCB.SelectedIndex < 0)
            {
                return;
            }
            int    baud = int.Parse(baudCB.Items[baudCB.SelectedIndex].ToString());
            string port = portsCB.Items[portsCB.SelectedIndex].ToString();

            tagReader             = new SerialRFTagReader(this, port, baud);
            connected             = tagReader.Connect();
            connectBTN.Enabled    = !connected;
            disconnectBTN.Enabled = connected;
            Log($"Connected [{port}/{baud}] => {connected}");
        }