add CRC check to ISO15693 (Bjoern Riemer)
authorHarald Welte <laforge@gnumonks.org>
Sat, 24 May 2008 13:23:03 +0000 (13:23 +0000)
committerHarald Welte <laforge@gnumonks.org>
Sat, 24 May 2008 13:23:03 +0000 (13:23 +0000)
git-svn-id: https://svn.gnumonks.org/trunk/librfid@2104 e0336214-984f-0b4b-a45f-81c69e1f0ede

src/rfid_asic_rc632.c

index c93ba81..1c64558 100644 (file)
@@ -521,7 +521,7 @@ rc632_transceive(struct rfid_asic_handle *handle,
                rc632_reg_read(handle, RC632_REG_CHANNEL_REDUNDANCY, &tmp);
 
                //return 0;
-               return -1;
+               return -EIO;
        }
 
        return rc632_fifo_read(handle, *rx_len, rx_buf);
@@ -1769,7 +1769,7 @@ rc632_iso15693_transceive_ac(struct rfid_asic_handle *handle,
        ret = rc632_transceive(handle, (u_int8_t *)acf, acf_len,
                               (u_int8_t *) resp, rx_len, 
                               iso15693_timing[rate][ISO15693_T1], 0);
-       if (ret == -ETIMEDOUT)
+       if (ret == -ETIMEDOUT || ret == -EIO)
                return ret;
 
        /* determine whether there was a collission */
@@ -1787,6 +1787,8 @@ rc632_iso15693_transceive_ac(struct rfid_asic_handle *handle,
                *bit_of_col = boc;
        } else {
                *bit_of_col = 0;
+               if (error_flag & RC632_ERR_FLAG_CRC_ERR)
+                       return -EIO;
        }
 
        return 0;