libnfc
1.7.1
|
The functionality documented below is designed to help with the following operations: More...
Functions | |
nfc_device * | nfc_open (nfc_context *context, const nfc_connstring connstring) |
Open a NFC device. More... | |
void | nfc_close (nfc_device *pnd) |
Close from a NFC device. More... | |
size_t | nfc_list_devices (nfc_context *context, nfc_connstring connstrings[], const size_t connstrings_len) |
Scan for discoverable supported devices (ie. only available for some drivers) More... | |
int | nfc_idle (nfc_device *pnd) |
Turn NFC device in idle mode. More... | |
int | nfc_abort_command (nfc_device *pnd) |
Abort current running command. More... | |
The functionality documented below is designed to help with the following operations:
int nfc_abort_command | ( | nfc_device * | pnd | ) |
Abort current running command.
pnd | nfc_device struct pointer that represent currently used device |
Some commands (ie. nfc_target_init()) are blocking functions and will return only in particular conditions (ie. external initiator request). This function attempt to abort the current running command.
void nfc_close | ( | nfc_device * | pnd | ) |
Close from a NFC device.
pnd | nfc_device struct pointer that represent currently used device |
Initiator's selected tag is closed and the device, including allocated nfc_device struct, is released.
int nfc_idle | ( | nfc_device * | pnd | ) |
Turn NFC device in idle mode.
pnd | nfc_device struct pointer that represent currently used device |
This function switch the device in idle mode. In initiator mode, the RF field is turned off and the device is set to low power mode (if avaible); In target mode, the emulation is stoped (no target available from external initiator) and the device is set to low power mode (if avaible).
size_t nfc_list_devices | ( | nfc_context * | context, |
nfc_connstring | connstrings[], | ||
const size_t | connstrings_len | ||
) |
Scan for discoverable supported devices (ie. only available for some drivers)
context | The context to operate on, or NULL for the default context. |
connstrings | array of nfc_connstring. |
connstrings_len | size of the connstrings array. |
nfc_device* nfc_open | ( | nfc_context * | context, |
const nfc_connstring | connstring | ||
) |
Open a NFC device.
context | The context to operate on. |
connstring | The device connection string if specific device is wanted, NULL otherwise |
NULL
value.If connstring is NULL
, the first available device from nfc_list_devices function is used.
If connstring is set, this function will try to claim the right device using information provided by connstring.
When it has successfully claimed a NFC device, memory is allocated to save the device information. It will return a pointer to a nfc_device struct. This pointer should be supplied by every next functions of libnfc that should perform an action with this device.