private void button1_Click(object sender, EventArgs e) { byte commandAddr = Convert.ToByte(textBox1.Text); CmdSleep ci = new CmdSleep(); addrc = ci.GetSleepOneCmd(commandAddr); richTextBox1.Text = DataChange.byteToHexStr(addrc); }
public void GetSleepOneCmdTest() { //AA 05 01 C0 99 5D CmdSleep cf = new CmdSleep(); byte[] ret = cf.GetSleepOneCmd(0x99); Assert.AreEqual(ret.Count(), 6); Assert.AreEqual(ret[5], 0x5D); Assert.AreEqual(ret[0], 0xAA); Assert.AreEqual(ret[1], 0x05); Assert.AreEqual(ret[2], 0x01); Assert.AreEqual(ret[3], 0xC0); }