From e2678b7bb1b68160778609e23a5eea7a809c775b Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 07 三月 2022 17:16:38 +0800
Subject: [PATCH] 2022-3-7-01
---
HDL_ON/DAL/DriverLayer/Control.cs | 64 +++++++++++++++++++++++++++++---
1 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 1430b9b..98bc02e 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -1,6 +1,7 @@
锘縰sing System;
using System.Collections.Generic;
using System.Text;
+using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI;
using Shared;
@@ -25,7 +26,7 @@
public class Control
{
-
+
static Control _control;
public static Control Ins
{
@@ -768,8 +769,8 @@
topicAndLengthBytes.CopyTo(sendDataBytes, 0);
bodyBytes.CopyTo(sendDataBytes, topicAndLengthBytes.Length);
- //var sendDataString = Encoding.UTF8.GetString(sendDataBytes);
- //MainPage.Log($"杞崲HDL-Link鏁版嵁\r\n{sendDataString}\r\n");
+ var sendDataString = Encoding.UTF8.GetString(sendDataBytes);
+ MainPage.Log($"杞崲HDL-Link鏁版嵁\r\n{sendDataString}\r\n");
//***************************************************************
return sendDataBytes;
@@ -865,7 +866,7 @@
if (receiveObj.Topic == CommunicationTopic.SearchLoaclGatewayReply || receiveObj.Topic == CommunicationTopic.GatewayBroadcast)
{
-
+
var bodyJObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(res[1]);
if (bodyJObj == null)
{
@@ -981,19 +982,34 @@
{
continue;
}
+ MainPage.Log(localFunction.name);
+
if (Ins.GatewayOnline_Local && isCloudData)//鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�
{
- if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk))
+ if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains( localFunction.spk))
{
//MainPage.Log($"A鍗忚鏇存柊鐘舵��:鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�........");
+
return;
}
}
+
+ //if (SPK.MusicSpkList().Contains(localFunction.spk))
+ //{
+ // if (updateTemp.status.Count < 3)
+ // {
+ // ///鏄煶涔愬姛鑳界殑
+ // ///涓婃姤灞炴�у皯3鏉′笉鍋氬鐞�
+ // return;
+ // }
+ //}
//MainPage.Log($"A鍗忚鏇存柊鐘舵��:{revString}");
foreach (var attr in updateTemp.status)
{
localFunction.time_stamp = temp.time_stamp;
localFunction.SetAttrState(attr.key, attr.value);
+ //Console.WriteLine("闊充箰鎾斁鍣ㄦ坊鍔犵紦瀛樻暟鎹�=======" + revString);
+
}
//鏇存柊鐣岄潰鐘舵��
@@ -1175,6 +1191,12 @@
//鐘舵�佹洿鏂�
Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status);
break;
+ case SPK.AvMusic:
+ case SPK.MusicStandard:
+ //UI.Music.MusicMain.mMusicMain.RefreshView(updateTemp);
+ //Console.WriteLine("闊充箰鎾斁鍣ㄦ樉绀虹姸鎬�======="+ revString);
+ //wjc
+ break;
}
HomePage.UpdataFunctionStates(localFunction);
@@ -1191,5 +1213,35 @@
}
}
+
+
+ #region 闂ㄩ攣
+
+ /// <summary>
+ /// //涓�閿紙杩滅▼锛夊紑閿�
+ /// </summary>
+ public void OneKeyUnlocking(Function doorlock,string extStr)
+ {
+ if (Ins.GatewayOnline_Local)
+ {
+ Dictionary<string, string> dic = new Dictionary<string, string>();
+ var functionControlDataObj = doorlock.GetGatewayAlinkDoorlockData(UserInfo.Current.ID,extStr);
+ var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
+ var sendBytes = Ins.ConvertSendBodyData($"/base/{Control.Ins.GatewayId}/thing/service/doorRemoteOpen/down", functionControlDataJson);
+ new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 0);
+ }
+ else
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", doorlock.deviceId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/remoteOpen", requestJson);
+ }
+ }
+ //瀵嗙爜鍐荤粨
+ //瀵嗙爜楠岃瘉
+
+ #endregion
}
-}
\ No newline at end of file
+}
--
Gitblit v1.8.0