From 16b65f9019f8df3b154ab835b92879ca618be1c3 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 03 二月 2021 16:28:10 +0800
Subject: [PATCH] 2021-02-03 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
old mode 100644
new mode 100755
index 01166b3..c0b23c5
--- 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.curValue = "off";
+        }
+
+        public void ControlTV(InfraredCode_TV iCode)
+        {
+            int RandKey = new Random().Next(0, 255);
+            var textByte = (byte)iCode;
+            new Control_Udp().ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.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;
+            }
+            new Control_Udp().ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0);
         }
     }
 }

--
Gitblit v1.8.0