public CardBuffer Process(CardBuffer inBuffer) { CardBuffer outBuffer; if (UseApdus) { try { /* Transform incoming frame into an APDU */ CAPDU capdu = new CAPDU(inBuffer.GetBytes()); /* Process the APDU */ outBuffer = OnApdu(new CAPDU(inBuffer.GetBytes())); } catch (Exception) { /* Incoming frame is not a valid APDU, return 6700 */ outBuffer = new RAPDU(0x67, 0x00); } } else { /* Process the frame */ outBuffer = OnFrame(inBuffer); } IsFirstCommand = false; return(outBuffer); }
public RAPDU Transmit(CAPDU capdu) { _capdu = capdu; if (!Transmit()) { return(null); } return(_rapdu); }
public RAPDU Control(CAPDU cctrl) { _cctrl = cctrl; if (!Control()) { return(null); } return(new RAPDU(_rctrl)); }
public RAPDU Control(CAPDU cctrl) { CardBuffer _rctrl; if (!Control(cctrl, out _rctrl)) { return(null); } return(new RAPDU(_rctrl)); }
public bool Transmit(CAPDU capdu, out RAPDU rapdu) { rapdu = null; _capdu = capdu; if (!Transmit()) { return(false); } rapdu = _rapdu; return(true); }
public bool Control(CAPDU cctrl, out RAPDU rctrl) { rctrl = null; _cctrl = cctrl; if (!Control()) { return(false); } rctrl = new RAPDU(_rctrl); return(true); }
public bool Control(CAPDU cctrl, out RAPDU rctrl) { rctrl = null; CardBuffer _rctrl; if (!Control(cctrl, out _rctrl)) { return(false); } rctrl = new RAPDU(_rctrl); return(true); }
public void Transmit(CAPDU capdu, TransmitDoneCallback callback) { if (_transmit_thread != null) { _transmit_thread = null; } _capdu = capdu; if (callback != null) { _transmit_done_callback = callback; _transmit_thread = new Thread(TransmitFunction); _transmit_thread.Start(); } }
protected override RAPDU OnApdu(CAPDU capdu) { System.Threading.Thread.Sleep(750); return(new RAPDU(new byte[1], 0x90, 0x00)); }
protected abstract RAPDU OnApdu(CAPDU capdu);