예제 #1
0
        private void btnReadAccTab_Click(object sender, EventArgs e)
        {
            if (_serialPort == null)
            {
                Log("Serial port is not connected.", Color.Red);
                return;
            }

            try
            {
                ReadAccTab command = new ReadAccTab();
                if (!InitCommand(command))
                {
                    return;
                }

                command.Send(_serialPort);
                if (!command.Receive(_serialPort))
                {
                    return;
                }

                Log(command.ToString(), Color.Black);
            }
            catch (Exception ex)
            {
                Log(ex.Message, Color.Red);
                Log(ex.StackTrace, Color.Red);
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: likon/openesc
        private void btnReadAccTab_Click(object sender, EventArgs e)
        {
            if (_serialPort == null)
            {
                Log("Serial port is not connected.", Color.Red);
                return;
            }

            try
            {
                ReadAccTab command = new ReadAccTab();
                if (!InitCommand(command))
                    return;

                command.Send(_serialPort);
                if (!command.Receive(_serialPort))
                    return;

                Log(command.ToString(), Color.Black);
            }
            catch (Exception ex)
            {
                Log(ex.Message, Color.Red);
                Log(ex.StackTrace, Color.Red);
            }
        }