From df8d4ab0ef17a7fab5dea9c47bbd9f4d4a2a40b0 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 15 三月 2021 14:55:49 +0800
Subject: [PATCH] 合并前上传一个版本
---
HDL_ON/DAL/Mqtt/MqttClient.cs | 36 +++++++++++++++++++++++++++++++++---
1 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 9524d02..df7c4a8 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -191,9 +191,15 @@
Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/property/send",
QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce
};
+ //璁惧鍏ョ綉涓婃姤涓婚(鐩墠鍙湁绾㈠瀹�)
+ var topicFilterPush3 = new MqttTopicFilter()
+ {
+ Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/topo/found",
+ QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce
+ };
Utlis.WriteLine("寮�濮嬭闃咃紒");
- var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterPush2, topicAlinkStatus });
+ var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterPush2, topicAlinkStatus, topicFilterPush3 });
if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0)
{
isSubscribeSuccess = true;
@@ -272,6 +278,12 @@
}
}
+ //涓�浜涚壒娈婄殑涓婚澶勭悊(涓轰簡鎵ц閫熷害,灏藉彲鑳界殑鍒姞鑰楁椂鐨勬搷浣� true:鎵ц浜嗙壒娈婂鐞� false:娌℃湁鎵ц鐗规畩澶勭悊)
+ if (Stan.HdlCloudReceiveLogic.Current.CloudOverallMsgReceiveEx(topic, e.ApplicationMessage.Payload, mqttEncryptKey, tuyaEncryptKey) == true)
+ {
+ return;
+ }
+
if (topic == $"/BusGateWayToClient/{UserInfo.Current.ID}" + PushNotifySqueeze)
{
var mMes = Encoding.UTF8.GetString(e.ApplicationMessage.Payload);
@@ -283,13 +295,13 @@
{
var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey);
var revString = Encoding.UTF8.GetString(bytes);
- Control.Ins.UpdataFunctionStatus(revString, null);
+ Control.Ins.UpdataFunctionStatus(revString, null,true);
}
//涓�绔彛鏁版嵁瑙f瀽
else
{
//SetGatewayOnlineResetCheck();
- var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, mqttEncryptKey);
+ //var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, mqttEncryptKey);
//bus鏁版嵁瑙f瀽
var packet = new Packet();
@@ -323,6 +335,7 @@
RemoteMqttClient.UseConnectedHandler(async (e) =>
{
IfNeedReadAllDeviceStatus = true;
+ Control.Ins.GatewayOnline_Cloud = true;
Utlis.WriteLine($"============>Mqtt杩滅▼杩炴帴鎴愬姛");
SendPushSignOut();
});
@@ -531,6 +544,23 @@
static void ReceiveNotifySqueezeAsync(string mMes)
{
if (mMes == PushSignStr ) return;//鏄嚜宸辩殑鐧诲綍鎺ㄩ�佷笉澶勭悊//鎴栬�呭綋鍓嶄笉鏄繙绋嬮摼鎺ョ姸鎬�
+ //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾�
+ switch (UserInfo.Current.AccountString)
+ {
+ case "13415629083":
+ case "18316120654":
+ case "15622703419":
+ case "18824864143":
+ case "464027401@qq.com":
+ case "2791308028@qq.com":
+ case "13697499568":
+ case "18666455392":
+ case "13375012446":
+ case "13602944661":
+ case "18778381374":
+ case "18316672920":
+ return;
+ }
if (!UserInfo.Current.IsLogin)
{
--
Gitblit v1.8.0