Create pn53x_InDeselect function.

This commit is contained in:
Romuald Conty 2010-07-23 13:30:06 +00:00
parent 7eeb46ab68
commit edb62bd1cb
3 changed files with 14 additions and 3 deletions

View file

@ -300,3 +300,13 @@ pn53x_InListPassiveTarget(const nfc_device_t* pnd,
return false;
}
}
bool
pn53x_InDeselect(const nfc_device_t* pnd, const uint8_t ui8Target)
{
byte_t abtCmd[sizeof(pncmd_initiator_deselect)];
memcpy(abtCmd,pncmd_initiator_deselect,sizeof(pncmd_initiator_deselect));
abtCmd[2] = ui8Target;
return(pn53x_transceive(pnd,abtCmd,sizeof(abtCmd),NULL,NULL));
}

View file

@ -1,7 +1,7 @@
/*-
* Public platform independent Near Field Communication (NFC) library
*
* Copyright (C) 2009, Roel Verdult
* Copyright (C) 2009, 2010, Roel Verdult, Romuald Conty
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
@ -79,6 +79,7 @@ bool pn53x_unwrap_frame(const byte_t* pbtFrame, const size_t szFrameBits, byte_t
bool pn53x_decode_target_data(const byte_t* pbtRawData, size_t szDataLen, nfc_chip_t nc, nfc_target_type_t ntt, nfc_target_info_t* pnti);
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);
#endif // __NFC_CHIPS_PN53X_H__

View file

@ -53,7 +53,7 @@ extern const byte_t pncmd_rf_configure [ 14];
// extern const byte_t pncmd_initiator_list_passive [264];
extern const byte_t pncmd_initiator_jump_for_dep [ 68];
// extern const byte_t pncmd_initiator_select [ 3];
extern const byte_t pncmd_initiator_deselect [ 3];
// extern const byte_t pncmd_initiator_deselect [ 3];
// extern const byte_t pncmd_initiator_release [ 3];
// extern const byte_t pncmd_initiator_set_baud_rate [ 5];
extern const byte_t pncmd_initiator_exchange_data [265];
@ -550,7 +550,7 @@ nfc_initiator_select_passive_target(const nfc_device_t* pnd,
*/
bool nfc_initiator_deselect_target(const nfc_device_t* pnd)
{
return (pn53x_transceive(pnd,pncmd_initiator_deselect,3,NULL,NULL));
return (pn53x_InDeselect(pnd, 0)); // 0 mean deselect all selected targets
}
/**