using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO.Ports;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using QC.QMSLPhone;

namespace BluetoothLE_DirectMode;

public class BluetoothLEDirectMode : Form
{
	public delegate void UpdateShellRichTB(string text);

	private Phone phone = new Phone();

	private StringBuilder displayText = new StringBuilder(4096);

	private List<ushort> logCodes = new List<ushort>();

	private static int logNumber;

	private IContainer components;

	private GroupBox connectionGB;

	private Button buttonEnableDisable;

	private GroupBox testerSettingsGB;

	private Label labelHandshake;

	private Label labelComPort;

	private ComboBox handshakeCB;

	private ComboBox testerCOMPortCB;

	private GroupBox dutGB;

	private Label targetTypeLabel;

	private ComboBox targetTypeCB;

	private GroupBox loggingGB;

	private Button buttonClearLogs;

	private Button buttonSaveLogs;

	private RichTextBox loggingRichTextBox;

	private StatusStrip statusStripDUTPort;

	private System.Windows.Forms.Timer timerForBTEventLogs;

	private SerialPort TesterSerialPort;

	private ToolStripStatusLabel toolStripStatusLabel1;

	private SaveFileDialog logSaveFileDialog;

	private TextBox textBoxBaudRate;

	private Label label1;

	private CheckBox cbWCN2243Legacy;

	private CheckBox disableQPST;

	private TextBox textBoxCOMQDL;

	private Label label2;

	public BluetoothLEDirectMode()
	{
		InitializeComponent();
		handshakeCB.Items.AddRange(Enum.GetNames(typeof(Handshake)));
		handshakeCB.SelectedItem = Handshake.RequestToSend.ToString();
	}

	private ushort getLogCode()
	{
		if (cbWCN2243Legacy.Checked)
		{
			return 4476;
		}
		return 4966;
	}

	private void writeLine(string line)
	{
		displayText = new StringBuilder(255);
		displayText.Append(line + "\r\n");
		loggingRichTextBox.Text += displayText.ToString();
		loggingRichTextBox.Select(loggingRichTextBox.Text.Length, 0);
		loggingRichTextBox.ScrollToCaret();
	}

	private void timerForBTEventLogs_Tick(object sender, EventArgs e)
	{
		try
		{
			foreach (ushort logCode in logCodes)
			{
				byte[] array = null;
				if (!phone.getLogMessage(out var msg, logCode, 0))
				{
					continue;
				}
				byte[] message = msg.message;
				array = (cbWCN2243Legacy.Checked ? new byte[message.Length - 18] : ((!disableQPST.Checked || targetTypeCB.SelectedItem.ToString().Equals("QDL")) ? new byte[message.Length - 15] : new byte[message.Length - 15 - 2]));
				array[0] = 4;
				for (int i = 0; i < array.Length - 1; i++)
				{
					if (cbWCN2243Legacy.Checked)
					{
						array[i + 1] = message[19 + i];
					}
					else
					{
						array[i + 1] = message[16 + i];
					}
				}
				if (TesterSerialPort.IsOpen)
				{
					TesterSerialPort.Write(array, 0, array.Length);
				}
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(logNumber.ToString());
				stringBuilder.Append("  " + DateTime.Now.TimeOfDay.ToString() + " ");
				logNumber++;
				string text = msg.msgID.ToString("x");
				stringBuilder.Append("HCI_Event(" + text + "):");
				byte[] array2 = array;
				foreach (byte b in array2)
				{
					stringBuilder.AppendFormat("0x{0:x2} , ", b);
				}
				writeLine(stringBuilder.ToString());
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show("Error : " + ex.Message);
		}
	}

	private void buttonEnableDisable_Click(object sender, EventArgs e)
	{
		try
		{
			if (buttonEnableDisable.Text == "Enable")
			{
				buttonEnableDisable.Enabled = false;
				string s = "";
				if (disableQPST.Checked)
				{
					s = textBoxCOMQDL.Text.ToString();
					if (s.Length <= 3)
					{
						throw new SystemException($"Invalid comport number details {s}, example COM29");
					}
					s = s.Substring(3, s.Length - 3);
				}
				Phone.TargetType targetType = Phone.TargetType.QLIB_TARGET_TYPE_MSM_MDM;
				Phone.DiagType diagType = Phone.DiagType.QLIB_DIAG_TYPE_STANDARD;
				if (targetTypeCB.SelectedItem.ToString() == "MSM/MDM")
				{
					targetType = Phone.TargetType.QLIB_TARGET_TYPE_MSM_MDM;
					diagType = Phone.DiagType.QLIB_DIAG_TYPE_STANDARD;
				}
				else if (targetTypeCB.SelectedItem.ToString() == "APQ")
				{
					targetType = Phone.TargetType.QLIB_TARGET_TYPE_APQ;
					diagType = Phone.DiagType.QLIB_DIAG_TYPE_STANDARD;
				}
				else
				{
					if (!(targetTypeCB.SelectedItem.ToString() == "QDL"))
					{
						throw new SystemException("Invalid target type");
					}
					targetType = Phone.TargetType.QLIB_TARGET_TYPE_APQ;
					diagType = Phone.DiagType.QLIB_DIAG_TYPE_LITE;
				}
				if (disableQPST.Checked)
				{
					phone.ConnectToServer(int.Parse(s), targetType, diagType);
				}
				else
				{
					phone.ConnectToServer(65535, targetType, diagType);
				}
				if (!phone.IsPhoneConnected())
				{
					throw new SystemException("Failed to connect to the DUT");
				}
				toolStripStatusLabel1.Text = "DUT Connected COM: " + phone.GetPhoneComPort();
				timerForBTEventLogs.Enabled = true;
				phone.configLogging(getLogCode(), OnOff: true);
				logCodes.Add(getLogCode());
				if (testerCOMPortCB.SelectedItem == null || testerCOMPortCB.SelectedItem.ToString().Length == 0)
				{
					MessageBox.Show("Tester COM port cannot be empty");
					buttonEnableDisable.Enabled = true;
					return;
				}
				if (textBoxBaudRate.Text.Length == 0)
				{
					MessageBox.Show("Tester baudrate is invalid");
					buttonEnableDisable.Enabled = true;
					return;
				}
				TesterSerialPort.BaudRate = int.Parse(textBoxBaudRate.Text);
				TesterSerialPort.PortName = testerCOMPortCB.SelectedItem.ToString();
				TesterSerialPort.DtrEnable = true;
				TesterSerialPort.Encoding = Encoding.GetEncoding(1252);
				TesterSerialPort.Handshake = (Handshake)Enum.Parse(typeof(Handshake), handshakeCB.SelectedItem.ToString());
				TesterSerialPort.Open();
				buttonEnableDisable.Text = "Disable";
				buttonEnableDisable.Enabled = true;
			}
			else if (buttonEnableDisable.Text == "Disable")
			{
				buttonEnableDisable.Enabled = false;
				ShutDown();
			}
		}
		catch (Exception ex)
		{
			ShutDown();
			MessageBox.Show("Error : " + ex.StackTrace + ":" + ex.Message);
		}
	}

	private void ShutDown()
	{
		timerForBTEventLogs.Enabled = false;
		buttonEnableDisable.Text = "Enable";
		if (phone != null && phone.IsPhoneConnected())
		{
			phone.DisconnectAllServers();
		}
		if (TesterSerialPort != null && TesterSerialPort.IsOpen)
		{
			TesterSerialPort.Close();
		}
		buttonEnableDisable.Enabled = true;
		toolStripStatusLabel1.Text = "DUT not Connected";
	}

	private void TesterSerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
	{
		Thread.Sleep(150);
		if (TesterSerialPort.BytesToRead == 0)
		{
			return;
		}
		byte[] array = new byte[TesterSerialPort.BytesToRead];
		TesterSerialPort.Read(array, 0, TesterSerialPort.BytesToRead);
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.Append(logNumber + ":");
		logNumber++;
		stringBuilder.Append("  " + DateTime.Now.TimeOfDay.ToString() + " ");
		stringBuilder.Append("HCI_Command:");
		byte[] array2 = array;
		foreach (byte b in array2)
		{
			stringBuilder.AppendFormat("0x{0:x2} , ", b);
		}
		loggingRichTextBox.Invoke(new UpdateShellRichTB(UpdateRichTabText), stringBuilder.ToString());
		if (phone.IsPhoneConnected())
		{
			try
			{
				phone.FTM_BT_HCI_USER_CMD(array, (byte)array.Length);
			}
			catch (Exception)
			{
				ShutDown();
				MessageBox.Show("Failed to send command to DUT, make sure if FTM is working on the DUT");
			}
		}
	}

	private void UpdateRichTabText(string Text)
	{
		loggingRichTextBox.Text += Text;
		loggingRichTextBox.Text += "\n";
	}

	private void buttonClearLogs_Click(object sender, EventArgs e)
	{
		loggingRichTextBox.Text = "";
		logNumber = 0;
	}

	private void buttonSaveLogs_Click(object sender, EventArgs e)
	{
		DialogResult dialogResult = logSaveFileDialog.ShowDialog();
		logSaveFileDialog.DefaultExt = ".txt";
		if (dialogResult == DialogResult.OK && logSaveFileDialog.FileName.Length > 0)
		{
			try
			{
				loggingRichTextBox.SaveFile(logSaveFileDialog.FileName, RichTextBoxStreamType.PlainText);
			}
			catch (Exception ex)
			{
				MessageBox.Show("Failed to save logs: " + ex.StackTrace + ":" + ex.Message);
			}
		}
	}

	private void checkBox1_CheckedChanged(object sender, EventArgs e)
	{
		if (disableQPST.Checked)
		{
			phone.SetLibraryMode(LibraryModeEnum.QPhoneMS);
			label2.Visible = true;
			textBoxCOMQDL.Visible = true;
		}
		else
		{
			phone.SetLibraryMode(LibraryModeEnum.QPST);
			label2.Visible = false;
			textBoxCOMQDL.Visible = false;
		}
	}

	private void testerCOMPortCB_DropDown(object sender, EventArgs e)
	{
		testerCOMPortCB.Items.Clear();
		testerCOMPortCB.Items.AddRange(SerialPort.GetPortNames());
		string[] portNames = SerialPort.GetPortNames();
		if (portNames.Length > 0)
		{
			testerCOMPortCB.SelectedItem = portNames[0].ToString();
		}
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
			if (phone != null && phone.IsPhoneConnected())
			{
				phone.DisconnectAllServers();
			}
			if (TesterSerialPort != null && TesterSerialPort.IsOpen)
			{
				TesterSerialPort.Close();
			}
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BluetoothLE_DirectMode.BluetoothLEDirectMode));
		this.connectionGB = new System.Windows.Forms.GroupBox();
		this.buttonEnableDisable = new System.Windows.Forms.Button();
		this.testerSettingsGB = new System.Windows.Forms.GroupBox();
		this.textBoxBaudRate = new System.Windows.Forms.TextBox();
		this.label1 = new System.Windows.Forms.Label();
		this.labelHandshake = new System.Windows.Forms.Label();
		this.labelComPort = new System.Windows.Forms.Label();
		this.handshakeCB = new System.Windows.Forms.ComboBox();
		this.testerCOMPortCB = new System.Windows.Forms.ComboBox();
		this.dutGB = new System.Windows.Forms.GroupBox();
		this.textBoxCOMQDL = new System.Windows.Forms.TextBox();
		this.label2 = new System.Windows.Forms.Label();
		this.disableQPST = new System.Windows.Forms.CheckBox();
		this.cbWCN2243Legacy = new System.Windows.Forms.CheckBox();
		this.targetTypeLabel = new System.Windows.Forms.Label();
		this.targetTypeCB = new System.Windows.Forms.ComboBox();
		this.loggingGB = new System.Windows.Forms.GroupBox();
		this.buttonClearLogs = new System.Windows.Forms.Button();
		this.buttonSaveLogs = new System.Windows.Forms.Button();
		this.loggingRichTextBox = new System.Windows.Forms.RichTextBox();
		this.statusStripDUTPort = new System.Windows.Forms.StatusStrip();
		this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
		this.timerForBTEventLogs = new System.Windows.Forms.Timer(this.components);
		this.TesterSerialPort = new System.IO.Ports.SerialPort(this.components);
		this.logSaveFileDialog = new System.Windows.Forms.SaveFileDialog();
		this.connectionGB.SuspendLayout();
		this.testerSettingsGB.SuspendLayout();
		this.dutGB.SuspendLayout();
		this.loggingGB.SuspendLayout();
		this.statusStripDUTPort.SuspendLayout();
		base.SuspendLayout();
		this.connectionGB.Controls.Add(this.buttonEnableDisable);
		this.connectionGB.Controls.Add(this.testerSettingsGB);
		this.connectionGB.Controls.Add(this.dutGB);
		this.connectionGB.Location = new System.Drawing.Point(9, 13);
		this.connectionGB.Name = "connectionGB";
		this.connectionGB.Size = new System.Drawing.Size(602, 150);
		this.connectionGB.TabIndex = 0;
		this.connectionGB.TabStop = false;
		this.connectionGB.Text = "Connection";
		this.buttonEnableDisable.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.buttonEnableDisable.Location = new System.Drawing.Point(6, 19);
		this.buttonEnableDisable.Name = "buttonEnableDisable";
		this.buttonEnableDisable.Size = new System.Drawing.Size(112, 125);
		this.buttonEnableDisable.TabIndex = 2;
		this.buttonEnableDisable.Text = "Enable";
		this.buttonEnableDisable.UseVisualStyleBackColor = true;
		this.buttonEnableDisable.Click += new System.EventHandler(buttonEnableDisable_Click);
		this.testerSettingsGB.Controls.Add(this.textBoxBaudRate);
		this.testerSettingsGB.Controls.Add(this.label1);
		this.testerSettingsGB.Controls.Add(this.labelHandshake);
		this.testerSettingsGB.Controls.Add(this.labelComPort);
		this.testerSettingsGB.Controls.Add(this.handshakeCB);
		this.testerSettingsGB.Controls.Add(this.testerCOMPortCB);
		this.testerSettingsGB.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.testerSettingsGB.Location = new System.Drawing.Point(297, 13);
		this.testerSettingsGB.Name = "testerSettingsGB";
		this.testerSettingsGB.Size = new System.Drawing.Size(299, 137);
		this.testerSettingsGB.TabIndex = 1;
		this.testerSettingsGB.TabStop = false;
		this.testerSettingsGB.Text = "Tester Port Settings";
		this.textBoxBaudRate.Font = new System.Drawing.Font("Microsoft Sans Serif", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.textBoxBaudRate.Location = new System.Drawing.Point(228, 22);
		this.textBoxBaudRate.Name = "textBoxBaudRate";
		this.textBoxBaudRate.Size = new System.Drawing.Size(58, 23);
		this.textBoxBaudRate.TabIndex = 5;
		this.textBoxBaudRate.Text = "115200";
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(165, 30);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(57, 15);
		this.label1.TabIndex = 4;
		this.label1.Text = "Baudrate";
		this.labelHandshake.AutoSize = true;
		this.labelHandshake.Location = new System.Drawing.Point(10, 68);
		this.labelHandshake.Name = "labelHandshake";
		this.labelHandshake.Size = new System.Drawing.Size(70, 15);
		this.labelHandshake.TabIndex = 3;
		this.labelHandshake.Text = "Handshake";
		this.labelComPort.AutoSize = true;
		this.labelComPort.Location = new System.Drawing.Point(10, 30);
		this.labelComPort.Name = "labelComPort";
		this.labelComPort.Size = new System.Drawing.Size(60, 15);
		this.labelComPort.TabIndex = 2;
		this.labelComPort.Text = "COM Port";
		this.handshakeCB.Font = new System.Drawing.Font("Microsoft Sans Serif", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.handshakeCB.FormattingEnabled = true;
		this.handshakeCB.Location = new System.Drawing.Point(84, 68);
		this.handshakeCB.Name = "handshakeCB";
		this.handshakeCB.Size = new System.Drawing.Size(211, 24);
		this.handshakeCB.TabIndex = 1;
		this.testerCOMPortCB.Font = new System.Drawing.Font("Microsoft Sans Serif", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.testerCOMPortCB.FormattingEnabled = true;
		this.testerCOMPortCB.Location = new System.Drawing.Point(84, 22);
		this.testerCOMPortCB.Name = "testerCOMPortCB";
		this.testerCOMPortCB.Size = new System.Drawing.Size(83, 24);
		this.testerCOMPortCB.TabIndex = 0;
		this.testerCOMPortCB.DropDown += new System.EventHandler(testerCOMPortCB_DropDown);
		this.dutGB.Controls.Add(this.textBoxCOMQDL);
		this.dutGB.Controls.Add(this.label2);
		this.dutGB.Controls.Add(this.disableQPST);
		this.dutGB.Controls.Add(this.cbWCN2243Legacy);
		this.dutGB.Controls.Add(this.targetTypeLabel);
		this.dutGB.Controls.Add(this.targetTypeCB);
		this.dutGB.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.dutGB.Location = new System.Drawing.Point(133, 13);
		this.dutGB.Name = "dutGB";
		this.dutGB.Size = new System.Drawing.Size(158, 145);
		this.dutGB.TabIndex = 0;
		this.dutGB.TabStop = false;
		this.dutGB.Text = "DUT";
		this.textBoxCOMQDL.Font = new System.Drawing.Font("Microsoft Sans Serif", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.textBoxCOMQDL.Location = new System.Drawing.Point(70, 112);
		this.textBoxCOMQDL.Name = "textBoxCOMQDL";
		this.textBoxCOMQDL.Size = new System.Drawing.Size(58, 23);
		this.textBoxCOMQDL.TabIndex = 6;
		this.textBoxCOMQDL.Text = "COM1";
		this.textBoxCOMQDL.Visible = false;
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(7, 115);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(60, 15);
		this.label2.TabIndex = 6;
		this.label2.Text = "COM Port";
		this.label2.Visible = false;
		this.disableQPST.AutoSize = true;
		this.disableQPST.Location = new System.Drawing.Point(6, 92);
		this.disableQPST.Name = "disableQPST";
		this.disableQPST.Size = new System.Drawing.Size(103, 19);
		this.disableQPST.TabIndex = 3;
		this.disableQPST.Text = "Disable QPST";
		this.disableQPST.UseVisualStyleBackColor = true;
		this.disableQPST.CheckedChanged += new System.EventHandler(checkBox1_CheckedChanged);
		this.cbWCN2243Legacy.AutoSize = true;
		this.cbWCN2243Legacy.Location = new System.Drawing.Point(6, 17);
		this.cbWCN2243Legacy.Name = "cbWCN2243Legacy";
		this.cbWCN2243Legacy.Size = new System.Drawing.Size(65, 19);
		this.cbWCN2243Legacy.TabIndex = 2;
		this.cbWCN2243Legacy.Text = "Legacy";
		this.cbWCN2243Legacy.UseVisualStyleBackColor = true;
		this.targetTypeLabel.AutoSize = true;
		this.targetTypeLabel.Location = new System.Drawing.Point(7, 41);
		this.targetTypeLabel.Name = "targetTypeLabel";
		this.targetTypeLabel.Size = new System.Drawing.Size(71, 15);
		this.targetTypeLabel.TabIndex = 1;
		this.targetTypeLabel.Text = "Target Type";
		this.targetTypeCB.Font = new System.Drawing.Font("Microsoft Sans Serif", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.targetTypeCB.FormattingEnabled = true;
		this.targetTypeCB.Items.AddRange(new object[3] { "MSM/MDM", "APQ", "QDL" });
		this.targetTypeCB.Location = new System.Drawing.Point(6, 61);
		this.targetTypeCB.Name = "targetTypeCB";
		this.targetTypeCB.Size = new System.Drawing.Size(115, 24);
		this.targetTypeCB.TabIndex = 0;
		this.targetTypeCB.Text = "MSM/MDM";
		this.loggingGB.Controls.Add(this.buttonClearLogs);
		this.loggingGB.Controls.Add(this.buttonSaveLogs);
		this.loggingGB.Controls.Add(this.loggingRichTextBox);
		this.loggingGB.Location = new System.Drawing.Point(9, 170);
		this.loggingGB.Name = "loggingGB";
		this.loggingGB.Size = new System.Drawing.Size(602, 226);
		this.loggingGB.TabIndex = 1;
		this.loggingGB.TabStop = false;
		this.loggingGB.Text = "Logging";
		this.buttonClearLogs.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.buttonClearLogs.Location = new System.Drawing.Point(481, 127);
		this.buttonClearLogs.Name = "buttonClearLogs";
		this.buttonClearLogs.Size = new System.Drawing.Size(113, 97);
		this.buttonClearLogs.TabIndex = 2;
		this.buttonClearLogs.Text = "Clear Logs";
		this.buttonClearLogs.UseVisualStyleBackColor = true;
		this.buttonClearLogs.Click += new System.EventHandler(buttonClearLogs_Click);
		this.buttonSaveLogs.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.buttonSaveLogs.Location = new System.Drawing.Point(481, 15);
		this.buttonSaveLogs.Name = "buttonSaveLogs";
		this.buttonSaveLogs.Size = new System.Drawing.Size(113, 106);
		this.buttonSaveLogs.TabIndex = 1;
		this.buttonSaveLogs.Text = "Save Logs";
		this.buttonSaveLogs.UseVisualStyleBackColor = true;
		this.buttonSaveLogs.Click += new System.EventHandler(buttonSaveLogs_Click);
		this.loggingRichTextBox.Location = new System.Drawing.Point(7, 16);
		this.loggingRichTextBox.Name = "loggingRichTextBox";
		this.loggingRichTextBox.ReadOnly = true;
		this.loggingRichTextBox.Size = new System.Drawing.Size(468, 210);
		this.loggingRichTextBox.TabIndex = 0;
		this.loggingRichTextBox.Text = "";
		this.statusStripDUTPort.Items.AddRange(new System.Windows.Forms.ToolStripItem[1] { this.toolStripStatusLabel1 });
		this.statusStripDUTPort.Location = new System.Drawing.Point(0, 397);
		this.statusStripDUTPort.Name = "statusStripDUTPort";
		this.statusStripDUTPort.Size = new System.Drawing.Size(619, 22);
		this.statusStripDUTPort.TabIndex = 2;
		this.statusStripDUTPort.Text = "DUT not connected";
		this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
		this.toolStripStatusLabel1.Size = new System.Drawing.Size(110, 17);
		this.toolStripStatusLabel1.Text = "DUT not connected";
		this.timerForBTEventLogs.Tick += new System.EventHandler(timerForBTEventLogs_Tick);
		this.TesterSerialPort.BaudRate = 115200;
		this.TesterSerialPort.DtrEnable = true;
		this.TesterSerialPort.Handshake = System.IO.Ports.Handshake.RequestToSend;
		this.TesterSerialPort.ReadTimeout = 5000;
		this.TesterSerialPort.WriteTimeout = 5000;
		this.TesterSerialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(TesterSerialPort_DataReceived);
		this.logSaveFileDialog.Filter = "Text files|*.txt|All files|*.*";
		this.logSaveFileDialog.RestoreDirectory = true;
		this.logSaveFileDialog.Title = "Select log filename";
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(619, 419);
		base.Controls.Add(this.statusStripDUTPort);
		base.Controls.Add(this.loggingGB);
		base.Controls.Add(this.connectionGB);
		base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
		base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
		base.MaximizeBox = false;
		base.Name = "BluetoothLEDirectMode";
		this.Text = "QUALCOMM Bluetooth LE Direct Mode";
		this.connectionGB.ResumeLayout(false);
		this.testerSettingsGB.ResumeLayout(false);
		this.testerSettingsGB.PerformLayout();
		this.dutGB.ResumeLayout(false);
		this.dutGB.PerformLayout();
		this.loggingGB.ResumeLayout(false);
		this.statusStripDUTPort.ResumeLayout(false);
		this.statusStripDUTPort.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
