public int ProcessContactlessTransaction() { _CardStatusResult = new TaskCompletionSource <int>(); _ResponseTagsHandlersSubscribed++; ResponseTagsHandler += CardStatusHandler; _CLessStatusResult = new TaskCompletionSource <int>(); _ResponseCLessHandlersSubscribed++; ResponseCLessHandler += ContactlessStatusHandler; // 0x0003 - CardStatus // 0x9000 - CLessStatus int command = 0x9000; Console.WriteLine("cmd: ProcessCLessTrans - status=0x0{0:X4}", command); WriteSingleCmd(command); int cardStatus = _CardStatusResult.Task.Result; ResponseTagsHandler -= CardStatusHandler; _ResponseTagsHandlersSubscribed--; ResponseCLessHandler -= ContactlessStatusHandler; _ResponseCLessHandlersSubscribed--; return(cardStatus); }
public int ContinueContactlessTransaction() { _CLessStatusResult = new TaskCompletionSource <int>(); _ResponseCLessHandlersSubscribed++; ResponseCLessHandler += ContactlessStatusHandler; int command = 0x0003; Console.WriteLine("cmd: Continue CLess - status=0x0{0:X4}", command); WriteSingleCmd(command); int cardStatus = _CLessStatusResult.Task.Result; ResponseCLessHandler -= ContactlessStatusHandler; _ResponseCLessHandlersSubscribed--; return(cardStatus); }