Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }