From e53a1951d6aa07ad22aad9816da4703496fcbccd Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 27 十一月 2020 14:27:16 +0800
Subject: [PATCH] 1127最新合并代码,合并嘉乐更新

---
 HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs |  105 ++++++++++++++++------------------------------------
 1 files changed, 33 insertions(+), 72 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs b/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
index 5c29563..909bdd8 100644
--- a/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
+++ b/HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
@@ -1,17 +1,10 @@
 锘匡豢using System;
 using System.Text;
-using Newtonsoft.Json.Linq;
 
-namespace HDL_ON.Common
+namespace HDL_ON.DriverLayer
 {
     public class A_Protocal_Common
     {
-        public static A_Protocal_Common apc;
-
-        public A_Protocal_Common()
-        {
-            apc = new A_Protocal_Common();
-        }
 
 
         /// <summary>  
@@ -21,75 +14,26 @@
         /// <returns>long</returns>  
         public long Get_time_stamp()
         {
-            //DateTime startTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
-            long t = DateTime.Now.Ticks / 10000;   //闄�10000璋冩暣涓�13浣�      
+            long t = DateTime.Now.Ticks / 10000;  
             return t;
         }
 
-        /// <summary>
-        /// 杞崲閫氳鏁版嵁
-        /// </summary>
-        public byte[] ConvertSendBodyData(string topic, string bodyDataString)
-        {
-            string topicString = "Topic:" + topic + "/r/n";
-            byte[] bodyBytes = Encoding.ASCII.GetBytes(bodyDataString);
-            string lenghtString = "Length:" + bodyBytes.Length.ToString() + "/r/n" + "/r/n";
-
-            string sendDataString = topicString + lenghtString + bodyDataString;
-            byte[] sendDataBytes = Encoding.ASCII.GetBytes(sendDataString);
-
-            return sendDataBytes;
-        }
-        /// <summary>
-        /// 杞崲鎺ユ敹鍒扮殑鏁版嵁
-        /// </summary>
-        /// <returns></returns>
-        public string ConvertReceiveData(byte[] bytes)
-        {
-            string receiveString = "";
-
-            string topic = "";
-            int lenght = 0;
-
-            var reString = System.Text.Encoding.UTF8.GetString(bytes);
-            var res = reString.Split("/r/n/r/n");
-
-
-            if (res.Length == 2)
-            {
-                var topics = res[0].Split("/r/n");
-                foreach (var ts in topics)
-                {
-                    var key = ts.Split(":");
-                    switch (key[0])
-                    {
-                        case "Topic":
-                            topic = key[1];
-                            break;
-                        case "Lenght":
-                            lenght = Convert.ToInt32(key[1]);
-                            break;
-                    }
-                }
-
-                switch (topic)
-                {
-                    case CommunicationTopic.SearchLoaclGateway:
-                        var jt = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(res[1]);
-                        if (jt != null)
-                        {
-                            var device = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.DeviceModule>(jt.objects.ToString());
-                            //Newtonsoft.Json.Linq.JObject.FromObject(jt.objects);
-                        }
-                        break;
-                }
-
-            }
-            return receiveString;
-        }
     }
+
     /// <summary>
-    /// 閫氳鍥炲鏁版嵁鍖�
+    /// 鏈湴閫氳鏁版嵁
+    /// </summary>
+    public class LocalCommunicationData
+    {
+        public string Topic;
+        public int Length;
+
+        public string BodyDataString;
+
+    }
+
+    /// <summary>
+    /// 閫氳鍥炲鏈夋晥鏁版嵁
     /// </summary>
     public class ResponsePack
     {
@@ -108,5 +52,22 @@
         /// 鎼滅储鏈湴缃戝叧
         /// </summary>
         public const string SearchLoaclGateway = "/user/all/custom/gateway/search";
+
+        /// <summary>
+        /// 璋冭瘯杞欢涓婁紶oid鍒楄〃
+        /// </summary>
+        public const string AddDeviceOids = "/user/onpro/custom/device/add";
+        /// <summary>
+        /// 璋冭瘯杞欢涓婁紶鍔熻兘鍒楄〃
+        /// </summary>
+        public const string AddFunctions = "/user/onpro/custom/function/attribute/add";
+        /// <summary>
+        /// 璋冭瘯杞欢鑾峰彇appOid鍒楄〃
+        /// </summary>
+        public const string BusPcGetAppOids = "/user/onpro/custom/device/list/get";
+        /// <summary>
+        /// 璋冭瘯杞欢鑾峰彇appSid鍒楄〃
+        /// </summary>
+        public const string BusPcGetAppSids = "/user/onpro/custom/function/list/get";
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0