Timeout is now integer.

This commit is contained in:
Audrey Diacre 2011-11-25 11:37:30 +00:00
parent dad3603936
commit 5c7454a2f7
29 changed files with 133 additions and 145 deletions

View file

@ -100,7 +100,7 @@ nfc_initiator_mifare_cmd (nfc_device * pnd, const mifare_cmd mc, const uint8_t u
return false;
}
// Fire the mifare command
if (!nfc_initiator_transceive_bytes (pnd, abtCmd, 2 + szParamLen, abtRx, &szRx, NULL)) {
if (!nfc_initiator_transceive_bytes (pnd, abtCmd, 2 + szParamLen, abtRx, &szRx, 0)) {
if (pnd->iLastError == EINVRXFRAM) {
// "Invalid received frame" AKA EINVRXFRAM, usual means we are
// authenticated on a sector but the requested MIFARE cmd (read, write)

View file

@ -116,7 +116,7 @@ transmit_bytes (const uint8_t * pbtTx, const size_t szTx)
printf ("Sent bits: ");
print_hex (pbtTx, szTx);
// Transmit the command bytes
if (!nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, NULL))
if (!nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, 0))
return false;
// Show received answer

View file

@ -118,7 +118,7 @@ transmit_bytes (const uint8_t * pbtTx, const size_t szTx)
print_hex (pbtTx, szTx);
}
// Transmit the command bytes
if (!nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, NULL))
if (!nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, 0))
return false;
// Show received answer

View file

@ -116,7 +116,7 @@ nfc_forum_tag_type3_check (nfc_device *pnd, const nfc_target nt, const uint16_t
uint8_t res[1024];
size_t res_len;
if (!nfc_initiator_transceive_bytes (pnd, frame, frame_len, res, &res_len, NULL)) {
if (!nfc_initiator_transceive_bytes (pnd, frame, frame_len, res, &res_len, 0)) {
return -1;
}
const size_t res_overhead = 1 + 1 + 8 + 2; // 1+1+8+2: LEN + CMD + NFCID2 + STATUS

View file

@ -370,7 +370,7 @@ main (int argc, char *argv[])
bool ret;
if (!initiator_only_mode) {
// Receive external reader command through target
if (!nfc_target_receive_bytes(pndTarget,abtCapdu,&szCapduLen, NULL)) {
if (!nfc_target_receive_bytes(pndTarget,abtCapdu,&szCapduLen, 0)) {
nfc_perror (pndTarget, "nfc_target_receive_bytes");
if (!target_only_mode) {
nfc_disconnect (pndInitiator);
@ -401,7 +401,7 @@ main (int argc, char *argv[])
if (!target_only_mode) {
// Forward the frame to the original tag
ret = nfc_initiator_transceive_bytes
(pndInitiator, abtCapdu, szCapduLen, abtRapdu, &szRapduLen, NULL);
(pndInitiator, abtCapdu, szCapduLen, abtRapdu, &szRapduLen, 0);
} else {
if (scan_hex_fd3(abtRapdu, &szRapduLen, "R-APDU") != EXIT_SUCCESS) {
fprintf (stderr, "Error while scanning R-APDU from FD3\n");
@ -425,7 +425,7 @@ main (int argc, char *argv[])
}
if (!initiator_only_mode) {
// Transmit the response bytes
if (!nfc_target_send_bytes(pndTarget, abtRapdu, szRapduLen, NULL)) {
if (!nfc_target_send_bytes(pndTarget, abtRapdu, szRapduLen, 0)) {
nfc_perror (pndTarget, "nfc_target_send_bytes");
if (!target_only_mode) {
nfc_disconnect (pndInitiator);