public virtual NfcDevice OpenDevice(string name = null) { IntPtr devicePointer; try { devicePointer = Libnfc.Open(contextPointer, name); if (devicePointer == IntPtr.Zero) { throw new Exception(); } } catch (Exception) { throw new Exception("Error opening NFC reader"); } return(new NfcDevice(devicePointer)); }