/// <summary> /// 发送消息之前必须先设置解码器 /// </summary> /// <param name="type"></param> public void SetDecoder(byte type) { if (Decoders.ContainsKey(type)) { Decoder = Decoders[type]; } }
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); }