From f69332a116b08987800f6d4b7041342e3081305e Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 24 十二月 2020 16:55:42 +0800
Subject: [PATCH] 一端口远程控制场景改成由云端控制
---
HDL_ON/DAL/Mqtt/MqttClient.cs | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index fb5d3b5..ec55e61 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -32,18 +32,18 @@
/// </summary>
static string RandomKey = "";
+ /// <summary>
+ /// 闅忔満鐢熸垚瀛楃
+ /// </summary>
+ /// <returns></returns>
static string GetRandomKey()
{
if (string.IsNullOrEmpty(RandomKey))
{
//闅忔満2浣嶅瓧绗︿覆
- Random random = new Random(Guid.NewGuid().GetHashCode());
- int num = random.Next(65, 91);
- RandomKey = Convert.ToChar(num).ToString();
+ RandomKey = Utlis.CreateRandomString(2);
}
-
return RandomKey;
-
}
/// <summary>
@@ -291,12 +291,12 @@
packet.Bytes = e.ApplicationMessage.Payload;
}
#if DEBUG
- string ddd = "";
- foreach (var bb in packet.Bytes)
- {
- ddd += bb + ",";
- }
- MainPage.Log($"mqtt bus data:{ddd}");
+ //string ddd = "";
+ //foreach (var bb in packet.Bytes)
+ //{
+ // ddd += bb + ",";
+ //}
+ //MainPage.Log($"mqtt bus data:{ddd}");
#endif
packet.Manager();
}
--
Gitblit v1.8.0