diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 32f791d..2178324 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -129,6 +129,18 @@ pn53x_reset_settings(struct nfc_device *pnd) if ((res = pn53x_write_register(pnd, PN53X_REG_CIU_BitFraming, SYMBOL_TX_LAST_BITS, 0x00)) < 0) { return res; } + // Make sure we reset the CRC and parity to chip handling. + if ((res = pn53x_set_property_bool(pnd, NP_HANDLE_CRC, true)) < 0) + return res; + if ((res = pn53x_set_property_bool(pnd, NP_HANDLE_PARITY, true)) < 0) + return res; + // Activate "easy framing" feature by default + if ((res = pn53x_set_property_bool(pnd, NP_EASY_FRAMING, true)) < 0) + return res; + // Deactivate the CRYPTO1 cipher, it may could cause problems when still active + if ((res = pn53x_set_property_bool(pnd, NP_ACTIVATE_CRYPTO1, false)) < 0) + return res; + return NFC_SUCCESS; } diff --git a/libnfc/nfc.c b/libnfc/nfc.c index 421ffac..d8a8c73 100644 --- a/libnfc/nfc.c +++ b/libnfc/nfc.c @@ -363,18 +363,6 @@ nfc_initiator_init(nfc_device *pnd) // Disallow multiple frames if ((res = nfc_device_set_property_bool(pnd, NP_ACCEPT_MULTIPLE_FRAMES, false)) < 0) return res; - // Make sure we reset the CRC and parity to chip handling. - if ((res = nfc_device_set_property_bool(pnd, NP_HANDLE_CRC, true)) < 0) - return res; - if ((res = nfc_device_set_property_bool(pnd, NP_HANDLE_PARITY, true)) < 0) - return res; - // Activate "easy framing" feature by default - if ((res = nfc_device_set_property_bool(pnd, NP_EASY_FRAMING, true)) < 0) - return res; - // Deactivate the CRYPTO1 cipher, it may could cause problems when still active - if ((res = nfc_device_set_property_bool(pnd, NP_ACTIVATE_CRYPTO1, false)) < 0) - return res; - HAL(initiator_init, pnd); }