fix nfc_target_init().

This commit is contained in:
Audrey Diacre 2012-01-04 15:59:34 +00:00
parent a41b2b0da8
commit c1faa48f54

View file

@ -633,27 +633,27 @@ nfc_target_init (nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, size_t * pszR
int res = 0; int res = 0;
// Disallow invalid frame // Disallow invalid frame
if ((res = nfc_device_set_property_bool (pnd, NP_ACCEPT_INVALID_FRAMES, false)) < 0) if ((res = nfc_device_set_property_bool (pnd, NP_ACCEPT_INVALID_FRAMES, false)) < 0)
return false; return res;
// Disallow multiple frames // Disallow multiple frames
if ((res = nfc_device_set_property_bool (pnd, NP_ACCEPT_MULTIPLE_FRAMES, false)) < 0) if ((res = nfc_device_set_property_bool (pnd, NP_ACCEPT_MULTIPLE_FRAMES, false)) < 0)
return false; return res;
// Make sure we reset the CRC and parity to chip handling. // Make sure we reset the CRC and parity to chip handling.
if ((res = nfc_device_set_property_bool (pnd, NP_HANDLE_CRC, true)) < 0) if ((res = nfc_device_set_property_bool (pnd, NP_HANDLE_CRC, true)) < 0)
return false; return res;
if ((res = nfc_device_set_property_bool (pnd, NP_HANDLE_PARITY, true)) < 0) if ((res = nfc_device_set_property_bool (pnd, NP_HANDLE_PARITY, true)) < 0)
return false; return res;
// Activate auto ISO14443-4 switching by default // Activate auto ISO14443-4 switching by default
if ((res = nfc_device_set_property_bool (pnd, NP_AUTO_ISO14443_4, true)) < 0) if ((res = nfc_device_set_property_bool (pnd, NP_AUTO_ISO14443_4, true)) < 0)
return false; return res;
// Activate "easy framing" feature by default // Activate "easy framing" feature by default
if ((res = nfc_device_set_property_bool (pnd, NP_EASY_FRAMING, true)) < 0) if ((res = nfc_device_set_property_bool (pnd, NP_EASY_FRAMING, true)) < 0)
return false; return res;
// Deactivate the CRYPTO1 cipher, it may could cause problems when still active // 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) if ((res = nfc_device_set_property_bool (pnd, NP_ACTIVATE_CRYPTO1, false)) < 0)
return false; return res;
// Drop explicitely the field // Drop explicitely the field
if ((res = nfc_device_set_property_bool (pnd, NP_ACTIVATE_FIELD, false)) < 0) if ((res = nfc_device_set_property_bool (pnd, NP_ACTIVATE_FIELD, false)) < 0)
return false; return res;
HAL (target_init, pnd, pnt, pbtRx, pszRx); HAL (target_init, pnd, pnt, pbtRx, pszRx);
} }