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); }
public nfc_device_desc_t[] list_devices(ref uint uDev) { IntPtr ip = Marshal.AllocHGlobal(272 * 16); LibNFC.nfc_list_devices(ip, 1, ref uDev); nfc_device_desc_t[] device = new nfc_device_desc_t[16]; for (uint i = 0; i < uDev; i++) { device[i] = (nfc_device_desc_t)Marshal.PtrToStructure(new IntPtr(ip.ToInt32() + (272 * i)), typeof(nfc_device_desc_t)); } Marshal.FreeHGlobal(ip); return(device); }
private static extern IntPtr nfc_connect(ref nfc_device_desc_t pndd);