예제 #1
0
        public nfc_device_t connect(nfc_device_desc_t pndd)
        {
            disconnect();
            _handle = nfc_connect(ref pndd);
            nfc_device_t ndRet = (nfc_device_t)Marshal.PtrToStructure(_handle, typeof(nfc_device_t));

            return(ndRet);
        }
예제 #2
0
        public frmRFIDReader()
        {
            InitializeComponent();
            uDev   = 0;
            size   = Marshal.SizeOf(typeof(nfc_iso14443a_info_t));
            libnfc = new LibNFC();
            nfc_device_desc_t[] devices = libnfc.list_devices(ref uDev);
            nfc_device_t        con     = libnfc.connect(devices[0]);

            libnfc.initiator_init();

            libnfc.configure(LibNFC.nfc_device_option_t.NDO_ACTIVATE_FIELD, false);
            libnfc.configure(LibNFC.nfc_device_option_t.NDO_INFINITE_SELECT, false);
            libnfc.configure(LibNFC.nfc_device_option_t.NDO_HANDLE_CRC, true);
            libnfc.configure(LibNFC.nfc_device_option_t.NDO_ACTIVATE_FIELD, true);
        }