internal OutDmx(DmxMode dm, uint SeqId, IPAddress forward, byte intf) { this.ID = header; this.OpCode = (byte)((byte)dm | intf); this.padding = new byte[3] { 0xaa, 0xbb, 0xcc }; this.SeqId = SeqId; this.ForwardIp = forward.GetAddressBytes(); this.Data = new byte[dm switch
public static PollReply CreatePollReply( string manufacture, string modelName, DmxMode length, bool hasWiFiIf, bool hasEthIf, DeviceCode dc, byte dmxIn, byte dmxOut, byte midiIn, byte midiOut, byte laserOut, byte stripOut ) => new PollReply( header, manufacture, modelName, length, hasWiFiIf, hasEthIf, dc, dmxIn, dmxOut, midiIn, midiOut, laserOut, stripOut);
internal PollReply( byte[] header, string manufacture, string modelName, DmxMode length, bool hasWiFiIf, bool hasEthIf, DeviceCode dc, byte dmxIn, byte dmxOut, byte midiIn, byte midiOut, byte laserOut, byte stripOut) { ID = header; OpCode = (byte)OpCodes.PollReply; Manufacture = Encoding.ASCII.GetBytes(manufacture, 0, manufacture.Length < strLength - 1 ? manufacture.Length : strLength - 1); ModelName = Encoding.ASCII.GetBytes(modelName, 0, modelName.Length < strLength ? modelName.Length : strLength); Flags = (byte)(0xc0 | 256 << ((length - DmxMode.Dmx256) >> 4) | (hasWiFiIf ? 8 : 0) | (hasEthIf ? 4 : 0) | (byte)dc); InterfaceCnt = new byte[3] { (byte)(dmxOut | dmxIn << 4), (byte)(midiOut | midiIn << 4), (byte)(stripOut | laserOut << 4) }; }