public bool initiator_select_passive_target(ref nfc_target_t selected) { IntPtr ip = Marshal.AllocHGlobal(89); nfc_modulation_t nm = nfc_modulation_t.NM_ISO14443A_106; bool bRet = nfc_initiator_select_passive_target(_handle, nm, IntPtr.Zero, 0, ip); if (bRet) { selected = (nfc_target_t)Marshal.PtrToStructure(ip, typeof(nfc_target_t)); } Marshal.FreeHGlobal(ip); return(bRet); }
public nfc_target_t[] initiator_list_passive_target_iso14443a(ref uint targets) { nfc_target_t[] ant = new nfc_target_t[16]; IntPtr ip = Marshal.AllocHGlobal(89 * 16); nfc_modulation_t nm = nfc_modulation_t.NM_ISO14443A_106 | nfc_modulation_t.NM_JEWEL_106; nfc_initiator_list_passive_targets(_handle, nm, ip, 16, ref targets); for (uint i = 0; i < targets; i++) { ant[i] = (nfc_target_t)Marshal.PtrToStructure(new IntPtr(ip.ToInt32() + (89 * i)), typeof(nfc_target_t)); } Marshal.FreeHGlobal(ip); return(ant); }
private static extern bool nfc_initiator_list_passive_targets(IntPtr pnd, nfc_modulation_t nmInitModulation, IntPtr anti, uint szTargets, ref uint pszTargetFound);
private static extern bool nfc_initiator_select_passive_target(IntPtr pnd, nfc_modulation_t nmInitModulation, IntPtr pbtInitData, uint szInitDataLen, IntPtr pti);