Topic: IO Data USB2-NFC - Working
Hey guys I'm new to this smart card thing, but thanks to u guys
even I can get reading tags up and running in just a few days.
Thanks for all the hard work!
I'm using I-O Data USB2-NFC reader, PN531 chip inside from TOPPAN FORMS,
USB device (not a CCID) recognized under windows as TN31-NFC.
The driver came bundled but I had to build libnfc against libusb-win32 to get it working.
Getting it to work under windows is quite a tough time and I found
this thread by snapdev to be very useful.
I use CMake - Mingw32, not NMake though, so this is my list of changes:
included libusb-win23 header in /include/usb/usb.h
included usbstub.cpp by snapdev in /lib/usbstub.cpp
changes all include directive of <usb.h> to <usb/usb.h> (cosmetic ^^)
and this is my makefile
###############################################
# General settings
###############################################
VERSION = 1.3.4
SOURCE = ../src
NFC_LIB = $(SOURCE)/lib
NFC_INCLUDE = $(SOURCE)/include
NFC_BUSES = $(NFC_LIB)/buses
VPATH = $(SOURCE)/examples $(SOURCE)/examples/doc $(NFC_LIB) $(NFC_BUSES) $(NFC_LIB)/chips $(NFC_LIB)/drivers
###############################################
# Compiler settings
###############################################
CC = cl
LD = link
COMMONFLAGS = -O2 -GL -I "$(Include);$(INCLUDE)" -I "$(NFC_INCLUDE)" -I "$(NFC_BUSES)" -I "stdint" -D "WIN32" -MT -D "_CRT_SECURE_NO_WARNINGS" -D "HAVE_PCSC_LITE" -D "WIN32_DCOM" -D "_WIN32_WINNT=0x500" -D "_CRT_SECURE_NO_DEPRECATE" -D "NTDDI_VERSION=0x05000400" -D "DRIVER_PN531_USB_ENABLED" -D "DRIVER_PN533_USB_ENABLED" -D "DRIVER_ACR122_ENABLED" -D "DRIVER_ARYGON_ENABLED" -D "DRIVER_PN532_UART_ENABLED" -D "PACKAGE_VERSION=\"$(VERSION)\"" -D "_WINDLL" -EHsc -W3 -nologo -errorReport:prompt
CFLAGS = $(COMMONFLAGS) -TC
CXXFLAGS = $(COMMONFLAGS) -TP
LDFLAGS = -INCREMENTAL:NO -NOLOGO -MANIFEST:NO -OPT:REF -OPT:ICF -LTCG winscard.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
###############################################
# Files
###############################################
OBJS = usbstub.obj pn53x.obj pn532_uart.obj acr122.obj arygon.obj bitutils.obj uart.obj nfc.obj pn53x_usb.obj pn531_usb.obj pn533_usb.obj
HEADERS = dev_acr122.h bitutils.h defines.h libnfc.h usb.h
LIBNFC = libnfc
EXES = nfc-anticol.exe nfc-list.exe nfc-emulate.exe nfc-relay.exe nfc-mfclassic.exe nfc-mfultralight.exe nfcip-initiator.exe nfcip-target.exe quick_start_example1.exe
all: $(LIBNFC) $(EXES)
usbstub.obj: usbstub.cpp
$(CC) -c $(CXXFLAGS) $<
pn53x.obj : pn53x.c
$(CC) -c $(CFLAGS) $<
pn532_uart.obj : pn532_uart.c
$(CC) -c $(CFLAGS) $<
acr122.obj : acr122.c
$(CC) -c $(CFLAGS) $<
arygon.obj : arygon.c
$(CC) -c $(CFLAGS) $<
bitutils.obj : bitutils.c
$(CC) -c $(CFLAGS) $<
uart.obj : uart.c
$(CC) -c $(CFLAGS) $<
nfc.obj : nfc.c
$(CC) -c $(CFLAGS) $<
pn53x_usb.obj : pn53x_usb.c
$(CC) -c $(CFLAGS) $<
pn531_usb.obj : pn531_usb.c
$(CC) -c $(CFLAGS) $<
pn533_usb.obj: pn533_usb.c
$(CC) -c $(CFLAGS) $<
libnfc: $(OBJS)
$(LD) $(LDFLAGS) -OUT:$(LIBNFC).dll -DLL -DEF:"libnfc.def" -SUBSYSTEM:WINDOWS $(OBJS)
%.exe : %.c $(LIBNFC)
$(CC) $(CFLAGS) -TC -I "$(NFC_LIB)" $< /link /OUT:$@ -SUBSYSTEM:CONSOLE $(LDFLAGS) $(LIBNFC).lib
clean:
del /Q $(OBJS) $(LIBNFC).dll $(LIBNFC).exp $(LIBNFC).lib *.obj $(EXES)*I don't understand makefiles too much, how do u differ *.c from *.cpp ?
of course, how to install libusb-win32 is not covered here.
So perhaps we can update this device compatibility list to TESTED-OK?
once again, to all developers and contributors, thank you very much!
Last edited by lack (2010-09-03 05:07:36)