add context to nfc_init(), nfc_exit(), nfc_open() and nfc_list_devices() functions.

This commit is contained in:
Audrey Diacre
2012-01-18 16:22:06 +00:00
parent 86c8ce536b
commit 4c011279ff
29 changed files with 142 additions and 138 deletions

View File

@@ -68,21 +68,21 @@ main (int argc, const char *argv[])
errx (1, "usage: %s", argv[0]);
}
nfc_init();
nfc_init (NULL);
// Display libnfc version
acLibnfcVersion = nfc_version ();
printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion);
nfc_connstring connstrings[MAX_DEVICE_COUNT];
size_t szFound = nfc_list_devices (connstrings, MAX_DEVICE_COUNT);
size_t szFound = nfc_list_devices (NULL, connstrings, MAX_DEVICE_COUNT);
if (szFound == 0) {
printf ("No NFC device found.\n");
}
for (i = 0; i < szFound; i++) {
pnd = nfc_open (connstrings[i]);
pnd = nfc_open (NULL, connstrings[i]);
if (pnd == NULL) {
ERR ("%s", "Unable to open NFC device.");