From 3aadb459887b8337dc22fc3e8fea92a3b6473b52 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Sat, 2 Mar 2013 10:59:37 +0100 Subject: [PATCH] Ease diff between both libusb based drivers: acr122_usb and pn53x_usb --- libnfc/drivers/acr122_usb.c | 3 ++- libnfc/drivers/pn53x_usb.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libnfc/drivers/acr122_usb.c b/libnfc/drivers/acr122_usb.c index 6240fd3..976f6e0 100644 --- a/libnfc/drivers/acr122_usb.c +++ b/libnfc/drivers/acr122_usb.c @@ -160,6 +160,7 @@ struct acr122_usb_apdu_frame { }; #pragma pack() +// Internal data struct struct acr122_usb_data { usb_dev_handle *pudh; acr122_usb_model model; @@ -191,7 +192,7 @@ const uint8_t acr122_usb_frame_template[] = { // APDUs instructions #define APDU_GetAdditionnalData 0xc0 -// Internal data struct +// Internal io struct const struct pn53x_io acr122_usb_io; // Prototypes diff --git a/libnfc/drivers/pn53x_usb.c b/libnfc/drivers/pn53x_usb.c index 859c93e..747c6ec 100644 --- a/libnfc/drivers/pn53x_usb.c +++ b/libnfc/drivers/pn53x_usb.c @@ -65,7 +65,7 @@ typedef enum { SONY_RCS360 } pn53x_usb_model; -// Internal data structs +// Internal data struct struct pn53x_usb_data { usb_dev_handle *pudh; pn53x_usb_model model; @@ -75,6 +75,7 @@ struct pn53x_usb_data { volatile bool abort_flag; }; +// Internal io struct const struct pn53x_io pn53x_usb_io; // Prototypes @@ -174,7 +175,9 @@ static size_t pn53x_usb_scan(const nfc_context *context, nfc_connstring connstrings[], const size_t connstrings_len) { (void)context; + usb_prepare(); + size_t device_found = 0; uint32_t uiBusIndex = 0; struct usb_bus *bus; @@ -736,6 +739,7 @@ const struct pn53x_io pn53x_usb_io = { const struct nfc_driver pn53x_usb_driver = { .name = PN53X_USB_DRIVER_NAME, + .scan_type = NOT_INTRUSIVE, .scan = pn53x_usb_scan, .open = pn53x_usb_open, .close = pn53x_usb_close,