From 8e5d235cd2d802a44dc50d2da483f49c9be7324e Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Fri, 6 Aug 2010 07:29:57 +0000 Subject: [PATCH] Implement pn53x_InRelease(). I used it for some experiments and guess that it should be part of the API. --- libnfc/chips/pn53x.c | 10 ++++++++++ libnfc/chips/pn53x.h | 1 + 2 files changed, 11 insertions(+) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 2ee216b..2431ea7 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -325,3 +325,13 @@ pn53x_InDeselect(const nfc_device_t* pnd, const uint8_t ui8Target) return(pn53x_transceive(pnd,abtCmd,sizeof(abtCmd),NULL,NULL)); } + +bool +pn53x_InRelease(nfc_device_t* pnd, const uint8_t ui8Target) +{ + byte_t abtCmd[sizeof(pncmd_initiator_release)]; + memcpy(abtCmd,pncmd_initiator_release,sizeof(pncmd_initiator_release)); + abtCmd[2] = ui8Target; + + return(pn53x_transceive(pnd,abtCmd,sizeof(abtCmd),NULL,NULL)); +} diff --git a/libnfc/chips/pn53x.h b/libnfc/chips/pn53x.h index cc6ce59..fbcc784 100644 --- a/libnfc/chips/pn53x.h +++ b/libnfc/chips/pn53x.h @@ -80,6 +80,7 @@ bool pn53x_decode_target_data(const byte_t* pbtRawData, size_t szDataLen, nfc_ch bool pn53x_InListPassiveTarget(const nfc_device_t* pnd, const nfc_modulation_t nmInitModulation, const byte_t szMaxTargets, const byte_t* pbtInitiatorData, const size_t szInitiatorDataLen, byte_t* pbtTargetsData, size_t* pszTargetsData); bool pn53x_InDeselect(const nfc_device_t* pnd, const uint8_t ui8Target); +bool pn53x_InRelease(nfc_device_t* pnd, const uint8_t ui8Target); #endif // __NFC_CHIPS_PN53X_H__