diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 36a7a03..0cedca8 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -2534,12 +2534,27 @@ pn53x_InJumpForDEP(struct nfc_device *pnd, switch (nbr) { case NBR_106: abtCmd[2] = 0x00; // baud rate is 106 kbps + if (pbtPassiveInitiatorData && (ndm == NDM_PASSIVE)) { /* can't have passive initiator data when using active mode */ + abtCmd[3] |= 0x01; + memcpy(abtCmd + offset, pbtPassiveInitiatorData, 4); + offset += 4; + } break; case NBR_212: abtCmd[2] = 0x01; // baud rate is 212 kbps + if (pbtPassiveInitiatorData && (ndm == NDM_PASSIVE)) { + abtCmd[3] |= 0x01; + memcpy(abtCmd + offset, pbtPassiveInitiatorData, 5); + offset += 5; + } break; case NBR_424: abtCmd[2] = 0x02; // baud rate is 424 kbps + if (pbtPassiveInitiatorData && (ndm == NDM_PASSIVE)) { + abtCmd[3] |= 0x01; + memcpy(abtCmd + offset, pbtPassiveInitiatorData, 5); + offset += 5; + } break; case NBR_847: case NBR_UNDEFINED: @@ -2548,22 +2563,6 @@ pn53x_InJumpForDEP(struct nfc_device *pnd, break; } - if (pbtPassiveInitiatorData && (ndm == NDM_PASSIVE)) { /* can't have passive initiator data when using active mode */ - switch (nbr) { - case NBR_106: - abtCmd[3] |= 0x01; - memcpy(abtCmd + offset, pbtPassiveInitiatorData, 4); - offset += 4; - break; - case NBR_212: - case NBR_424: - abtCmd[3] |= 0x01; - memcpy(abtCmd + offset, pbtPassiveInitiatorData, 5); - offset += 5; - break; - } - } - if (pbtNFCID3i) { abtCmd[3] |= 0x02; memcpy(abtCmd + offset, pbtNFCID3i, 10);