Ease diff between both libusb based drivers: acr122_usb and pn53x_usb
This commit is contained in:
parent
b2b1d2a2a2
commit
3aadb45988
2 changed files with 7 additions and 2 deletions
|
@ -160,6 +160,7 @@ struct acr122_usb_apdu_frame {
|
||||||
};
|
};
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
// Internal data struct
|
||||||
struct acr122_usb_data {
|
struct acr122_usb_data {
|
||||||
usb_dev_handle *pudh;
|
usb_dev_handle *pudh;
|
||||||
acr122_usb_model model;
|
acr122_usb_model model;
|
||||||
|
@ -191,7 +192,7 @@ const uint8_t acr122_usb_frame_template[] = {
|
||||||
// APDUs instructions
|
// APDUs instructions
|
||||||
#define APDU_GetAdditionnalData 0xc0
|
#define APDU_GetAdditionnalData 0xc0
|
||||||
|
|
||||||
// Internal data struct
|
// Internal io struct
|
||||||
const struct pn53x_io acr122_usb_io;
|
const struct pn53x_io acr122_usb_io;
|
||||||
|
|
||||||
// Prototypes
|
// Prototypes
|
||||||
|
|
|
@ -65,7 +65,7 @@ typedef enum {
|
||||||
SONY_RCS360
|
SONY_RCS360
|
||||||
} pn53x_usb_model;
|
} pn53x_usb_model;
|
||||||
|
|
||||||
// Internal data structs
|
// Internal data struct
|
||||||
struct pn53x_usb_data {
|
struct pn53x_usb_data {
|
||||||
usb_dev_handle *pudh;
|
usb_dev_handle *pudh;
|
||||||
pn53x_usb_model model;
|
pn53x_usb_model model;
|
||||||
|
@ -75,6 +75,7 @@ struct pn53x_usb_data {
|
||||||
volatile bool abort_flag;
|
volatile bool abort_flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Internal io struct
|
||||||
const struct pn53x_io pn53x_usb_io;
|
const struct pn53x_io pn53x_usb_io;
|
||||||
|
|
||||||
// Prototypes
|
// Prototypes
|
||||||
|
@ -174,7 +175,9 @@ static size_t
|
||||||
pn53x_usb_scan(const nfc_context *context, nfc_connstring connstrings[], const size_t connstrings_len)
|
pn53x_usb_scan(const nfc_context *context, nfc_connstring connstrings[], const size_t connstrings_len)
|
||||||
{
|
{
|
||||||
(void)context;
|
(void)context;
|
||||||
|
|
||||||
usb_prepare();
|
usb_prepare();
|
||||||
|
|
||||||
size_t device_found = 0;
|
size_t device_found = 0;
|
||||||
uint32_t uiBusIndex = 0;
|
uint32_t uiBusIndex = 0;
|
||||||
struct usb_bus *bus;
|
struct usb_bus *bus;
|
||||||
|
@ -736,6 +739,7 @@ const struct pn53x_io pn53x_usb_io = {
|
||||||
|
|
||||||
const struct nfc_driver pn53x_usb_driver = {
|
const struct nfc_driver pn53x_usb_driver = {
|
||||||
.name = PN53X_USB_DRIVER_NAME,
|
.name = PN53X_USB_DRIVER_NAME,
|
||||||
|
.scan_type = NOT_INTRUSIVE,
|
||||||
.scan = pn53x_usb_scan,
|
.scan = pn53x_usb_scan,
|
||||||
.open = pn53x_usb_open,
|
.open = pn53x_usb_open,
|
||||||
.close = pn53x_usb_close,
|
.close = pn53x_usb_close,
|
||||||
|
|
Loading…
Add table
Reference in a new issue