예제 #1
0
 /// <summary>
 /// 解析接收到数据,先解压缩后进行解密
 /// </summary>
 /// <param name="head">指令头</param>
 /// <param name="content">指令的内容</param>
 /// <return>真实的数据内容</return>
 internal static byte[] CommandAnalysis(byte[] head, byte[] content)
 {
     if (content != null)
     {
         int _zipped = BitConverter.ToInt32(head, 8);
         // 先进行解压
         if (_zipped == ProtocolZipped)
         {
             content = SoftZipped.Decompress(content);
         }
         // 进行解密
         return(HslSecurity.ByteDecrypt(content));
     }
     else
     {
         return(null);
     }
 }