public void UpdateTestCommandInfo(int devNum, UInt16 addr, byte point, UInt16 cID, byte[] data) { textBox1.Text = devNum.ToString(); textBox4.Text = addr.ToString("X4"); textBox5.Text = point.ToString("X2"); textBox13.Text = cID.ToString("X4"); textBox6.Text = ZigbeeCommon.BtoHexStr(data, 0, data.Length); }
private int Send(byte cmd0, byte cmd1, byte[] data) { int slen = data.Length + 5; byte[] buf = new byte[slen]; buf[0] = 0xFE; buf[1] = (byte)data.Length; buf[2] = cmd0; buf[3] = cmd1; Array.Copy(data, 0, buf, 4, data.Length); buf[slen - 1] = ZigbeeCommon.GetXor(buf, 1, (slen - 1)); String str = "snd:" + ZigbeeCommon.BtoHexStr(buf, 0, buf.Length); ZigbeeApi.myZtool.UpdateSendTextBox(str); if (ZigbeeApi.Uart.IsOpen) { ZigbeeApi.Uart.Write(buf, 0, buf.Length); } return(0); }
private void AppProc(byte[] pkg, int len) { int Index = 4; byte cmd0; byte cmd1; byte dlen; cmd0 = pkg[2]; cmd1 = pkg[3]; dlen = pkg[4]; UInt16 addr = ZigbeeCommon.BtoU16(pkg, Index); if (Device.CheckExist(addr) == true) { string str = "app rec:"; str += ZigbeeCommon.BtoHexStr(pkg, 0, pkg.Length); myZtool.UpdateRecieveTextBox(str); Device.ReceiveCount(addr); } else { Device.AddDevice(addr, null); } }
public void UpdatePreConfigKey(byte[] key) { textBox14.Text = ZigbeeCommon.BtoHexStr(key, 0, key.Length); }