From 7f233a10afa6882b4d9531185af60e8843bc1af2 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 11 五月 2020 09:21:36 +0800 Subject: [PATCH] 20200511 --- HDL_ON/DriverLayer/Control_Bus.cs | 76 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 76 insertions(+), 0 deletions(-) diff --git a/HDL_ON/DriverLayer/Control_Bus.cs b/HDL_ON/DriverLayer/Control_Bus.cs index a0d8538..b5d7d40 100644 --- a/HDL_ON/DriverLayer/Control_Bus.cs +++ b/HDL_ON/DriverLayer/Control_Bus.cs @@ -3,6 +3,8 @@ using HDL_ON.DAL; using HDL_ON.DAL.Net; using HDL_ON.Entity; +using Shared; +using Shared.Net; namespace HDL_ON { @@ -32,6 +34,72 @@ MainPage.Log(command.ToString() + "::" + CommonPage.EndPoint.ToString()); } + /// <summary> + /// 000E 鎼滅储鍥炲 + /// </summary> + /// <param name="usefullBytes"></param> + static void ReceiveReadRemark(byte[] usefullBytes) + { + try + { + //璐﹀彿娌$櫥褰曚笉鍥炲 + if (MainPage.LoginUser == null || !MainPage.LoginUser.IsLogin) + { + return; + } + + //if (!isHttpListenerStart) + //{ + // //鏁版嵁鎺ユ敹绔彛娌℃墦寮�锛屼笉鍥炲 + // return; + //} + + var sendStr = MainPage.LoginUser.accountString; + + + //濡傛灉IP鍦板潃鑾峰彇鎴愬姛 鏄剧ず鏈�鍚庝竴浣� + var mAddressBytes = new Shared.Net.NetWiFi().IpAddress.GetAddressBytes(); + if (mAddressBytes != null && mAddressBytes.Length == 4) + { + sendStr = (mAddressBytes[3] & 0xFF).ToString() + ":" + sendStr; + } + + if (usefullBytes.Length <= 2) + { + byte[] sendBytes = new byte[20]; + byte[] b1 = CommonPage.MyEncodingGB2312.GetBytes(sendStr); + Array.Copy(b1, 0, sendBytes, 0, 20 < b1.Length ? 20 : b1.Length); + Control.ControlBytesSend(Command.ReadRemarkACK, 0xFF, 0xFF, sendBytes, 1); + + } + else + { + + for (int i = 2, len = usefullBytes.Length; i < len; i++) + { + if (i % 2 == 0) + { + if ((usefullBytes[i] & 0xFF) == 0xFC + && (usefullBytes[i + 1] & 0xFF) == 0xFC + ) + { + + byte[] sendBytes = new byte[20]; + byte[] b1 = CommonPage.MyEncodingGB2312.GetBytes(sendStr); + //Remote_GroupName = CommonPage.MyEncodingGB2312.GetString (b1); + Array.Copy(b1, 0, sendBytes, 0, 20 < b1.Length ? 20 : b1.Length); + Control.ControlBytesSend(Command.ReadRemarkACK, 0xFF, 0xFF, sendBytes, 1); + + break; + } + } + } + + } + + } + catch { } + } /// <summary> /// 澶勭悊鎺ユ敹鍥炴潵鐨勬暟鎹� @@ -58,7 +126,13 @@ case Command.ReadLogicLoopColorACK: case Command.ReadACModeACK: case Command.SetACModeACK: + case Command.ReadFloorHeatACK: + case Command.SetFloorHeatACK: receiveFlag += string.Format("{0}", usefulBytes[0]); + break; + case Command.ReadRemark: + //buspro 璇诲娉ㄥ洖澶� + ReceiveReadRemark(usefulBytes); break; //case Command.YIPanelDeviceInofACK: // for (int i = 0; i < 4; i++) @@ -445,6 +519,8 @@ case Command.ReadLogicLoopColor: case Command.ReadACMode: case Command.SetACMode: + case Command.ReadFloorHeat: + case Command.SetFloorHeat: this.sendFlag += string.Format("{0}", target.AddData[0]); break; case Command.SetLogicLoopColor: -- Gitblit v1.8.0