mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-07-25 21:22:00 +00:00
rx buffer size parameter of pn53x_transceive() function is now a const size_t.
This commit is contained in:
@@ -89,8 +89,9 @@ main (int argc, const char *argv[])
|
||||
|
||||
printf ("NFC device [%s] connected.\n", nfc_device_get_name (pnd));
|
||||
|
||||
res = pn53x_transceive (pnd, pncmd_diagnose_communication_line_test, sizeof (pncmd_diagnose_communication_line_test), abtRx, &szRx, 0);
|
||||
if (res == 0) {
|
||||
res = pn53x_transceive (pnd, pncmd_diagnose_communication_line_test, sizeof (pncmd_diagnose_communication_line_test), abtRx, szRx, 0);
|
||||
if (res > 0) {
|
||||
szRx = (size_t) res;
|
||||
// Result of Diagnose ping for RC-S360 doesn't contain status byte so we've to handle both cases
|
||||
result = (memcmp (pncmd_diagnose_communication_line_test + 1, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 1) == 0) ||
|
||||
(memcmp (pncmd_diagnose_communication_line_test + 2, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 2) == 0);
|
||||
@@ -99,16 +100,18 @@ main (int argc, const char *argv[])
|
||||
}
|
||||
printf (" Communication line test: %s\n", result ? "OK" : "Failed");
|
||||
|
||||
res = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, &szRx, 0);
|
||||
if (res == 0) {
|
||||
res = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, szRx, 0);
|
||||
if (res > 0) {
|
||||
szRx = (size_t) res;
|
||||
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
||||
} else {
|
||||
nfc_perror (pnd, "pn53x_transceive");
|
||||
}
|
||||
printf (" ROM test: %s\n", result ? "OK" : "Failed");
|
||||
|
||||
res = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, &szRx, 0);
|
||||
if (res == 0) {
|
||||
res = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, szRx, 0);
|
||||
if (res > 0) {
|
||||
szRx = (size_t) res;
|
||||
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
||||
} else {
|
||||
nfc_perror (pnd, "pn53x_transceive");
|
||||
|
||||
Reference in New Issue
Block a user