using System; using HDL_ON.DriverLayer; namespace HDL_ON.Entity { public class TV { public TV() { } public void ControlTV(InfraredCode_TV iCode,Function function) { int RandKey = new Random().Next(0, 255); var textByte = (byte)iCode; new Control_Udp().ControlBytesSend(Command.InfraredControl, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 1, function.bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0); } public void ControlTV(int number,Function function) { int RandKey = new Random().Next(0, 255); var textByte = (byte)(number + 7); if (number == 0) { textByte = 18; } new Control_Udp().ControlBytesSend(Command.InfraredControl, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 1, function.bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0); } } }