Merge r499-510 from trunk.

This commit is contained in:
Romain Tartiere 2010-08-10 21:14:13 +00:00
commit dfb82f8893
15 changed files with 94 additions and 86 deletions

View file

@ -337,6 +337,7 @@ pn53x_InListPassiveTarget(nfc_device_t* pnd,
const byte_t* pbtInitiatorData, const size_t szInitiatorDataLen,
byte_t* pbtTargetsData, size_t* pszTargetsData)
{
size_t szRxLen;
byte_t abtCmd[sizeof(pncmd_initiator_list_passive)];
memcpy(abtCmd,pncmd_initiator_list_passive,sizeof(pncmd_initiator_list_passive));
@ -348,7 +349,7 @@ pn53x_InListPassiveTarget(nfc_device_t* pnd,
if (pbtInitiatorData) memcpy(abtCmd+4,pbtInitiatorData,szInitiatorDataLen);
// Try to find a tag, call the tranceive callback function of the current device
size_t szRxLen = MAX_FRAME_LEN;
szRxLen = MAX_FRAME_LEN;
if(pn53x_transceive(pnd,abtCmd,4+szInitiatorDataLen,pbtTargetsData,&szRxLen)) {
*pszTargetsData = szRxLen;
return true;
@ -367,6 +368,16 @@ pn53x_InDeselect(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));
}
struct sErrorMessage {
int iErrorCode;
const char *pcErrorMsg;

View file

@ -81,6 +81,7 @@ bool pn53x_decode_target_data(const byte_t* pbtRawData, size_t szDataLen, nfc_ch
bool pn53x_InListPassiveTarget(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(nfc_device_t* pnd, const uint8_t ui8Target);
bool pn53x_InRelease(nfc_device_t* pnd, const uint8_t ui8Target);
const char *pn53x_strerror (const nfc_device_t *pnd);