public bool connect(string device) { iCard = new CardNative(); String[] readers; try{ readers = this.iCard.ListReaders(); }catch(System.Exception){ Debug.WriteLine("ACR122:: connect, ListReaders() failed"); return false; } if(readers == null){ Debug.WriteLine("ARC122:: No Devices connected!"); return false; } bool ready = false; while(!ready){ try{ this.iCard.Connect(device, SHARE.Shared, PROTOCOL.T0orT1); _connected = true; ready = true; }catch(System.Exception e){ //Debug.WriteLine("ACR112:: ERROR, " + e.Message); Debug.WriteLine("Device not ready"); System.Threading.Thread.Sleep(1500); } } Debug.WriteLine("ACR122:: Device Connected!"); return true; }
public ACR122_v2() { _connected = false; try{ iCard = new CardNative(); }catch(System.Exception){ Debug.WriteLine("ACR112_v2:: CardNative() Failed"); } }
public ACR122Query(CardNative iCard) { this.iCard = iCard; _numCards=-1; select(); }
public CardApplicationBase(Logger Log, CardNative Card) { this.Log = Log; this.Card = Card; }
public SIMInterface() { iCard = new CardNative(); string[] readers = iCard.ListReaders(); Console.WriteLine("Please insert card into the reader and press any key..."); Console.ReadKey(true); iCard.Connect(readers[0], SHARE.Shared, PROTOCOL.T0orT1); Console.WriteLine("Connects card on reader: " + readers[0]); DFgsm_selected = false; }