Indent correctly previous commit (make style)
This commit is contained in:
parent
ce443d50ca
commit
f47af31fb7
2 changed files with 18 additions and 18 deletions
|
@ -63,9 +63,9 @@ nfc_modulation pn53x_ptt_to_nm(const pn53x_target_type ptt);
|
||||||
pn53x_modulation pn53x_nm_to_pm(const nfc_modulation nm);
|
pn53x_modulation pn53x_nm_to_pm(const nfc_modulation nm);
|
||||||
pn53x_target_type pn53x_nm_to_ptt(const nfc_modulation nm);
|
pn53x_target_type pn53x_nm_to_ptt(const nfc_modulation nm);
|
||||||
|
|
||||||
void pn53x_current_target_new (const struct nfc_device *pnd, const nfc_target *pnt);
|
void pn53x_current_target_new(const struct nfc_device *pnd, const nfc_target *pnt);
|
||||||
void pn53x_current_target_free (const struct nfc_device *pnd);
|
void pn53x_current_target_free(const struct nfc_device *pnd);
|
||||||
bool pn53x_current_target_is (const struct nfc_device *pnd, const nfc_target *pnt);
|
bool pn53x_current_target_is(const struct nfc_device *pnd, const nfc_target *pnt);
|
||||||
|
|
||||||
/* implementations */
|
/* implementations */
|
||||||
int
|
int
|
||||||
|
@ -855,10 +855,10 @@ pn53x_set_property_bool(struct nfc_device *pnd, const nfc_property property, con
|
||||||
// timings could be tweak better than this, and maybe we can tweak timings
|
// timings could be tweak better than this, and maybe we can tweak timings
|
||||||
// to "gain" a sort-of hardware polling (ie. like PN532 does)
|
// to "gain" a sort-of hardware polling (ie. like PN532 does)
|
||||||
return pn53x_RFConfiguration__MaxRetries(pnd,
|
return pn53x_RFConfiguration__MaxRetries(pnd,
|
||||||
(bEnable) ? 0xff : 0x00, // MxRtyATR, default: active = 0xff, passive = 0x02
|
(bEnable) ? 0xff : 0x00, // MxRtyATR, default: active = 0xff, passive = 0x02
|
||||||
(bEnable) ? 0xff : 0x01, // MxRtyPSL, default: 0x01
|
(bEnable) ? 0xff : 0x01, // MxRtyPSL, default: 0x01
|
||||||
(bEnable) ? 0xff : 0x02 // MxRtyPassiveActivation, default: 0xff (0x00 leads to problems with PN531)
|
(bEnable) ? 0xff : 0x02 // MxRtyPassiveActivation, default: 0xff (0x00 leads to problems with PN531)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1111,7 +1111,7 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
|
||||||
if ((res = pn53x_decode_target_data(abtTargetsData + 1, szTargetsData - 1, CHIP_DATA(pnd)->type, nm.nmt, &(pnt->nti)) < 0)) {
|
if ((res = pn53x_decode_target_data(abtTargetsData + 1, szTargetsData - 1, CHIP_DATA(pnd)->type, nm.nmt, &(pnt->nti)) < 0)) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
pn53x_current_target_new (pnd, pnt);
|
pn53x_current_target_new(pnd, pnt);
|
||||||
}
|
}
|
||||||
return abtTargetsData[0];
|
return abtTargetsData[0];
|
||||||
}
|
}
|
||||||
|
@ -1166,7 +1166,7 @@ pn53x_initiator_poll_target(struct nfc_device *pnd,
|
||||||
return NFC_ECHIP;
|
return NFC_ECHIP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pn53x_current_target_new (pnd, pnt);
|
pn53x_current_target_new(pnd, pnt);
|
||||||
} else {
|
} else {
|
||||||
pn53x_set_property_bool(pnd, NP_INFINITE_SELECT, true);
|
pn53x_set_property_bool(pnd, NP_INFINITE_SELECT, true);
|
||||||
// FIXME It does not support DEP targets
|
// FIXME It does not support DEP targets
|
||||||
|
@ -1227,7 +1227,7 @@ pn53x_initiator_select_dep_target(struct nfc_device *pnd,
|
||||||
} else {
|
} else {
|
||||||
res = pn53x_InJumpForDEP(pnd, ndm, nbr, pbtPassiveInitiatorData, NULL, NULL, 0, pnt, timeout);
|
res = pn53x_InJumpForDEP(pnd, ndm, nbr, pbtPassiveInitiatorData, NULL, NULL, 0, pnt, timeout);
|
||||||
}
|
}
|
||||||
if (res>=0)
|
if (res >= 0)
|
||||||
pn53x_current_target_new(pnd, pnt);
|
pn53x_current_target_new(pnd, pnt);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -1652,7 +1652,7 @@ int
|
||||||
pn53x_initiator_target_is_present(struct nfc_device *pnd, const nfc_target nt)
|
pn53x_initiator_target_is_present(struct nfc_device *pnd, const nfc_target nt)
|
||||||
{
|
{
|
||||||
// Check if the argument target nt is equals to current saved target
|
// Check if the argument target nt is equals to current saved target
|
||||||
if (!pn53x_current_target_is (pnd, &nt)) {
|
if (!pn53x_current_target_is(pnd, &nt)) {
|
||||||
return NFC_ETGRELEASED;
|
return NFC_ETGRELEASED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1882,7 +1882,7 @@ pn53x_target_init(struct nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, const
|
||||||
if (pnt->nm.nmt == NMT_DEP) {
|
if (pnt->nm.nmt == NMT_DEP) {
|
||||||
pnt->nti.ndi.ndm = ndm; // Update DEP mode
|
pnt->nti.ndi.ndm = ndm; // Update DEP mode
|
||||||
}
|
}
|
||||||
pn53x_current_target_new (pnd, pnt);
|
pn53x_current_target_new(pnd, pnt);
|
||||||
|
|
||||||
if (ptm & PTM_ISO14443_4_PICC_ONLY) {
|
if (ptm & PTM_ISO14443_4_PICC_ONLY) {
|
||||||
// When PN532 is in PICC target mode, it automatically reply to RATS so
|
// When PN532 is in PICC target mode, it automatically reply to RATS so
|
||||||
|
@ -3027,7 +3027,7 @@ pn53x_get_information_about(nfc_device *pnd, char *buf, size_t buflen)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pn53x_current_target_new (const struct nfc_device *pnd, const nfc_target *pnt)
|
pn53x_current_target_new(const struct nfc_device *pnd, const nfc_target *pnt)
|
||||||
{
|
{
|
||||||
// Keep the current nfc_target for further commands
|
// Keep the current nfc_target for further commands
|
||||||
if (CHIP_DATA(pnd)->current_target) {
|
if (CHIP_DATA(pnd)->current_target) {
|
||||||
|
@ -3038,7 +3038,7 @@ pn53x_current_target_new (const struct nfc_device *pnd, const nfc_target *pnt)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pn53x_current_target_free (const struct nfc_device *pnd)
|
pn53x_current_target_free(const struct nfc_device *pnd)
|
||||||
{
|
{
|
||||||
if (CHIP_DATA(pnd)->current_target) {
|
if (CHIP_DATA(pnd)->current_target) {
|
||||||
free(CHIP_DATA(pnd)->current_target);
|
free(CHIP_DATA(pnd)->current_target);
|
||||||
|
@ -3047,13 +3047,13 @@ pn53x_current_target_free (const struct nfc_device *pnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
pn53x_current_target_is (const struct nfc_device *pnd, const nfc_target *pnt)
|
pn53x_current_target_is(const struct nfc_device *pnd, const nfc_target *pnt)
|
||||||
{
|
{
|
||||||
if ((CHIP_DATA(pnd)->current_target == NULL) || (pnt == NULL)) {
|
if ((CHIP_DATA(pnd)->current_target == NULL) || (pnt == NULL)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// XXX It will not work if t is not binary-equal to current target
|
// XXX It will not work if t is not binary-equal to current target
|
||||||
if (0 != memcmp (pnt, CHIP_DATA(pnd)->current_target, sizeof(nfc_target))) {
|
if (0 != memcmp(pnt, CHIP_DATA(pnd)->current_target, sizeof(nfc_target))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -614,9 +614,9 @@ nfc_initiator_deselect_target(nfc_device *pnd)
|
||||||
* Tests show that on average this way of communicating is much faster than using the regular driver/middle-ware (often supplied by manufacturers).
|
* Tests show that on average this way of communicating is much faster than using the regular driver/middle-ware (often supplied by manufacturers).
|
||||||
*
|
*
|
||||||
* @warning The configuration option \a NP_HANDLE_PARITY must be set to \c true (the default value).
|
* @warning The configuration option \a NP_HANDLE_PARITY must be set to \c true (the default value).
|
||||||
*
|
*
|
||||||
* @note When used with MIFARE Classic, NFC_ETGRELEASED error is returned if authentication command failed. You need to re-select the tag to operate with.
|
* @note When used with MIFARE Classic, NFC_ETGRELEASED error is returned if authentication command failed. You need to re-select the tag to operate with.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
nfc_initiator_transceive_bytes(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, uint8_t *pbtRx,
|
nfc_initiator_transceive_bytes(nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, uint8_t *pbtRx,
|
||||||
|
|
Loading…
Add table
Reference in a new issue