Example #1
0
 private RawCardData[] GetRawData()
 {
     if (rawData == null)
     {
         rawData = RawCardData.ParseJsonString(base.RawData);
     }
     return(rawData);
 }
Example #2
0
 public RawCardDataReplyEventArgs(Guid connectionId, byte address, RawCardData rawCardData)
 {
     ConnectionId = connectionId;
     Address      = address;
     RawCardData  = rawCardData;
 }
Example #3
0
        internal virtual void OnReplyReceived(Reply reply)
        {
            {
                var handler = ReplyReceived;
                handler?.Invoke(this, new ReplyEventArgs {
                    Reply = reply
                });
            }

            switch (reply.Type)
            {
            case ReplyType.Nak:
            {
                var handler = NakReplyReceived;
                handler?.Invoke(this,
                                new NakReplyEventArgs(reply.ConnectionId, reply.Address, Nak.ParseData(reply)));
                break;
            }

            case ReplyType.LocalStatusReport:
            {
                var handler = LocalStatusReportReplyReceived;
                handler?.Invoke(this,
                                new LocalStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                    Model.ReplyData.LocalStatus.ParseData(reply)));
                break;
            }

            case ReplyType.InputStatusReport:
            {
                var handler = InputStatusReportReplyReceived;
                handler?.Invoke(this,
                                new InputStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                    Model.ReplyData.InputStatus.ParseData(reply)));
                break;
            }

            case ReplyType.OutputStatusReport:
            {
                var handler = OutputStatusReportReplyReceived;
                handler?.Invoke(this,
                                new OutputStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                     Model.ReplyData.OutputStatus.ParseData(reply)));
                break;
            }

            case ReplyType.ReaderStatusReport:
            {
                var handler = ReaderStatusReportReplyReceived;
                handler?.Invoke(this,
                                new ReaderStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                     Model.ReplyData.ReaderStatus.ParseData(reply)));
                break;
            }

            case ReplyType.RawReaderData:
            {
                var handler = RawCardDataReplyReceived;
                handler?.Invoke(this,
                                new RawCardDataReplyEventArgs(reply.ConnectionId, reply.Address, RawCardData.ParseData(reply)));
                break;
            }
            }
        }
Example #4
0
        internal virtual void OnReplyReceived(Reply reply)
        {
            {
                var handler = ReplyReceived;
                handler?.Invoke(this, new ReplyEventArgs {
                    Reply = reply
                });
            }

            switch (reply.Type)
            {
            case ReplyType.Nak:
            {
                var handler = NakReplyReceived;
                handler?.Invoke(this,
                                new NakReplyEventArgs(reply.ConnectionId, reply.Address,
                                                      Nak.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.LocalStatusReport:
            {
                var handler = LocalStatusReportReplyReceived;
                handler?.Invoke(this,
                                new LocalStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                    Model.ReplyData.LocalStatus.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.InputStatusReport:
            {
                var handler = InputStatusReportReplyReceived;
                handler?.Invoke(this,
                                new InputStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                    Model.ReplyData.InputStatus.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.OutputStatusReport:
            {
                var handler = OutputStatusReportReplyReceived;
                handler?.Invoke(this,
                                new OutputStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                     Model.ReplyData.OutputStatus.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.ReaderStatusReport:
            {
                var handler = ReaderStatusReportReplyReceived;
                handler?.Invoke(this,
                                new ReaderStatusReportReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                     Model.ReplyData.ReaderStatus.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.RawReaderData:
            {
                var handler = RawCardDataReplyReceived;
                handler?.Invoke(this,
                                new RawCardDataReplyEventArgs(reply.ConnectionId, reply.Address,
                                                              RawCardData.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.ManufactureSpecific:
            {
                var handler = ManufacturerSpecificReplyReceived;
                handler?.Invoke(this,
                                new ManufacturerSpecificReplyEventArgs(reply.ConnectionId, reply.Address,
                                                                       ManufacturerSpecific.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.ExtendedRead:
            {
                var handler = ExtendedReadReplyReceived;
                handler?.Invoke(this,
                                new ExtendedReadReplyEventArgs(reply.ConnectionId, reply.Address,
                                                               ExtendedRead.ParseData(reply.ExtractReplyData)));
                break;
            }

            case ReplyType.PIVData:
            {
                var handler = PIVDataReplyReceived;
                handler?.Invoke(this,
                                new PIVDataReplyEventArgs(reply.ConnectionId, reply.Address,
                                                          PIVData.ParseData(reply.ExtractReplyData)));
                break;
            }
            }
        }