Fix comparison when nfc_initiator_target_is_present() with a specified target
This commit is contained in:
parent
22078a8509
commit
d028bc725d
1 changed files with 3 additions and 1 deletions
|
@ -1059,6 +1059,7 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
|
||||||
size_t szTargetsData = sizeof(abtTargetsData);
|
size_t szTargetsData = sizeof(abtTargetsData);
|
||||||
int res = 0;
|
int res = 0;
|
||||||
nfc_target nttmp;
|
nfc_target nttmp;
|
||||||
|
memset(&nttmp, 0x00, sizeof(nfc_target));
|
||||||
|
|
||||||
if (nm.nmt == NMT_ISO14443BI || nm.nmt == NMT_ISO14443B2SR || nm.nmt == NMT_ISO14443B2CT) {
|
if (nm.nmt == NMT_ISO14443BI || nm.nmt == NMT_ISO14443B2SR || nm.nmt == NMT_ISO14443B2CT) {
|
||||||
if (CHIP_DATA(pnd)->type == RCS360) {
|
if (CHIP_DATA(pnd)->type == RCS360) {
|
||||||
|
@ -1148,7 +1149,6 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
|
||||||
if (! found)
|
if (! found)
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const pn53x_modulation pm = pn53x_nm_to_pm(nm);
|
const pn53x_modulation pm = pn53x_nm_to_pm(nm);
|
||||||
if ((PM_UNDEFINED == pm) || (NBR_UNDEFINED == nm.nbr)) {
|
if ((PM_UNDEFINED == pm) || (NBR_UNDEFINED == nm.nbr)) {
|
||||||
pnd->last_error = NFC_EINVARG;
|
pnd->last_error = NFC_EINVARG;
|
||||||
|
@ -1221,6 +1221,8 @@ pn53x_initiator_poll_target(struct nfc_device *pnd,
|
||||||
szTargetTypes++;
|
szTargetTypes++;
|
||||||
}
|
}
|
||||||
nfc_target ntTargets[2];
|
nfc_target ntTargets[2];
|
||||||
|
memset(ntTargets, 0x00, sizeof(nfc_target) * 2);
|
||||||
|
|
||||||
if ((res = pn53x_InAutoPoll(pnd, apttTargetTypes, szTargetTypes, uiPollNr, uiPeriod, ntTargets, 0)) < 0)
|
if ((res = pn53x_InAutoPoll(pnd, apttTargetTypes, szTargetTypes, uiPollNr, uiPeriod, ntTargets, 0)) < 0)
|
||||||
return res;
|
return res;
|
||||||
switch (res) {
|
switch (res) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue