mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-19 05:53:45 +00:00
For the sake of consistency, rename all szRxLen to szRx and szTxLen to szTx
This commit is contained in:
@@ -45,7 +45,7 @@ main (int argc, const char *argv[])
|
||||
bool result;
|
||||
|
||||
byte_t abtRx[MAX_FRAME_LEN];
|
||||
size_t szRxLen;
|
||||
size_t szRx;
|
||||
const byte_t pncmd_diagnose_communication_line_test[] = { 0xD4, 0x00, 0x00, 0x06, 'l', 'i', 'b', 'n', 'f', 'c' };
|
||||
const byte_t pncmd_diagnose_rom_test[] = { 0xD4, 0x00, 0x01 };
|
||||
const byte_t pncmd_diagnose_ram_test[] = { 0xD4, 0x00, 0x02 };
|
||||
@@ -78,21 +78,21 @@ main (int argc, const char *argv[])
|
||||
|
||||
printf ("NFC device [%s] connected.\n", pnd->acName);
|
||||
|
||||
result = pn53x_transceive (pnd, pncmd_diagnose_communication_line_test, sizeof (pncmd_diagnose_communication_line_test), abtRx, &szRxLen);
|
||||
result = pn53x_transceive (pnd, pncmd_diagnose_communication_line_test, sizeof (pncmd_diagnose_communication_line_test), abtRx, &szRx);
|
||||
if (result) {
|
||||
result = (memcmp (pncmd_diagnose_communication_line_test + 2, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 2) == 0);
|
||||
}
|
||||
printf (" Communication line test: %s\n", result ? "OK" : "Failed");
|
||||
|
||||
result = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, &szRxLen);
|
||||
result = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, &szRx);
|
||||
if (result) {
|
||||
result = ((szRxLen == 1) && (abtRx[0] == 0x00));
|
||||
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
||||
}
|
||||
printf (" ROM test: %s\n", result ? "OK" : "Failed");
|
||||
|
||||
result = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, &szRxLen);
|
||||
result = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, &szRx);
|
||||
if (result) {
|
||||
result = ((szRxLen == 1) && (abtRx[0] == 0x00));
|
||||
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
||||
}
|
||||
printf (" RAM test: %s\n", result ? "OK" : "Failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user