private void sendTool_Click(object sender, EventArgs e) { UserMessage message = new UserMessage(); if (customMessage != null) { message.Command = customMessage.Header.Command; message.ParameterID = customMessage.Header.ParameterId; message.Data = customMessage.Data; } if (message.ShowDialog() == System.Windows.Forms.DialogResult.OK) { customMessage = message.Message; if (customMessage == null) { MessageBox.Show("Invalid message format!"); } else { foreach (var socket in Transport.Sockets) { socket.SendRdm(message.Message, SelectedDevice.Address, SelectedDevice.Id); } } } }
public static RdmRawPacket ReadPacketRaw(RdmBinaryReader data) { RdmHeader header = new RdmHeader(); header.ReadData(data); RdmRawPacket rdmPacket = RdmPacket.Create(header, typeof(RdmRawPacket)) as RdmRawPacket; if (rdmPacket != null) { rdmPacket.ReadData(data); } return(rdmPacket); }