From 96538d052b4cef27f2520bd94fc78657cd3b43fc Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 25 May 2011 19:53:45 +0000 Subject: [PATCH] Extend max length for firmware description & fix typo --- examples/doc/quick_start_example1.c | 2 +- examples/nfc-emulate-tag.c | 2 +- examples/nfc-list.c | 2 +- examples/nfc-poll.c | 2 +- examples/nfc-relay-picc.c | 2 +- examples/nfc-relay.c | 2 +- examples/pn53x-diagnose.c | 2 +- examples/pn53x-sam.c | 2 +- libnfc/chips/pn53x.c | 10 +++++----- libnfc/chips/pn53x.h | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/doc/quick_start_example1.c b/examples/doc/quick_start_example1.c index fe67f33..9d32642 100644 --- a/examples/doc/quick_start_example1.c +++ b/examples/doc/quick_start_example1.c @@ -15,7 +15,7 @@ main (int argc, const char *argv[]) // Display libnfc version const char *acLibnfcVersion = nfc_version (); - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); // Connect using the first available NFC device pnd = nfc_connect (NULL); diff --git a/examples/nfc-emulate-tag.c b/examples/nfc-emulate-tag.c index c47f203..f4765c8 100644 --- a/examples/nfc-emulate-tag.c +++ b/examples/nfc-emulate-tag.c @@ -184,7 +184,7 @@ main (int argc, char *argv[]) // Display libnfc version acLibnfcVersion = nfc_version (); - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); if (pnd == NULL) { ERR("Unable to connect to NFC device"); diff --git a/examples/nfc-list.c b/examples/nfc-list.c index b4b5c98..8925f26 100644 --- a/examples/nfc-list.c +++ b/examples/nfc-list.c @@ -71,7 +71,7 @@ main (int argc, const char *argv[]) // Display libnfc version acLibnfcVersion = nfc_version (); - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); pnddDevices = parse_args (argc, argv, &szDeviceFound, &verbose); #ifdef HAVE_LIBUSB diff --git a/examples/nfc-poll.c b/examples/nfc-poll.c index bc5e4c8..5727d0f 100644 --- a/examples/nfc-poll.c +++ b/examples/nfc-poll.c @@ -81,7 +81,7 @@ main (int argc, const char *argv[]) errx (1, "usage: %s", argv[0]); } - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); if (szFound == 0) { if (!(pnddDevices = malloc (MAX_DEVICE_COUNT * sizeof (*pnddDevices)))) { diff --git a/examples/nfc-relay-picc.c b/examples/nfc-relay-picc.c index 110f057..b351ca8 100644 --- a/examples/nfc-relay-picc.c +++ b/examples/nfc-relay-picc.c @@ -195,7 +195,7 @@ main (int argc, char *argv[]) } // Display libnfc version - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); #ifdef WIN32 signal (SIGINT, (void (__cdecl *) (int)) intr_hdlr); diff --git a/examples/nfc-relay.c b/examples/nfc-relay.c index 4a3ab07..e46c5df 100644 --- a/examples/nfc-relay.c +++ b/examples/nfc-relay.c @@ -101,7 +101,7 @@ main (int argc, char *argv[]) } // Display libnfc version - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); #ifdef WIN32 signal (SIGINT, (void (__cdecl *) (int)) intr_hdlr); diff --git a/examples/pn53x-diagnose.c b/examples/pn53x-diagnose.c index aea6597..fb57f67 100644 --- a/examples/pn53x-diagnose.c +++ b/examples/pn53x-diagnose.c @@ -64,7 +64,7 @@ main (int argc, const char *argv[]) } // Display libnfc version acLibnfcVersion = nfc_version (); - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); if (!(pnddDevices = malloc (MAX_DEVICE_COUNT * sizeof (*pnddDevices)))) { fprintf (stderr, "malloc() failed\n"); diff --git a/examples/pn53x-sam.c b/examples/pn53x-sam.c index 6b707a9..1e0142f 100644 --- a/examples/pn53x-sam.c +++ b/examples/pn53x-sam.c @@ -128,7 +128,7 @@ main (int argc, const char *argv[]) // Display libnfc version const char *acLibnfcVersion = nfc_version (); - printf ("%s use libnfc %s\n", argv[0], acLibnfcVersion); + printf ("%s uses libnfc %s\n", argv[0], acLibnfcVersion); // Connect using the first available NFC device pnd = nfc_connect (NULL); diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index a559101..6d9b8c3 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -64,7 +64,7 @@ bool pn53x_init(nfc_device_t * pnd) { // GetFirmwareVersion command is used to set PN53x chips type (PN531, PN532 or PN533) - char abtFirmwareText[18]; + char abtFirmwareText[22]; if (!pn53x_get_firmware_version (pnd, abtFirmwareText)) { return false; } @@ -579,7 +579,7 @@ pn53x_writeback_register (nfc_device_t * pnd) } bool -pn53x_get_firmware_version (nfc_device_t * pnd, char abtFirmwareText[18]) +pn53x_get_firmware_version (nfc_device_t * pnd, char abtFirmwareText[22]) { const byte_t abtCmd[] = { GetFirmwareVersion }; byte_t abtFw[4]; @@ -606,15 +606,15 @@ pn53x_get_firmware_version (nfc_device_t * pnd, char abtFirmwareText[18]) // Convert firmware info in text, PN531 gives 2 bytes info, but PN532 and PN533 gives 4 switch (CHIP_DATA(pnd)->type) { case PN531: - snprintf (abtFirmwareText, 18, "PN531 v%d.%d", abtFw[0], abtFw[1]); + snprintf (abtFirmwareText, 22, "PN531 v%d.%d", abtFw[0], abtFw[1]); pnd->btSupportByte = SUPPORT_ISO14443A | SUPPORT_ISO18092; break; case PN532: - snprintf (abtFirmwareText, 18, "PN532 v%d.%d (0x%02x)", abtFw[1], abtFw[2], abtFw[3]); + snprintf (abtFirmwareText, 22, "PN532 v%d.%d (0x%02x)", abtFw[1], abtFw[2], abtFw[3]); pnd->btSupportByte = abtFw[3]; break; case PN533: - snprintf (abtFirmwareText, 18, "PN533 v%d.%d (0x%02x)", abtFw[1], abtFw[2], abtFw[3]); + snprintf (abtFirmwareText, 22, "PN533 v%d.%d (0x%02x)", abtFw[1], abtFw[2], abtFw[3]); pnd->btSupportByte = abtFw[3]; break; } diff --git a/libnfc/chips/pn53x.h b/libnfc/chips/pn53x.h index 3fdda3f..04fa4da 100644 --- a/libnfc/chips/pn53x.h +++ b/libnfc/chips/pn53x.h @@ -264,7 +264,7 @@ bool pn53x_decode_target_data (const byte_t * pbtRawData, size_t szRawData, nfc_target_info_t * pnti); bool pn53x_read_register (nfc_device_t * pnd, uint16_t ui16Reg, uint8_t * ui8Value); bool pn53x_write_register (nfc_device_t * pnd, uint16_t ui16Reg, uint8_t ui8SymbolMask, uint8_t ui8Value); -bool pn53x_get_firmware_version (nfc_device_t * pnd, char abtFirmwareText[18]); +bool pn53x_get_firmware_version (nfc_device_t * pnd, char abtFirmwareText[22]); bool pn53x_configure (nfc_device_t * pnd, const nfc_device_option_t ndo, const bool bEnable); bool pn53x_check_communication (nfc_device_t *pnd); bool pn53x_idle (nfc_device_t * pnd);