Info() 공개 메소드

public Info ( ) : BP_RESPONSE
리턴 BP_RESPONSE
예제 #1
0
 private void Info_Click(object sender, EventArgs e)
 {
     if (bpPort != null)
     {
         DisplayStatus(bpPort.Info());
     }
 }
예제 #2
0
        private void Connect_Click(object sender, EventArgs e)
        {
            if (bpPort == null)
            {
                if (ComPort.SelectedIndex >= 0)
                {
                    string port = ComPort.SelectedItem as string;
                    bpPort = new BPPort(port);
                    bpPort.WaitResponse += new BPPort.WaitResponseEventHandle(bpPort_WaitResponse);
                    bpPort.RecieveData  += new BPPort.RecieveDataEventHandle(bpPort_RecieveData);
                    bpPort.SendStarted  += new BPPort.SendStartedEventHandle(bpPort_SendStarted);
                    bpPort.SendEnded    += new BPPort.SendEndedEventHandle(bpPort_SendEnded);
                    try
                    {
                        if (bpPort.Connect() == BP_RESPONSE.OK)
                        {
                            Connect.Text         = "F8 - Disconnect";
                            groupCommand.Enabled = groupMode.Enabled = true;
                            Mode.SelectedIndex   = ((int)bpPort.Mode) - 1;
                            StatusText(bpPort.FirmwareVersion);
                            if (bpPort.Info() == BP_RESPONSE.OK)
                            {
                                DisplayPins();
                            }

                            SetAutoUpdate();
                            return;
                        }
                        bpPort = null;
                        StatusText("BusPirate not found");
                    }
                    catch (Exception ex)
                    {
                        LogError(ex.Message);
                    }
                }
            }
            else
            {
                TimerStop();
                Connect.Text         = "F8 - Connect";
                groupCommand.Enabled = groupMode.Enabled = false;
                bpPort.Disconnect();
                bpPort = null;
            }
        }
예제 #3
0
        private void Connect_Click(object sender, EventArgs e)
        {
            if (bpPort == null)
            {
                if (ComPort.SelectedIndex >= 0)
                {
                    string port = ComPort.SelectedItem as string;
                    bpPort = new BPPort(port);
                    bpPort.WaitResponse += new BPPort.WaitResponseEventHandle(bpPort_WaitResponse);
                    bpPort.RecieveData += new BPPort.RecieveDataEventHandle(bpPort_RecieveData);
                    bpPort.SendStarted += new BPPort.SendStartedEventHandle(bpPort_SendStarted);
                    bpPort.SendEnded += new BPPort.SendEndedEventHandle(bpPort_SendEnded);
                    try
                    {
                        if (bpPort.Connect() == BP_RESPONSE.OK)
                        {
                            Connect.Text = "F8 - Disconnect";
                            groupCommand.Enabled = groupMode.Enabled = true;
                            Mode.SelectedIndex = ((int)bpPort.Mode) - 1;
                            StatusText(bpPort.FirmwareVersion);
                            if (bpPort.Info() == BP_RESPONSE.OK)
                                DisplayPins();

                            TimerStart();
                            return;
                        }
                        else
                        {
                            StatusText("BusPirate not found");
                        }
                    }
                    catch (Exception ex)
                    {
                        LogError(ex.Message);
                    }
                }
            }
            else
            {
                timer.Stop();
                Connect.Text = "F8 - Connect";
                groupCommand.Enabled = groupMode.Enabled = false;
                bpPort.Disconnect();
                bpPort = null;
            }
        }