mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-21 22:16:16 +00:00
Examples and utils are now updated to use the requiered nfc_context
This commit is contained in:
@@ -77,7 +77,8 @@ main(int argc, const char *argv[])
|
||||
|
||||
int ret = EXIT_FAILURE;
|
||||
|
||||
nfc_init(NULL);
|
||||
nfc_context *context;
|
||||
nfc_init(&context);
|
||||
|
||||
// Display libnfc version
|
||||
const char *acLibnfcVersion = nfc_version();
|
||||
@@ -85,7 +86,7 @@ main(int argc, const char *argv[])
|
||||
|
||||
// Open using the first available NFC device
|
||||
nfc_device *pnd;
|
||||
pnd = nfc_open(NULL, NULL);
|
||||
pnd = nfc_open(context, NULL);
|
||||
|
||||
if (pnd == NULL) {
|
||||
ERR("%s", "Unable to open NFC device.");
|
||||
@@ -211,7 +212,7 @@ error:
|
||||
|
||||
// Close NFC device
|
||||
nfc_close(pnd);
|
||||
nfc_exit(NULL);
|
||||
nfc_exit(context);
|
||||
|
||||
exit(ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user