Merge r478-485 from trunk.

This commit is contained in:
Romain Tartiere 2010-07-30 16:34:12 +00:00
commit 36ee32f81a
8 changed files with 152 additions and 58 deletions

View file

@ -272,6 +272,20 @@ pn53x_decode_target_data(const byte_t* pbtRawData, size_t szDataLen, nfc_chip_t
return true;
}
/**
* @brief C wrapper to InListPassiveTarget command
* @return true if command is successfully sent
*
* @param pnd nfc_device_t struct pointer that represent currently used device
* @param nmInitModulation Desired modulation
* @param pbtInitiatorData Optional initiator data used for Felica, ISO14443B, Topaz Polling or for ISO14443A selecting a specific UID
* @param szInitiatorDataLen Length of initiator data \a pbtInitiatorData
* @param pbtTargetsData pointer on a pre-allocated byte array to receive TargetData[n] as described in pn53x user manual
* @param pszTargetsData size_t pointer where size of \a pbtTargetsData will be written
*
* @note Selected targets count can be found in \a pbtTargetsData[0] if available (i.e. \a pszTargetsData content is more than 0)
* @note To decode theses TargetData[n], there is @fn pn53x_decode_target_data
*/
bool
pn53x_InListPassiveTarget(const nfc_device_t* pnd,
const nfc_modulation_t nmInitModulation, const byte_t szMaxTargets,
@ -281,6 +295,7 @@ pn53x_InListPassiveTarget(const nfc_device_t* pnd,
byte_t abtCmd[sizeof(pncmd_initiator_list_passive)];
memcpy(abtCmd,pncmd_initiator_list_passive,sizeof(pncmd_initiator_list_passive));
// FIXME PN531 doesn't support all available modulations
abtCmd[2] = szMaxTargets; // MaxTg
abtCmd[3] = nmInitModulation; // BrTy, the type of init modulation used for polling a passive tag