Пример #1
0
        private async void ConnectButton_Click(object sender, EventArgs e)
        {
            if (PortSpecified)
            {
                try
                {
                    _brick = new MainBrick(1, BluetoothPortName);
                    await _brick.Connect_Brick();

                    Connect_to_Brick = true;
                }
                catch (ArgumentException EG)
                {
                    MessageBox.Show("Pls dont type in Bs");
                }
                catch (System.IO.IOException EM)
                {
                    MessageBox.Show("Port doesnt exist");
                }
            }
        }
Пример #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Debug.WriteLine("Controller activated");
     _brick = new MainBrick();
 }