From 203c3a3ffde6259413d9743f6a723b95b1e7989c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 06 七月 2023 22:43:05 +0800 Subject: [PATCH] 门锁功能 --- HDL_ON/DAL/DriverLayer/Control.cs | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 656dcca..c89474a 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -257,7 +257,8 @@ public void SearchLoaclGateway() { //2021-01-15 : 浣忓畢娌℃湁缁戝畾缃戝叧鐨勬椂鍊欎笉鐢ㄦ悳绱紝骞朵笖涓嶈兘閾炬帴mqtt - if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId)) + if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId) || + !UserInfo.Current.IsLogin) { return; } @@ -464,7 +465,6 @@ return true; } - //MainPage.Log($"鍙戦�佹暟鎹�:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}"); ///绗笁鏂规秱楦﹁澶囩粺涓�浣跨敤杩滅▼鎺у埗 @@ -516,6 +516,7 @@ var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson); new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, resend); MainPage.Log($"鏈湴閫氳 鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}"); + Ins.myTcpClient.SendMessage(sendBytes); } } //杩滅▼閫氳 @@ -940,6 +941,10 @@ /// <returns></returns> public void ConvertReceiveData(byte[] receiveBytes, string ip) { + if (!UserInfo.Current.IsLogin) + { + return; + } var reString = Encoding.UTF8.GetString(receiveBytes); AnalysisReceiveData(reString, receiveBytes, ip); } @@ -951,6 +956,7 @@ /// <returns></returns> public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes, string sIp = null) { + LocalCommunicationData receiveObj = new LocalCommunicationData(); @@ -1088,7 +1094,8 @@ } } else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" || - receiveObj.Topic == CommunicationTopic.ct.ControlFunctionTopic + "_reply" || + receiveObj.Topic == CommunicationTopic.ct.ControlFunctionTopic + "_reply" || + receiveObj.Topic == CommunicationTopic.ct.ControlGroupControlTopic + "_reply" || receiveObj.Topic == CommunicationTopic.ct.GatewayUpStatus || receiveObj.Topic.Contains(CommunicationTopic.ct.GatewayUpSortTopic)) { -- Gitblit v1.8.0