From 4c17caa61bc3b0a05a2b303bccdfedfbf3853f6d Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 24 十一月 2020 15:58:10 +0800 Subject: [PATCH] 2020-11-24 1.优化登录界面失败提示。 --- HDL_ON/Entity/Function/TV.cs | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/HDL_ON/Entity/Function/TV.cs b/HDL_ON/Entity/Function/TV.cs index 01166b3..bd358ed 100644 --- a/HDL_ON/Entity/Function/TV.cs +++ b/HDL_ON/Entity/Function/TV.cs @@ -1,10 +1,30 @@ 锘縰sing System; +using HDL_ON.DriverLayer; + namespace HDL_ON.Entity { public class TV : Function { public TV() { + trait_on_off.value = "off"; + } + + public void ControlTV(InfraredCode_TV iCode) + { + int RandKey = new Random().Next(0, 255); + var textByte = (byte)iCode; + Control.ins.myUdp.ControlBytesSend(Command.InfraredControl, bus_Data.SubnetID, bus_Data.DeviceID, new byte[] { 1, bus_Data.LoopID, textByte, 0, 0, (byte)RandKey }, 0); + } + public void ControlTV(int number) + { + int RandKey = new Random().Next(0, 255); + var textByte = (byte)(number + 7); + if (number == 0) + { + textByte = 18; + } + Control.ins.myUdp.ControlBytesSend(Command.InfraredControl, bus_Data.SubnetID, bus_Data.DeviceID, new byte[] { 1, bus_Data.LoopID, textByte, 0, 0, (byte)RandKey }, 0); } } } -- Gitblit v1.8.0