private void buttonDebugGetState_Click(object sender, EventArgs e) { byte[] getoutputstate = { 0x00, 0x06, 0x00 }; // 0, cmd, outputPort byte[] response = bt.SendCommand(getoutputstate); SetOutputState s = new SetOutputState(); s.FromCommand(response); textBoxLog.Text += s.ToString(); textBoxLog.Select(textBoxLog.Text.Length, 0); textBoxLog.ScrollToCaret(); }
private void buttonDebugParse_Click(object sender, EventArgs e) { string[] vals = textBoxDebugResponse.Text.Split(' '); List <byte> MsgList = new List <byte>(); foreach (string v in vals) { int val = Convert.ToInt32(v, 16); MsgList.Add((byte)val); } byte[] command = MsgList.ToArray(); SetOutputState s = new SetOutputState(); s.FromCommand(command); textBoxLog.Text += s.ToString(); textBoxLog.Select(textBoxLog.Text.Length, 0); textBoxLog.ScrollToCaret(); }