public nfc_target_info() { /* * nai = null; * nfi = null; * nbi = null; * nii = null; * nsi = null; * nci = null; * nji = null; * ndi = null; * */ nai = new nfc_iso14443a_info(); nfi = new nfc_felica_info(); nbi = new nfc_iso14443b_info(); nii = new nfc_iso14443bi_info(); nsi = new nfc_iso14443b2sr_info(); nci = new nfc_iso14443b2ct_info(); nji = new nfc_jewel_info(); ndi = new nfc_dep_info(); }
public nfc_dep_info ndi; //7 public nfc_target_info(int i) { switch (i) { case 0: nai = new nfc_iso14443a_info(); break; case 1: nfi = new nfc_felica_info(); break; case 2: nbi = new nfc_iso14443b_info(); break; case 3: nii = new nfc_iso14443bi_info(); break; case 4: nsi = new nfc_iso14443b2sr_info(); break; case 5: nci = new nfc_iso14443b2ct_info(); break; case 6: nji = new nfc_jewel_info(); break; case 7: ndi = new nfc_dep_info(); break; } }
nfc_initiator_select_dep_target(nfc_device pnd, nfc_dep_mode ndm, nfc_baud_rate nbr, nfc_dep_info pndiInitiator, ref nfc_target pnt, int timeout) { pnd.last_error = 0; return(pnd.driver.initiator_select_dep_target(pnd, ndm, nbr, pndiInitiator, ref pnt, timeout)); }
nfc_initiator_poll_dep_target(nfc_device pnd, nfc_dep_mode ndm, nfc_baud_rate nbr, nfc_dep_info pndiInitiator, nfc_target pnt, int timeout) { const int period = 300; int remaining_time = timeout; int res; int result = 0; bool bInfiniteSelect = pnd.bInfiniteSelect; pnt = null; if ((res = nfc_device_set_property_bool(pnd, nfc_property.NP_INFINITE_SELECT, true)) < 0) { return(res); } while (remaining_time > 0) { if ((res = nfc_initiator_select_dep_target(pnd, ndm, nbr, pndiInitiator, ref pnt, period)) < 0) { if (res != NFC_ETIMEOUT) { result = res; break; } } if (res == 1) { result = res; break; } remaining_time -= period; } if (!bInfiniteSelect) { if ((res = nfc_device_set_property_bool(pnd, nfc_property.NP_INFINITE_SELECT, false)) < 0) { return(res); } } return(result); }