コード例 #1
0
 /// <summary>
 /// 发送消息之前必须先设置解码器
 /// </summary>
 /// <param name="type"></param>
 public void SetDecoder(byte type)
 {
     if (Decoders.ContainsKey(type))
     {
         Decoder = Decoders[type];
     }
 }
コード例 #2
0
        public LaserBaseResponse LaserBaseResponse(byte[] sendData, byte[] recData)
        {
            LaserBaseResponse responseList = null;

            if (recData != null)
            {
                if (Decoders.ContainsKey(sendData[1]))
                {
                    Decoder = Decoders[sendData[1]];
                    if (Decoder != null)
                    {
                        responseList = Decoder.Decode(new OriginalBytes(DateTime.Now, recData));
                    }
                }
            }
            return(responseList);
        }