mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-07-23 04:01:56 +00:00
Add new public functions to grab information in string format:
- New nfc_device_get_information_about() - Moved nfc-utils function str_nfc_baud_rate() - New str_nfc_modulation_type() - Add new device_get_information_about callback to nfc_driver struct - Export new symbols - Changed internal pn53x firmware text handling: we now store firmware text for further operations - print_nfc_target() now uses str_nfc_* functions - nfc-probe util now have a verbose which display information on detected devices (Fix verbose set but not used warning ;-) )
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2009, Roel Verdult
|
||||
* Copyright (C) 2010, Romuald Conty, Romain Tartière
|
||||
* Copyright (C) 2011-2012, Romuald Conty
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -103,10 +104,16 @@ main (int argc, const char *argv[])
|
||||
}
|
||||
|
||||
printf ("%d NFC device(s) found:\n", (int)szDeviceFound);
|
||||
char strinfo[1024];
|
||||
for (i = 0; i < szDeviceFound; i++) {
|
||||
pnd = nfc_open (NULL, connstrings[i]);
|
||||
if (pnd != NULL) {
|
||||
printf ("- %s:\n %s\n", nfc_device_get_name (pnd), nfc_device_get_connstring (pnd));
|
||||
if (verbose) {
|
||||
if (nfc_device_get_information_about (pnd, strinfo, sizeof(strinfo)) >= 0) {
|
||||
printf ("%s", strinfo);
|
||||
}
|
||||
}
|
||||
nfc_close (pnd);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user