mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-10 17:43:49 +00:00
Factorise code.
Avoid redundant code in PN53x usb and uart drivers. Since it makes sense to report errors at the nfc_device_t level, pass it directly to pn53x_transceive(). Programs using the libnfc MAY use pn53x_transceive() to communicate with a NFC device, and SHALL not use anymore pnd->pdc->transceive(). Code in the library itself SHOULD avoid calling pnd->pdc->transceive(), so such construct have been updated accordingly.
This commit is contained in:
@@ -318,7 +318,7 @@ bool nfc_configure(nfc_device_t* pnd, const nfc_device_option_t ndo, const bool
|
||||
* After initialization it can be used to communicate to passive RFID tags and active NFC devices.
|
||||
* The reader will act as initiator to communicate peer 2 peer (NFCIP) to other active NFC devices.
|
||||
*/
|
||||
bool nfc_initiator_init(const nfc_device_t* pnd)
|
||||
bool nfc_initiator_init(nfc_device_t* pnd)
|
||||
{
|
||||
// Make sure we are dealing with a active device
|
||||
if (!pnd->bActive) return false;
|
||||
@@ -412,7 +412,7 @@ bool nfc_initiator_select_dep_target(nfc_device_t* pnd, const nfc_modulation_t n
|
||||
* @note For every initial modulation type there is a different collection of information returned (in nfc_target_info_t pointer pti) They all fit in the data-type which is called nfc_target_info_t. This is a union which contains the tag information that belongs to the according initial modulation type.
|
||||
*/
|
||||
bool
|
||||
nfc_initiator_select_passive_target(const nfc_device_t* pnd,
|
||||
nfc_initiator_select_passive_target(nfc_device_t* pnd,
|
||||
const nfc_modulation_t nmInitModulation,
|
||||
const byte_t* pbtInitData, const size_t szInitDataLen,
|
||||
nfc_target_info_t* pnti)
|
||||
|
||||
Reference in New Issue
Block a user