From 6a9ad7ec93218913a2ce3b898bb036f18f8f0da4 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 13 八月 2020 17:06:36 +0800 Subject: [PATCH] 20200813 --- HDL_ON/Entity/Function/TV.cs | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/HDL_ON/Entity/Function/TV.cs b/HDL_ON/Entity/Function/TV.cs index 01166b3..2070698 100644 --- a/HDL_ON/Entity/Function/TV.cs +++ b/HDL_ON/Entity/Function/TV.cs @@ -5,6 +5,24 @@ { public TV() { + on_off = "off"; + } + + public void ControlTV(InfraredCode_TV iCode) + { + int RandKey = new Random().Next(0, 255); + var textByte = (byte)iCode; + Control.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.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