- memset(uuid_list_valid, MY_NONE, 16);
- memset(uuid_list, 0, ISO15693_UID_LEN * 16);
-
- memset(&acf, 0, sizeof(struct iso15693_anticol_cmd));
- acf.afi = 0;
- acf.flags = RFID_15693_F5_NSLOTS_1 | /* comment out for 16 slots */
- RFID_15693_F_INV_TABLE_5 |
- RFID_15693_F_RATE_HIGH;
- //RFID_15693_F_SUBC_TWO
- acf.mask_len = 0;
- //acf.mask_bits[0] = 3;
- acf.current_slot = 0;
-
- if (acf.flags & RFID_15693_F5_NSLOTS_1)
- i = 1;
- else
- i = 16;
- for (; i >=1; i--) {
- //acf.current_slot=0;
- ret = iso15693_transceive_acf(handle, &acf, &uuid[0], &boc);
- switch (ret) {
- case -ETIMEDOUT:
- DEBUGP("no answer from vicc in slot %d\n",
- acf.current_slot);
- uuid_list_valid[acf.current_slot] = MY_NONE;
- break;
- case -ECOLLISION:
- DEBUGP("Collision during anticol. slot %d bit %d\n",
- acf.current_slot,boc);
- uuid_list_valid[acf.current_slot] = -boc;
- memcpy(uuid_list[acf.current_slot], uuid, ISO15693_UID_LEN);
- break;
- default:
- if (ret < 0) {
- DEBUGP("ERROR ret: %d, slot %d\n", ret,
- acf.current_slot);
- uuid_list_valid[acf.current_slot] = MY_NONE;
+ memset(uuid_list_valid, MY_NONE, sizeof(uuid_list_valid));
+ memset(uuid_list, 0, sizeof(uuid_list));
+
+ //memset(&acf, 0, sizeof(acf));
+
+ /* FIXME: we can't use multiple slots at this point, since the RC632
+ * with librfid on the host PC has too much latency between 'EOF pulse
+ * to mark start of next slot' and 'receive data' commands :( */
+
+ flags = RFID_15693_F_INV_TABLE_5;
+ if (handle->priv.iso15693.vicc_fast)
+ flags |= RFID_15693_F_RATE_HIGH;
+ if (handle->priv.iso15693.vicc_two_subc)
+ flags |= RFID_15693_F_SUBC_TWO;
+ if (handle->priv.iso15693.single_slot) {
+ flags |= RFID_15693_F5_NSLOTS_1;
+ num_slots = 1;
+ }
+ if (handle->priv.iso15693.use_afi)
+ flags |= RFID_15693_F5_AFI_PRES;
+
+ tx_len = iso15693_build_acf((u_int8_t *)&acf, flags,
+ handle->priv.iso15693.afi, 0, NULL);
+
+ for (i = 0; i < num_slots; i++) {
+ rx_len = sizeof(resp);
+ ret = iso15693_transceive_acf(handle, (u_int8_t *) &acf, tx_len, &resp, &rx_len, &boc);
+ if (ret == -ETIMEDOUT) {
+ DEBUGP("no answer from vicc in slot %d\n", i);
+ uuid_list_valid[i] = MY_NONE;
+ } else if (ret < 0) {
+ DEBUGP("ERROR ret: %d, slot %d\n", ret, i);
+ uuid_list_valid[i] = MY_NONE;
+ } else {
+
+ if (boc) {
+ DEBUGP("Collision during anticol. slot %d bit %d\n",
+ i, boc);
+ uuid_list_valid[i] = -boc;
+ memcpy(uuid_list[i], resp.uuid, ISO15693_UID_LEN);