#include <string.h>
#include <errno.h>
-#include <usb.h>
#include <librfid/rfid.h>
#include <librfid/rfid_reader.h>
#ifndef LIBRFID_FIRMWARE
+#include <usb.h>
static struct usb_device *dev;
static struct usb_dev_handle *hdl;
ret = openpcd_send_command(cmd, reg, val, len, data);
if (ret < 0)
return ret;
- if (ret < sizeof(sizeof(struct openpcd_hdr)))
+ if (ret < sizeof(struct openpcd_hdr))
return -EINVAL;
return openpcd_recv_reply();
static int openpcd_reg_write(struct rfid_asic_transport_handle *rath,
unsigned char reg, unsigned char value)
{
+ return opcd_rc632_reg_write(rath, reg, value);
}
static int openpcd_reg_read(struct rfid_asic_transport_handle *rath,
unsigned char reg,
unsigned char *value)
{
+ return opcd_rc632_reg_read(rath, reg, value);
}
unsigned char num_bytes,
unsigned char *buf)
{
+ return opcd_rc632_fifo_read(rath, num_bytes, buf);
}
static int openpcd_fifo_write(struct rfid_asic_transport_handle *rath,
const unsigned char *bytes,
unsigned char flags)
{
+ return opcd_rc632_fifo_write(rath, len, bytes, flags);
}
const struct rfid_asic_transport openpcd_rat = {
snd_hdr = (struct openpcd_hdr *)snd_buf;
rcv_hdr = (struct openpcd_hdr *)rcv_buf;
+#ifndef LIBRFID_FIRMWARE
usb_init();
if (usb_find_busses() < 0)
return NULL;
usb_close(hdl);
return NULL;
}
+#endif
rh = malloc_reader_handle(sizeof(*rh));
if (!rh)
free_rat_handle(rath);
free_reader_handle(rh);
+#ifndef LIBRFID_FIRMWARE
usb_close(hdl);
+#endif
}
const struct rfid_reader rfid_reader_openpcd = {
.iso14443b = {
.init = &openpcd_14443b_init,
},
+ .iso15693 = {
+ .init = &openpcd_15693_init,
+ },
.mifare_classic = {
.setkey = &openpcd_mifare_setkey,
.auth = &openpcd_mifare_auth,