123456789101112131415161718192021222324252627282930313233343536 |
- using Edge.Core.Parser.BinaryParser;
- using Edge.Core.Parser.BinaryParser.MessageEntity;
- using WayneChina_IcCardReader_SinoChem.MessageEntity.Incoming;
- namespace WayneChina_IcCardReader_SinoChem.MessageEntity
- {
-
-
-
-
-
-
-
-
-
- public class MessageTemplateLookup : IMessageTemplateLookup
- {
- public MessageTemplateBase GetMessageTemplateByRawBytes(byte[] bytes)
- {
- if (bytes.Length == 7 && bytes[4] == 0x00)
- return new HeartBeat();
- else if (bytes.Length == 7 && bytes[4] == 0x01)
- return new ACK();
- else if (bytes.Length == 8 && bytes[4] == 0x02)
- return new CardReaderStateEvent();
- else if (bytes.Length == 18 && bytes[4] == 0x03)
- return new SignDataResponse();
- else if (bytes.Length == 8 && bytes[4] == 0x05)
- return new CardExternalCheckErrorRequest();
- else if (bytes.Length == 39 && bytes[4] == 0x06)
- return new CardOnlineVerificationRequest();
- return null;
- }
- }
- }
|