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:
Romuald Conty
2012-05-17 00:48:47 +00:00
parent 6710ca943e
commit e4802de965
16 changed files with 269 additions and 69 deletions

View File

@@ -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);
}
}