using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO.Ports;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using QC.QMSLPhone;

namespace QCRPG.Framework;

public class OpenConnectionMultipleTypesForm : Form, IConfigurable
{
	public enum ConnectionType
	{
		UNKNOWN,
		SERIAL,
		USB,
		DIAG,
		TCP,
		MAXIMUM
	}

	private const int defaultDataRate = 115200;

	private List<ConnectionType> supportedConnectionTypes = new List<ConnectionType>();

	private ConnectionType selectedConnectionType = ConnectionType.SERIAL;

	private bool enableHciInit;

	private bool enableInitAt115k;

	private Dictionary<ConnectionType, TabPage> connectionTypeToTabPageMap = new Dictionary<ConnectionType, TabPage>();

	private Dictionary<TabPage, ConnectionType> tabPageToConnectionTypeMap = new Dictionary<TabPage, ConnectionType>();

	private bool serialShowSlaveAddress;

	private byte serialSlaveAddress;

	private string serialSelectedPortName = "";

	private bool serialSetDisplayedPortNamesExternally;

	private List<string> serialDisplayedPortNameList = new List<string>();

	private int serialSelectedDataRate;

	private int serialSelectedInitialDataRate;

	private bool sharedConnectionEnabled;

	private List<int> serialDisplayedDataRateList = new List<int>();

	private List<string> flowControlList = new List<string>();

	private string serialSelectedFlowControl = "None";

	private Handshake serialSelectedHandShake;

	private string usbSelectedDeviceInfoPath = "";

	private UsbDeviceInfo usbSelectedDeviceInfo;

	private List<UsbDeviceInfo> usbDisplayedDeviceList = new List<UsbDeviceInfo>();

	private string tcpSelectedIPAddress = "";

	private string tcpSelectedPortNumber = "";

	private bool tcpSelectedWillsAndDos;

	private bool tcpSelectedAddProtocolByte;

	private string diagSelectedPortName = "";

	private List<string> diagLibraryModeList = new List<string> { "QMSL Internal", "QPST" };

	private string diagSelectedLibraryModeName = "QMSL Internal";

	private LibraryModeEnum diagSelectedLibraryMode;

	private List<string> diagTargetTypeList = new List<string> { "MSM/MDM", "APQ" };

	private string diagSelectedTargetTypeName = "MSM/MDM";

	private Phone.TargetType diagSelectedTargetType;

	private List<string> diagTypeList = new List<string> { "FULL", "QDL" };

	private string diagSelectedDiagTypeName = "FULL";

	private Phone.DiagType diagSelectedDiagType;

	private IContainer components;

	private TabControl tabControl;

	private TabPage tabPageSerial;

	private TabPage tabPageUsb;

	private TabPage tabPageDiag;

	private ComboBox comboBoxSerialDataRate;

	private ComboBox comboBoxSerialPortNames;

	private TextBox textBoxSerialSlaveAddress;

	private Label labelSerialPortName;

	private Label labelSerialDataRate;

	private Label labelSerialSlaveAddress;

	private Button buttonCancel;

	private Button buttonOK;

	private ComboBox comboBoxUsbDevices;

	private Label labelUsbDevice;

	private StatusStrip statusStrip;

	private ToolStripStatusLabel toolStripStatusLabel;

	private ComboBox comboBoxFlowControl;

	private Label labelFlowControl;

	private Label labelInitAt115k;

	private CheckBox checkBoxInitAt115k;

	private CheckBox checkBoxSharedPort;

	private ComboBox comboBoxDiagPortNames;

	private ComboBox comboBoxDiagLibraryMode;

	private ComboBox comboBoxDiagTargetType;

	private ComboBox comboBoxDiagType;

	private Label labelDiagPortName;

	private Label labelDiagLibraryMode;

	private Label labelDiagTargetType;

	private Label labelDiagType;

	private TabPage tabPageTCP;

	private TextBox tbTCPPortNumber;

	private TextBox tbTCPIPAddress;

	private Label label2;

	private Label label1;

	private Label labelInitialBaudRate;

	private ComboBox comboBoxSerialInitialDataRate;

	private CheckBox checkBoxSerialHciInit;

	private Label labelSerialHciInit;

	private CheckBox cbAddProtocolByte;

	private CheckBox cbTelnetWillsAndDos;

	private LinkLabel SerialPortSettingsLinkLabel;

	public string Title
	{
		get
		{
			return Text;
		}
		set
		{
			Text = value;
		}
	}

	public List<ConnectionType> SupportedConnectionTypes
	{
		get
		{
			return supportedConnectionTypes;
		}
		set
		{
			supportedConnectionTypes = value;
		}
	}

	public ConnectionType SelectedConnectionType
	{
		get
		{
			return selectedConnectionType;
		}
		set
		{
			selectedConnectionType = value;
		}
	}

	public bool EnableHciInit => checkBoxSerialHciInit.Checked;

	public bool EnableInitAt115k => checkBoxInitAt115k.Checked;

	public bool UIEnableInitAt115k
	{
		set
		{
			labelInitAt115k.Visible = value;
			checkBoxInitAt115k.Visible = value;
			labelSerialHciInit.Visible = value;
			checkBoxSerialHciInit.Visible = value;
		}
	}

	public bool SerialShowSlaveAddress
	{
		get
		{
			return serialShowSlaveAddress;
		}
		set
		{
			serialShowSlaveAddress = value;
		}
	}

	public byte SerialSlaveAddress
	{
		get
		{
			return serialSlaveAddress;
		}
		set
		{
			serialSlaveAddress = value;
		}
	}

	public string SerialSelectedPortName
	{
		get
		{
			return serialSelectedPortName;
		}
		set
		{
			serialSelectedPortName = value;
		}
	}

	public List<string> SerialDisplayedPortNameList
	{
		set
		{
			serialDisplayedPortNameList = value;
			serialSetDisplayedPortNamesExternally = true;
		}
	}

	public int SerialSelectedDataRate
	{
		get
		{
			return serialSelectedDataRate;
		}
		set
		{
			serialSelectedDataRate = value;
		}
	}

	public int SerialSelectedInitialDataRate
	{
		get
		{
			return serialSelectedInitialDataRate;
		}
		set
		{
			serialSelectedInitialDataRate = value;
		}
	}

	public bool SharedConnectionEnabled
	{
		get
		{
			return sharedConnectionEnabled;
		}
		set
		{
			sharedConnectionEnabled = value;
		}
	}

	public List<int> SerialDisplayedDataRateList
	{
		set
		{
			serialDisplayedDataRateList = value;
		}
	}

	public List<string> SerialFlowControlList
	{
		get
		{
			return flowControlList;
		}
		set
		{
			flowControlList = value;
		}
	}

	public Handshake SerialSelectedHandShake
	{
		get
		{
			return serialSelectedHandShake;
		}
		set
		{
			serialSelectedHandShake = value;
		}
	}

	public UsbDeviceInfo UsbSelectedDeviceInfo
	{
		get
		{
			return usbSelectedDeviceInfo;
		}
		set
		{
			usbSelectedDeviceInfo = value;
		}
	}

	public List<UsbDeviceInfo> UsbDisplayedDeviceList
	{
		set
		{
			usbDisplayedDeviceList = value;
		}
	}

	public string TCPSelectedIPAddress
	{
		get
		{
			return tcpSelectedIPAddress;
		}
		set
		{
			tcpSelectedIPAddress = value;
		}
	}

	public string TCPSelectedPortNumber
	{
		get
		{
			return tcpSelectedPortNumber;
		}
		set
		{
			tcpSelectedPortNumber = value;
		}
	}

	public bool TCPSelectedWillsAndDos
	{
		get
		{
			return tcpSelectedWillsAndDos;
		}
		set
		{
			tcpSelectedWillsAndDos = value;
		}
	}

	public bool TCPSelectedAddProtocolByte
	{
		get
		{
			return tcpSelectedAddProtocolByte;
		}
		set
		{
			tcpSelectedAddProtocolByte = value;
		}
	}

	public string DiagSelectedPortName
	{
		get
		{
			return diagSelectedPortName;
		}
		set
		{
			diagSelectedPortName = value;
		}
	}

	public List<string> DiagLibraryModeList => diagLibraryModeList;

	public LibraryModeEnum DiagSelectedLibraryMode
	{
		get
		{
			return diagSelectedLibraryMode;
		}
		set
		{
			diagSelectedLibraryMode = value;
		}
	}

	public List<string> DiagTargetTypeList => diagTargetTypeList;

	public Phone.TargetType DiagSelectedTargetType
	{
		get
		{
			return diagSelectedTargetType;
		}
		set
		{
			diagSelectedTargetType = value;
		}
	}

	public List<string> DiagTypeList => diagTypeList;

	public Phone.DiagType DiagSelectedDiagType
	{
		get
		{
			return diagSelectedDiagType;
		}
		set
		{
			diagSelectedDiagType = value;
		}
	}

	[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
	public static extern int StrCmpLogicalW(string psz1, string psz2);

	public OpenConnectionMultipleTypesForm()
	{
		InitializeComponent();
		Title = "Open Connection";
		connectionTypeToTabPageMap.Add(ConnectionType.SERIAL, tabPageSerial);
		connectionTypeToTabPageMap.Add(ConnectionType.USB, tabPageUsb);
		connectionTypeToTabPageMap.Add(ConnectionType.DIAG, tabPageDiag);
		connectionTypeToTabPageMap.Add(ConnectionType.TCP, tabPageTCP);
		tabPageToConnectionTypeMap.Add(tabPageSerial, ConnectionType.SERIAL);
		tabPageToConnectionTypeMap.Add(tabPageUsb, ConnectionType.USB);
		tabPageToConnectionTypeMap.Add(tabPageDiag, ConnectionType.DIAG);
		tabPageToConnectionTypeMap.Add(tabPageTCP, ConnectionType.TCP);
		UIEnableInitAt115k = false;
	}

	public Configuration GetConfiguration()
	{
		Configuration configuration = new Configuration();
		configuration.SetInt("SelectedConnectionType", (int)selectedConnectionType);
		configuration.SetByte("SerialSlaveAddress", serialSlaveAddress);
		configuration.SetString("SerialSelectedPortName", serialSelectedPortName);
		configuration.SetInt("SerialDataRate", serialSelectedDataRate);
		configuration.SetInt("SerialHciInitialDataRate", serialSelectedInitialDataRate);
		configuration.SetString("SerialSelectedHandShake", serialSelectedFlowControl);
		configuration.SetString("UsbSelectedDeviceInfoPath", usbSelectedDeviceInfoPath);
		configuration.SetString("DiagSelectedPortName", diagSelectedPortName);
		configuration.SetString("DiagSelectedLibraryMode", diagSelectedLibraryModeName);
		configuration.SetString("DiagSelectedTargetType", diagSelectedTargetTypeName);
		configuration.SetString("DiagSelectedDiagType", diagSelectedDiagTypeName);
		configuration.SetString("TCPSelectedIPAddress", tcpSelectedIPAddress);
		configuration.SetString("TCPSelectedPortNumber", tcpSelectedPortNumber);
		configuration.SetBool("TCPSelectedWillsAndDos", tcpSelectedWillsAndDos);
		configuration.SetBool("TCPSelectedAddProtocolByte", tcpSelectedAddProtocolByte);
		return configuration;
	}

	public void SetConfiguration(Configuration configuration)
	{
		int num = configuration.GetInt("SelectedConnectionType", 1);
		if (num <= 0 || num >= 5)
		{
			num = 1;
		}
		selectedConnectionType = (ConnectionType)num;
		serialSlaveAddress = configuration.GetByte("SerialSlaveAddress", 0);
		serialSelectedPortName = configuration.GetString("SerialSelectedPortName", "COM1");
		serialSelectedDataRate = configuration.GetInt("SerialDataRate", 115200);
		serialSelectedInitialDataRate = configuration.GetInt("SerialHciInitialDataRate", 115200);
		serialSelectedFlowControl = configuration.GetString("SerialSelectedHandShake", "None");
		usbSelectedDeviceInfoPath = configuration.GetString("UsbSelectedDeviceInfoPath", "");
		diagSelectedPortName = configuration.GetString("DiagSelectedPortName", "COM1");
		diagSelectedLibraryModeName = configuration.GetString("DiagSelectedLibraryMode", "QMSL Internal");
		diagSelectedTargetTypeName = configuration.GetString("DiagSelectedTargetType", "MSM/MDM");
		diagSelectedDiagTypeName = configuration.GetString("DiagSelectedDiagType", "FULL");
		tcpSelectedIPAddress = configuration.GetString("TCPSelectedIPAddress", "ENTER IP ADDRESS");
		tcpSelectedPortNumber = configuration.GetString("TCPSelectedPortNumber", "5001");
		tcpSelectedWillsAndDos = configuration.GetBool("TCPSelectedWillsAndDos", defaultValue: false);
		tcpSelectedAddProtocolByte = configuration.GetBool("TCPSelectedAddProtocolByte", defaultValue: false);
	}

	private void OpenConnectionMultipleTypesForm_Load(object sender, EventArgs e)
	{
		tabControl.TabPages.Clear();
		foreach (ConnectionType supportedConnectionType in supportedConnectionTypes)
		{
			tabControl.TabPages.Add(connectionTypeToTabPageMap[supportedConnectionType]);
		}
		try
		{
			tabControl.SelectedTab = connectionTypeToTabPageMap[selectedConnectionType];
		}
		catch (KeyNotFoundException)
		{
		}
		toolStripStatusLabel.Text = "";
		toolStripStatusLabel.ForeColor = Color.Red;
		if (!serialShowSlaveAddress)
		{
			labelSerialSlaveAddress.Visible = false;
			textBoxSerialSlaveAddress.Visible = false;
		}
		textBoxSerialSlaveAddress.Text = serialSlaveAddress.ToString("X2");
		if (serialDisplayedPortNameList == null || serialDisplayedPortNameList.Count == 0 || !serialSetDisplayedPortNamesExternally)
		{
			serialDisplayedPortNameList = new List<string>(SerialPort.GetPortNames());
			serialDisplayedPortNameList.Sort(StrCmpLogicalW);
		}
		comboBoxSerialPortNames.Items.Clear();
		foreach (string serialDisplayedPortName in serialDisplayedPortNameList)
		{
			comboBoxSerialPortNames.Items.Add(serialDisplayedPortName);
		}
		comboBoxSerialPortNames.SelectedItem = serialSelectedPortName;
		if (serialDisplayedDataRateList == null || serialDisplayedDataRateList.Count == 0)
		{
			serialDisplayedDataRateList = new List<int> { 300, 1200, 2400, 4800, 9600, 19200, 34800, 57600, 115200 };
		}
		comboBoxSerialDataRate.Items.Clear();
		foreach (int serialDisplayedDataRate in serialDisplayedDataRateList)
		{
			comboBoxSerialDataRate.Items.Add(serialDisplayedDataRate);
		}
		comboBoxSerialDataRate.SelectedText = serialSelectedDataRate.ToString();
		comboBoxFlowControl.Items.Clear();
		if (SerialFlowControlList == null || SerialFlowControlList.Count == 0)
		{
			SerialFlowControlList = new List<string> { "None", "Hardware", "XOnXOff", "HardwareXOnXOff" };
		}
		foreach (string serialFlowControl in SerialFlowControlList)
		{
			comboBoxFlowControl.Items.Add(serialFlowControl);
		}
		comboBoxFlowControl.SelectedText = serialSelectedFlowControl;
		comboBoxSerialInitialDataRate.Items.Clear();
		foreach (int serialDisplayedDataRate2 in serialDisplayedDataRateList)
		{
			comboBoxSerialInitialDataRate.Items.Add(serialDisplayedDataRate2);
		}
		comboBoxSerialInitialDataRate.Text = serialSelectedInitialDataRate.ToString();
		comboBoxUsbDevices.Items.Clear();
		foreach (UsbDeviceInfo usbDisplayedDevice in usbDisplayedDeviceList)
		{
			comboBoxUsbDevices.Items.Add(usbDisplayedDevice);
			if (usbDisplayedDevice.path == usbSelectedDeviceInfoPath)
			{
				comboBoxUsbDevices.SelectedItem = usbDisplayedDevice;
			}
		}
		comboBoxDiagPortNames.Items.Clear();
		foreach (string serialDisplayedPortName2 in serialDisplayedPortNameList)
		{
			comboBoxDiagPortNames.Items.Add(serialDisplayedPortName2);
		}
		comboBoxDiagPortNames.SelectedItem = diagSelectedPortName;
		comboBoxDiagLibraryMode.Items.Clear();
		foreach (string diagLibraryMode in diagLibraryModeList)
		{
			comboBoxDiagLibraryMode.Items.Add(diagLibraryMode);
		}
		comboBoxDiagLibraryMode.SelectedItem = diagSelectedLibraryModeName;
		comboBoxDiagTargetType.Items.Clear();
		foreach (string diagTargetType in diagTargetTypeList)
		{
			comboBoxDiagTargetType.Items.Add(diagTargetType);
		}
		comboBoxDiagTargetType.SelectedItem = diagSelectedTargetTypeName;
		comboBoxDiagType.Items.Clear();
		foreach (string diagType in diagTypeList)
		{
			comboBoxDiagType.Items.Add(diagType);
		}
		comboBoxDiagType.SelectedItem = diagSelectedDiagTypeName;
		tbTCPIPAddress.Text = TCPSelectedIPAddress;
		tbTCPPortNumber.Text = TCPSelectedPortNumber;
		cbAddProtocolByte.Checked = TCPSelectedAddProtocolByte;
		cbTelnetWillsAndDos.Checked = TCPSelectedWillsAndDos;
	}

	private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
	{
		if (tabControl.SelectedTab != null)
		{
			try
			{
				selectedConnectionType = tabPageToConnectionTypeMap[tabControl.SelectedTab];
			}
			catch (KeyNotFoundException)
			{
				selectedConnectionType = ConnectionType.UNKNOWN;
			}
			if (selectedConnectionType == ConnectionType.DIAG)
			{
				new Thread(IdentifyDiagPorts).Start();
			}
		}
	}

	private void buttonOK_Click(object sender, EventArgs e)
	{
		if (selectedConnectionType == ConnectionType.SERIAL)
		{
			buttonOK_Click_SerialTab();
			return;
		}
		if (selectedConnectionType == ConnectionType.USB)
		{
			buttonOK_Click_UsbTab();
			return;
		}
		if (selectedConnectionType == ConnectionType.DIAG)
		{
			buttonOK_Click_DiagTab();
			return;
		}
		if (selectedConnectionType == ConnectionType.TCP)
		{
			buttonOK_Click_TCPTab();
			return;
		}
		MessageBox.Show("Unsupported connection type selected: " + selectedConnectionType);
		base.DialogResult = DialogResult.Cancel;
		Close();
	}

	private void buttonOK_Click_SerialTab()
	{
		if (serialShowSlaveAddress)
		{
			try
			{
				serialSlaveAddress = Convert.ToByte(textBoxSerialSlaveAddress.Text, 16);
			}
			catch (Exception)
			{
				toolStripStatusLabel.Text = "Invalid slave address";
				return;
			}
		}
		try
		{
			serialSelectedPortName = comboBoxSerialPortNames.Text;
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Select a port name from the list";
			return;
		}
		if (string.IsNullOrWhiteSpace(serialSelectedPortName))
		{
			toolStripStatusLabel.Text = "Select a port name from the list";
			return;
		}
		try
		{
			serialSelectedDataRate = Convert.ToInt32(comboBoxSerialDataRate.Text);
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Invalid data rate";
			return;
		}
		if (comboBoxSerialInitialDataRate.Visible)
		{
			try
			{
				serialSelectedInitialDataRate = Convert.ToInt32(comboBoxSerialInitialDataRate.Text);
			}
			catch (Exception)
			{
				toolStripStatusLabel.Text = "Invalid initial data rate";
				return;
			}
		}
		try
		{
			serialSelectedFlowControl = comboBoxFlowControl.Text;
			serialSelectedHandShake = GetHandShakeFromString(comboBoxFlowControl.Text);
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Invalid handshake selection";
			return;
		}
		if (checkBoxSharedPort.CheckState == CheckState.Checked)
		{
			sharedConnectionEnabled = true;
		}
		else
		{
			sharedConnectionEnabled = false;
		}
		base.DialogResult = DialogResult.OK;
		Close();
	}

	public Handshake GetHandShakeFromString(string value)
	{
		string value2 = value.Replace("Hardware", "RequestToSend");
		return (Handshake)Enum.Parse(typeof(Handshake), value2);
	}

	private void buttonOK_Click_UsbTab()
	{
		if (comboBoxUsbDevices.SelectedItem == null)
		{
			toolStripStatusLabel.Text = "Select a device from the list";
			return;
		}
		usbSelectedDeviceInfo = (UsbDeviceInfo)comboBoxUsbDevices.SelectedItem;
		usbSelectedDeviceInfoPath = usbSelectedDeviceInfo.path;
		base.DialogResult = DialogResult.OK;
		Close();
	}

	private void buttonOK_Click_DiagTab()
	{
		try
		{
			diagSelectedPortName = comboBoxDiagPortNames.Text;
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Select a port name from the list";
			return;
		}
		if (string.IsNullOrWhiteSpace(diagSelectedPortName))
		{
			toolStripStatusLabel.Text = "Select a port name from the list";
			return;
		}
		try
		{
			diagSelectedLibraryModeName = comboBoxDiagLibraryMode.Text;
			diagSelectedLibraryMode = GetLibraryModeFromString(diagSelectedLibraryModeName);
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Invalid library mode selection";
			return;
		}
		try
		{
			diagSelectedTargetTypeName = comboBoxDiagTargetType.Text;
			diagSelectedTargetType = GetTargetTypeFromString(diagSelectedTargetTypeName);
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Invalid target type selection";
			return;
		}
		try
		{
			diagSelectedDiagTypeName = comboBoxDiagType.Text;
			diagSelectedDiagType = GetDiagTypeFromString(diagSelectedDiagTypeName);
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Invalid diag type selection";
			return;
		}
		base.DialogResult = DialogResult.OK;
		Close();
	}

	private void buttonOK_Click_TCPTab()
	{
		sharedConnectionEnabled = false;
		try
		{
			TCPSelectedIPAddress = tbTCPIPAddress.Text;
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Select a port name from the list";
			return;
		}
		if (string.IsNullOrWhiteSpace(TCPSelectedIPAddress))
		{
			toolStripStatusLabel.Text = "Select a port name from the list";
			return;
		}
		try
		{
			TCPSelectedPortNumber = tbTCPPortNumber.Text;
		}
		catch (Exception)
		{
			toolStripStatusLabel.Text = "Invalid library mode selection";
			return;
		}
		TCPSelectedWillsAndDos = cbTelnetWillsAndDos.Checked;
		TCPSelectedAddProtocolByte = cbAddProtocolByte.Checked;
		base.DialogResult = DialogResult.OK;
		Close();
	}

	private LibraryModeEnum GetLibraryModeFromString(string value)
	{
		return (LibraryModeEnum)Enum.Parse(typeof(LibraryModeEnum), diagLibraryModeList.IndexOf(value).ToString());
	}

	private Phone.TargetType GetTargetTypeFromString(string value)
	{
		return (Phone.TargetType)Enum.Parse(typeof(Phone.TargetType), diagTargetTypeList.IndexOf(value).ToString());
	}

	private Phone.DiagType GetDiagTypeFromString(string value)
	{
		return (Phone.DiagType)Enum.Parse(typeof(Phone.DiagType), diagTypeList.IndexOf(value).ToString());
	}

	private void buttonCancel_Click(object sender, EventArgs e)
	{
		base.DialogResult = DialogResult.Cancel;
		Close();
	}

	private void checkBoxSharedPort_CheckedChanged(object sender, EventArgs e)
	{
		if (checkBoxSharedPort.CheckState == CheckState.Checked)
		{
			checkBoxInitAt115k.CheckState = CheckState.Unchecked;
			checkBoxInitAt115k.Enabled = false;
			checkBoxSerialHciInit.CheckState = CheckState.Unchecked;
			checkBoxSerialHciInit.Enabled = false;
		}
		else
		{
			checkBoxInitAt115k.Enabled = true;
			checkBoxSerialHciInit.Enabled = true;
		}
	}

	private void IdentifyDiagPorts()
	{
		diagSelectedLibraryMode = GetLibraryModeFromString(diagSelectedLibraryModeName);
		string[] portNames = ConnectionDiag.GetPortNames(diagSelectedLibraryMode, serialDisplayedPortNameList.Count);
		if (portNames != null)
		{
			comboBoxDiagPortNames.Items.Clear();
			string[] array = portNames;
			foreach (string item in array)
			{
				comboBoxDiagPortNames.Items.Add(item);
			}
		}
	}

	private void checkBoxSerialHciInit_CheckedChanged(object sender, EventArgs e)
	{
		if (checkBoxSerialHciInit.Checked && checkBoxInitAt115k.Checked)
		{
			checkBoxInitAt115k.Checked = false;
		}
		if (checkBoxSerialHciInit.Checked)
		{
			labelInitialBaudRate.Visible = true;
			comboBoxSerialInitialDataRate.Visible = true;
		}
		else
		{
			labelInitialBaudRate.Visible = false;
			comboBoxSerialInitialDataRate.Visible = false;
		}
	}

	private void checkBoxInitAt115k_CheckedChanged(object sender, EventArgs e)
	{
		if (checkBoxInitAt115k.Checked && checkBoxSerialHciInit.Checked)
		{
			checkBoxSerialHciInit.Checked = false;
		}
	}

	private void SerialPortSettingsLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
	{
		try
		{
			VisitLink();
		}
		catch (Exception)
		{
			MessageBox.Show("Unable to open link that was clicked.");
		}
	}

	private void VisitLink()
	{
		SerialPortSettingsLinkLabel.LinkVisited = true;
		Process.Start("http://qwiki.qualcomm.com/corp-te/Recommended_Serial_Port_Settings_for_QCRPG_in_case_of_Low_Throughput");
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.tabControl = new System.Windows.Forms.TabControl();
		this.tabPageSerial = new System.Windows.Forms.TabPage();
		this.checkBoxSerialHciInit = new System.Windows.Forms.CheckBox();
		this.labelSerialHciInit = new System.Windows.Forms.Label();
		this.comboBoxSerialInitialDataRate = new System.Windows.Forms.ComboBox();
		this.labelInitialBaudRate = new System.Windows.Forms.Label();
		this.checkBoxSharedPort = new System.Windows.Forms.CheckBox();
		this.labelInitAt115k = new System.Windows.Forms.Label();
		this.checkBoxInitAt115k = new System.Windows.Forms.CheckBox();
		this.comboBoxFlowControl = new System.Windows.Forms.ComboBox();
		this.comboBoxSerialDataRate = new System.Windows.Forms.ComboBox();
		this.comboBoxSerialPortNames = new System.Windows.Forms.ComboBox();
		this.textBoxSerialSlaveAddress = new System.Windows.Forms.TextBox();
		this.labelFlowControl = new System.Windows.Forms.Label();
		this.labelSerialPortName = new System.Windows.Forms.Label();
		this.labelSerialDataRate = new System.Windows.Forms.Label();
		this.labelSerialSlaveAddress = new System.Windows.Forms.Label();
		this.tabPageUsb = new System.Windows.Forms.TabPage();
		this.comboBoxUsbDevices = new System.Windows.Forms.ComboBox();
		this.labelUsbDevice = new System.Windows.Forms.Label();
		this.tabPageDiag = new System.Windows.Forms.TabPage();
		this.comboBoxDiagPortNames = new System.Windows.Forms.ComboBox();
		this.comboBoxDiagLibraryMode = new System.Windows.Forms.ComboBox();
		this.comboBoxDiagTargetType = new System.Windows.Forms.ComboBox();
		this.comboBoxDiagType = new System.Windows.Forms.ComboBox();
		this.labelDiagPortName = new System.Windows.Forms.Label();
		this.labelDiagLibraryMode = new System.Windows.Forms.Label();
		this.labelDiagTargetType = new System.Windows.Forms.Label();
		this.labelDiagType = new System.Windows.Forms.Label();
		this.tabPageTCP = new System.Windows.Forms.TabPage();
		this.cbAddProtocolByte = new System.Windows.Forms.CheckBox();
		this.cbTelnetWillsAndDos = new System.Windows.Forms.CheckBox();
		this.tbTCPPortNumber = new System.Windows.Forms.TextBox();
		this.tbTCPIPAddress = new System.Windows.Forms.TextBox();
		this.label2 = new System.Windows.Forms.Label();
		this.label1 = new System.Windows.Forms.Label();
		this.buttonCancel = new System.Windows.Forms.Button();
		this.buttonOK = new System.Windows.Forms.Button();
		this.statusStrip = new System.Windows.Forms.StatusStrip();
		this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
		this.SerialPortSettingsLinkLabel = new System.Windows.Forms.LinkLabel();
		this.tabControl.SuspendLayout();
		this.tabPageSerial.SuspendLayout();
		this.tabPageUsb.SuspendLayout();
		this.tabPageDiag.SuspendLayout();
		this.tabPageTCP.SuspendLayout();
		this.statusStrip.SuspendLayout();
		base.SuspendLayout();
		this.tabControl.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
		this.tabControl.Controls.Add(this.tabPageSerial);
		this.tabControl.Controls.Add(this.tabPageUsb);
		this.tabControl.Controls.Add(this.tabPageDiag);
		this.tabControl.Controls.Add(this.tabPageTCP);
		this.tabControl.Location = new System.Drawing.Point(0, 3);
		this.tabControl.Name = "tabControl";
		this.tabControl.SelectedIndex = 0;
		this.tabControl.Size = new System.Drawing.Size(308, 237);
		this.tabControl.TabIndex = 0;
		this.tabControl.SelectedIndexChanged += new System.EventHandler(tabControl_SelectedIndexChanged);
		this.tabPageSerial.Controls.Add(this.SerialPortSettingsLinkLabel);
		this.tabPageSerial.Controls.Add(this.checkBoxSerialHciInit);
		this.tabPageSerial.Controls.Add(this.labelSerialHciInit);
		this.tabPageSerial.Controls.Add(this.comboBoxSerialInitialDataRate);
		this.tabPageSerial.Controls.Add(this.labelInitialBaudRate);
		this.tabPageSerial.Controls.Add(this.checkBoxSharedPort);
		this.tabPageSerial.Controls.Add(this.labelInitAt115k);
		this.tabPageSerial.Controls.Add(this.checkBoxInitAt115k);
		this.tabPageSerial.Controls.Add(this.comboBoxFlowControl);
		this.tabPageSerial.Controls.Add(this.comboBoxSerialDataRate);
		this.tabPageSerial.Controls.Add(this.comboBoxSerialPortNames);
		this.tabPageSerial.Controls.Add(this.textBoxSerialSlaveAddress);
		this.tabPageSerial.Controls.Add(this.labelFlowControl);
		this.tabPageSerial.Controls.Add(this.labelSerialPortName);
		this.tabPageSerial.Controls.Add(this.labelSerialDataRate);
		this.tabPageSerial.Controls.Add(this.labelSerialSlaveAddress);
		this.tabPageSerial.Location = new System.Drawing.Point(4, 25);
		this.tabPageSerial.Name = "tabPageSerial";
		this.tabPageSerial.Padding = new System.Windows.Forms.Padding(3);
		this.tabPageSerial.Size = new System.Drawing.Size(300, 208);
		this.tabPageSerial.TabIndex = 0;
		this.tabPageSerial.Text = "Serial";
		this.tabPageSerial.UseVisualStyleBackColor = true;
		this.checkBoxSerialHciInit.AutoSize = true;
		this.checkBoxSerialHciInit.Location = new System.Drawing.Point(109, 146);
		this.checkBoxSerialHciInit.Name = "checkBoxSerialHciInit";
		this.checkBoxSerialHciInit.Size = new System.Drawing.Size(15, 14);
		this.checkBoxSerialHciInit.TabIndex = 11;
		this.checkBoxSerialHciInit.UseVisualStyleBackColor = true;
		this.checkBoxSerialHciInit.CheckedChanged += new System.EventHandler(checkBoxSerialHciInit_CheckedChanged);
		this.labelSerialHciInit.AutoSize = true;
		this.labelSerialHciInit.Location = new System.Drawing.Point(8, 146);
		this.labelSerialHciInit.Name = "labelSerialHciInit";
		this.labelSerialHciInit.Size = new System.Drawing.Size(42, 13);
		this.labelSerialHciInit.TabIndex = 10;
		this.labelSerialHciInit.Text = "HCI Init";
		this.comboBoxSerialInitialDataRate.FormattingEnabled = true;
		this.comboBoxSerialInitialDataRate.Location = new System.Drawing.Point(103, 166);
		this.comboBoxSerialInitialDataRate.Name = "comboBoxSerialInitialDataRate";
		this.comboBoxSerialInitialDataRate.Size = new System.Drawing.Size(121, 21);
		this.comboBoxSerialInitialDataRate.TabIndex = 9;
		this.comboBoxSerialInitialDataRate.Visible = false;
		this.labelInitialBaudRate.AutoSize = true;
		this.labelInitialBaudRate.Location = new System.Drawing.Point(8, 169);
		this.labelInitialBaudRate.Name = "labelInitialBaudRate";
		this.labelInitialBaudRate.Size = new System.Drawing.Size(83, 13);
		this.labelInitialBaudRate.TabIndex = 4;
		this.labelInitialBaudRate.Text = "Initial Data Rate";
		this.labelInitialBaudRate.Visible = false;
		this.checkBoxSharedPort.AutoSize = true;
		this.checkBoxSharedPort.Location = new System.Drawing.Point(180, 121);
		this.checkBoxSharedPort.Name = "checkBoxSharedPort";
		this.checkBoxSharedPort.Size = new System.Drawing.Size(117, 17);
		this.checkBoxSharedPort.TabIndex = 8;
		this.checkBoxSharedPort.Text = "Shared Connection";
		this.checkBoxSharedPort.UseVisualStyleBackColor = true;
		this.checkBoxSharedPort.CheckedChanged += new System.EventHandler(checkBoxSharedPort_CheckedChanged);
		this.labelInitAt115k.AutoSize = true;
		this.labelInitAt115k.Location = new System.Drawing.Point(8, 123);
		this.labelInitAt115k.Name = "labelInitAt115k";
		this.labelInitAt115k.Size = new System.Drawing.Size(95, 13);
		this.labelInitAt115k.TabIndex = 7;
		this.labelInitAt115k.Text = "Init @ 115k [NVM]";
		this.labelInitAt115k.Visible = false;
		this.checkBoxInitAt115k.AutoSize = true;
		this.checkBoxInitAt115k.Location = new System.Drawing.Point(109, 122);
		this.checkBoxInitAt115k.Name = "checkBoxInitAt115k";
		this.checkBoxInitAt115k.Size = new System.Drawing.Size(15, 14);
		this.checkBoxInitAt115k.TabIndex = 6;
		this.checkBoxInitAt115k.UseVisualStyleBackColor = true;
		this.checkBoxInitAt115k.Visible = false;
		this.checkBoxInitAt115k.CheckedChanged += new System.EventHandler(checkBoxInitAt115k_CheckedChanged);
		this.comboBoxFlowControl.FormattingEnabled = true;
		this.comboBoxFlowControl.Location = new System.Drawing.Point(103, 92);
		this.comboBoxFlowControl.Name = "comboBoxFlowControl";
		this.comboBoxFlowControl.Size = new System.Drawing.Size(121, 21);
		this.comboBoxFlowControl.TabIndex = 5;
		this.comboBoxSerialDataRate.FormattingEnabled = true;
		this.comboBoxSerialDataRate.Location = new System.Drawing.Point(103, 65);
		this.comboBoxSerialDataRate.Name = "comboBoxSerialDataRate";
		this.comboBoxSerialDataRate.Size = new System.Drawing.Size(121, 21);
		this.comboBoxSerialDataRate.TabIndex = 5;
		this.comboBoxSerialPortNames.FormattingEnabled = true;
		this.comboBoxSerialPortNames.Location = new System.Drawing.Point(103, 38);
		this.comboBoxSerialPortNames.Name = "comboBoxSerialPortNames";
		this.comboBoxSerialPortNames.Size = new System.Drawing.Size(121, 21);
		this.comboBoxSerialPortNames.TabIndex = 3;
		this.textBoxSerialSlaveAddress.Location = new System.Drawing.Point(103, 12);
		this.textBoxSerialSlaveAddress.Name = "textBoxSerialSlaveAddress";
		this.textBoxSerialSlaveAddress.Size = new System.Drawing.Size(50, 20);
		this.textBoxSerialSlaveAddress.TabIndex = 1;
		this.labelFlowControl.AutoSize = true;
		this.labelFlowControl.Location = new System.Drawing.Point(8, 95);
		this.labelFlowControl.Name = "labelFlowControl";
		this.labelFlowControl.Size = new System.Drawing.Size(65, 13);
		this.labelFlowControl.TabIndex = 4;
		this.labelFlowControl.Text = "&Flow Control";
		this.labelSerialPortName.AutoSize = true;
		this.labelSerialPortName.Location = new System.Drawing.Point(8, 41);
		this.labelSerialPortName.Name = "labelSerialPortName";
		this.labelSerialPortName.Size = new System.Drawing.Size(57, 13);
		this.labelSerialPortName.TabIndex = 2;
		this.labelSerialPortName.Text = "&Port Name";
		this.labelSerialDataRate.AutoSize = true;
		this.labelSerialDataRate.Location = new System.Drawing.Point(8, 68);
		this.labelSerialDataRate.Name = "labelSerialDataRate";
		this.labelSerialDataRate.Size = new System.Drawing.Size(56, 13);
		this.labelSerialDataRate.TabIndex = 4;
		this.labelSerialDataRate.Text = "Data &Rate";
		this.labelSerialSlaveAddress.AutoSize = true;
		this.labelSerialSlaveAddress.Location = new System.Drawing.Point(8, 15);
		this.labelSerialSlaveAddress.Name = "labelSerialSlaveAddress";
		this.labelSerialSlaveAddress.Size = new System.Drawing.Size(89, 13);
		this.labelSerialSlaveAddress.TabIndex = 0;
		this.labelSerialSlaveAddress.Text = "Slave &Address 0x";
		this.tabPageUsb.Controls.Add(this.comboBoxUsbDevices);
		this.tabPageUsb.Controls.Add(this.labelUsbDevice);
		this.tabPageUsb.Location = new System.Drawing.Point(4, 25);
		this.tabPageUsb.Name = "tabPageUsb";
		this.tabPageUsb.Padding = new System.Windows.Forms.Padding(3);
		this.tabPageUsb.Size = new System.Drawing.Size(300, 193);
		this.tabPageUsb.TabIndex = 1;
		this.tabPageUsb.Text = "USB";
		this.tabPageUsb.UseVisualStyleBackColor = true;
		this.comboBoxUsbDevices.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.comboBoxUsbDevices.FormattingEnabled = true;
		this.comboBoxUsbDevices.Location = new System.Drawing.Point(103, 38);
		this.comboBoxUsbDevices.Name = "comboBoxUsbDevices";
		this.comboBoxUsbDevices.Size = new System.Drawing.Size(179, 21);
		this.comboBoxUsbDevices.TabIndex = 1;
		this.labelUsbDevice.AutoSize = true;
		this.labelUsbDevice.Location = new System.Drawing.Point(8, 41);
		this.labelUsbDevice.Name = "labelUsbDevice";
		this.labelUsbDevice.Size = new System.Drawing.Size(66, 13);
		this.labelUsbDevice.TabIndex = 0;
		this.labelUsbDevice.Text = "USB &Device";
		this.tabPageDiag.Controls.Add(this.comboBoxDiagPortNames);
		this.tabPageDiag.Controls.Add(this.comboBoxDiagLibraryMode);
		this.tabPageDiag.Controls.Add(this.comboBoxDiagTargetType);
		this.tabPageDiag.Controls.Add(this.comboBoxDiagType);
		this.tabPageDiag.Controls.Add(this.labelDiagPortName);
		this.tabPageDiag.Controls.Add(this.labelDiagLibraryMode);
		this.tabPageDiag.Controls.Add(this.labelDiagTargetType);
		this.tabPageDiag.Controls.Add(this.labelDiagType);
		this.tabPageDiag.Location = new System.Drawing.Point(4, 25);
		this.tabPageDiag.Name = "tabPageDiag";
		this.tabPageDiag.Padding = new System.Windows.Forms.Padding(3);
		this.tabPageDiag.Size = new System.Drawing.Size(300, 193);
		this.tabPageDiag.TabIndex = 2;
		this.tabPageDiag.Text = "Diag";
		this.tabPageDiag.UseVisualStyleBackColor = true;
		this.comboBoxDiagPortNames.FormattingEnabled = true;
		this.comboBoxDiagPortNames.Location = new System.Drawing.Point(103, 38);
		this.comboBoxDiagPortNames.Name = "comboBoxDiagPortNames";
		this.comboBoxDiagPortNames.Size = new System.Drawing.Size(121, 21);
		this.comboBoxDiagPortNames.TabIndex = 1;
		this.comboBoxDiagLibraryMode.FormattingEnabled = true;
		this.comboBoxDiagLibraryMode.Location = new System.Drawing.Point(103, 65);
		this.comboBoxDiagLibraryMode.Name = "comboBoxDiagLibraryMode";
		this.comboBoxDiagLibraryMode.Size = new System.Drawing.Size(121, 21);
		this.comboBoxDiagLibraryMode.TabIndex = 3;
		this.comboBoxDiagTargetType.FormattingEnabled = true;
		this.comboBoxDiagTargetType.Location = new System.Drawing.Point(103, 92);
		this.comboBoxDiagTargetType.Name = "comboBoxDiagTargetType";
		this.comboBoxDiagTargetType.Size = new System.Drawing.Size(121, 21);
		this.comboBoxDiagTargetType.TabIndex = 5;
		this.comboBoxDiagType.FormattingEnabled = true;
		this.comboBoxDiagType.Location = new System.Drawing.Point(103, 119);
		this.comboBoxDiagType.Name = "comboBoxDiagType";
		this.comboBoxDiagType.Size = new System.Drawing.Size(121, 21);
		this.comboBoxDiagType.TabIndex = 7;
		this.labelDiagPortName.AutoSize = true;
		this.labelDiagPortName.Location = new System.Drawing.Point(8, 41);
		this.labelDiagPortName.Name = "labelDiagPortName";
		this.labelDiagPortName.Size = new System.Drawing.Size(57, 13);
		this.labelDiagPortName.TabIndex = 0;
		this.labelDiagPortName.Text = "&Port Name";
		this.labelDiagLibraryMode.AutoSize = true;
		this.labelDiagLibraryMode.Location = new System.Drawing.Point(8, 68);
		this.labelDiagLibraryMode.Name = "labelDiagLibraryMode";
		this.labelDiagLibraryMode.Size = new System.Drawing.Size(68, 13);
		this.labelDiagLibraryMode.TabIndex = 2;
		this.labelDiagLibraryMode.Text = "Library &Mode";
		this.labelDiagTargetType.AutoSize = true;
		this.labelDiagTargetType.Location = new System.Drawing.Point(8, 95);
		this.labelDiagTargetType.Name = "labelDiagTargetType";
		this.labelDiagTargetType.Size = new System.Drawing.Size(65, 13);
		this.labelDiagTargetType.TabIndex = 4;
		this.labelDiagTargetType.Text = "&Target Type";
		this.labelDiagType.AutoSize = true;
		this.labelDiagType.Location = new System.Drawing.Point(8, 122);
		this.labelDiagType.Name = "labelDiagType";
		this.labelDiagType.Size = new System.Drawing.Size(56, 13);
		this.labelDiagType.TabIndex = 8;
		this.labelDiagType.Text = "&Diag Type";
		this.tabPageTCP.Controls.Add(this.cbAddProtocolByte);
		this.tabPageTCP.Controls.Add(this.cbTelnetWillsAndDos);
		this.tabPageTCP.Controls.Add(this.tbTCPPortNumber);
		this.tabPageTCP.Controls.Add(this.tbTCPIPAddress);
		this.tabPageTCP.Controls.Add(this.label2);
		this.tabPageTCP.Controls.Add(this.label1);
		this.tabPageTCP.Location = new System.Drawing.Point(4, 25);
		this.tabPageTCP.Name = "tabPageTCP";
		this.tabPageTCP.Size = new System.Drawing.Size(300, 193);
		this.tabPageTCP.TabIndex = 3;
		this.tabPageTCP.Text = "TCP";
		this.tabPageTCP.UseVisualStyleBackColor = true;
		this.cbAddProtocolByte.AutoSize = true;
		this.cbAddProtocolByte.Location = new System.Drawing.Point(11, 95);
		this.cbAddProtocolByte.Name = "cbAddProtocolByte";
		this.cbAddProtocolByte.Size = new System.Drawing.Size(111, 17);
		this.cbAddProtocolByte.TabIndex = 7;
		this.cbAddProtocolByte.Text = "Add Protocol Byte";
		this.cbAddProtocolByte.UseVisualStyleBackColor = true;
		this.cbTelnetWillsAndDos.AutoSize = true;
		this.cbTelnetWillsAndDos.Location = new System.Drawing.Point(11, 127);
		this.cbTelnetWillsAndDos.Name = "cbTelnetWillsAndDos";
		this.cbTelnetWillsAndDos.Size = new System.Drawing.Size(243, 17);
		this.cbTelnetWillsAndDos.TabIndex = 6;
		this.cbTelnetWillsAndDos.Text = "Init Telnet Wills and Dos (Firmware Simulation)";
		this.cbTelnetWillsAndDos.UseVisualStyleBackColor = true;
		this.tbTCPPortNumber.Location = new System.Drawing.Point(115, 58);
		this.tbTCPPortNumber.Name = "tbTCPPortNumber";
		this.tbTCPPortNumber.Size = new System.Drawing.Size(125, 20);
		this.tbTCPPortNumber.TabIndex = 3;
		this.tbTCPPortNumber.Text = "5001";
		this.tbTCPIPAddress.Location = new System.Drawing.Point(115, 24);
		this.tbTCPIPAddress.Name = "tbTCPIPAddress";
		this.tbTCPIPAddress.Size = new System.Drawing.Size(125, 20);
		this.tbTCPIPAddress.TabIndex = 2;
		this.tbTCPIPAddress.Text = "192.168.1.1";
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(8, 58);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(66, 13);
		this.label2.TabIndex = 1;
		this.label2.Text = "Port Number";
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(8, 24);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(58, 13);
		this.label1.TabIndex = 0;
		this.label1.Text = "IP Address";
		this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
		this.buttonCancel.Location = new System.Drawing.Point(153, 246);
		this.buttonCancel.Name = "buttonCancel";
		this.buttonCancel.Size = new System.Drawing.Size(75, 23);
		this.buttonCancel.TabIndex = 2;
		this.buttonCancel.Text = "Cancel";
		this.buttonCancel.UseVisualStyleBackColor = true;
		this.buttonCancel.Click += new System.EventHandler(buttonCancel_Click);
		this.buttonOK.Location = new System.Drawing.Point(72, 246);
		this.buttonOK.Name = "buttonOK";
		this.buttonOK.Size = new System.Drawing.Size(75, 23);
		this.buttonOK.TabIndex = 1;
		this.buttonOK.Text = "OK";
		this.buttonOK.UseVisualStyleBackColor = true;
		this.buttonOK.Click += new System.EventHandler(buttonOK_Click);
		this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[1] { this.toolStripStatusLabel });
		this.statusStrip.Location = new System.Drawing.Point(0, 272);
		this.statusStrip.Name = "statusStrip";
		this.statusStrip.Size = new System.Drawing.Size(317, 22);
		this.statusStrip.TabIndex = 3;
		this.statusStrip.Text = "statusStrip1";
		this.toolStripStatusLabel.Name = "toolStripStatusLabel";
		this.toolStripStatusLabel.Size = new System.Drawing.Size(0, 17);
		this.SerialPortSettingsLinkLabel.AutoSize = true;
		this.SerialPortSettingsLinkLabel.Location = new System.Drawing.Point(126, 192);
		this.SerialPortSettingsLinkLabel.Name = "SerialPortSettingsLinkLabel";
		this.SerialPortSettingsLinkLabel.Size = new System.Drawing.Size(171, 13);
		this.SerialPortSettingsLinkLabel.TabIndex = 12;
		this.SerialPortSettingsLinkLabel.TabStop = true;
		this.SerialPortSettingsLinkLabel.Text = "Recommended Serial Port Settings";
		this.SerialPortSettingsLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(SerialPortSettingsLinkLabel_LinkClicked);
		base.AcceptButton = this.buttonOK;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.CancelButton = this.buttonCancel;
		base.ClientSize = new System.Drawing.Size(317, 294);
		base.Controls.Add(this.buttonCancel);
		base.Controls.Add(this.statusStrip);
		base.Controls.Add(this.buttonOK);
		base.Controls.Add(this.tabControl);
		base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
		base.MaximizeBox = false;
		base.MinimizeBox = false;
		base.Name = "OpenConnectionMultipleTypesForm";
		base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
		this.Text = "Open Connection";
		base.Load += new System.EventHandler(OpenConnectionMultipleTypesForm_Load);
		this.tabControl.ResumeLayout(false);
		this.tabPageSerial.ResumeLayout(false);
		this.tabPageSerial.PerformLayout();
		this.tabPageUsb.ResumeLayout(false);
		this.tabPageUsb.PerformLayout();
		this.tabPageDiag.ResumeLayout(false);
		this.tabPageDiag.PerformLayout();
		this.tabPageTCP.ResumeLayout(false);
		this.tabPageTCP.PerformLayout();
		this.statusStrip.ResumeLayout(false);
		this.statusStrip.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
