Resolves conflict between Alex Lian and master branch
Romuald Conty
11 years ago
28 | 28 | SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") |
29 | 29 | |
30 | 30 | # Options |
31 | SET(LIBNFC_LOG ON CACHE BOOL "Enable log facility") | |
31 | SET(LIBNFC_LOG ON CACHE BOOL "Enable log facility (errors, warning, info and debug messages)") | |
32 | 32 | IF(LIBNFC_LOG) |
33 | 33 | ADD_DEFINITIONS(-DLOG) |
34 | 34 | ENDIF(LIBNFC_LOG) |
35 | 35 | |
36 | 36 | SET(LIBNFC_DEBUG_MODE OFF CACHE BOOL "Debug mode") |
37 | 37 | IF(LIBNFC_DEBUG_MODE) |
38 | ADD_DEFINITIONS(-DDEBUG -g3) | |
38 | ADD_DEFINITIONS(-DDEBUG) | |
39 | SET(CMAKE_C_FLAGS "-g3 ${CMAKE_C_FLAGS}") | |
40 | SET(WIN32_MODE "debug") | |
41 | SET(CMAKE_RC_FLAGS "-D_DEBUG ${CMAKE_RC_FLAGS}") | |
42 | ELSE(LIBNFC_DEBUG_MODE) | |
43 | SET(WIN32_MODE "release") | |
39 | 44 | ENDIF(LIBNFC_DEBUG_MODE) |
40 | 45 | |
41 | 46 | # Doxygen |
64 | 69 | # Additonnal GCC flags |
65 | 70 | IF(CMAKE_COMPILER_IS_GNUCC) |
66 | 71 | # Make sure we will not miss some warnings ;) |
67 | ADD_DEFINITIONS(-Wall -pedantic -std=c99) | |
72 | SET(CMAKE_C_FLAGS "-Wall -pedantic -std=c99 ${CMAKE_C_FLAGS}") | |
68 | 73 | ENDIF(CMAKE_COMPILER_IS_GNUCC) |
69 | 74 | |
70 | 75 | # Workarounds for libusb in C99 |
72 | 77 | |
73 | 78 | IF(MINGW) |
74 | 79 | # force MinGW-w64 in 32bit mode |
75 | ADD_DEFINITIONS(-m32) | |
76 | SET(CMAKE_SHARED_LINKER_FLAGS -m32) | |
77 | SET(CMAKE_EXE_LINKER_FLAGS -m32) | |
80 | SET(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}") | |
81 | SET(CMAKE_MODULE_LINKER_FLAGS "-m32 --enable-stdcall-fixup ${CMAKE_SHARED_LINKER_FLAGS}") | |
82 | SET(CMAKE_SHARED_LINKER_FLAGS "-m32 --enable-stdcall-fixup ${CMAKE_SHARED_LINKER_FLAGS}") | |
83 | SET(CMAKE_EXE_LINKER_FLAGS "-m32 --enable-stdcall-fixup ${CMAKE_EXE_LINKER_FLAGS}") | |
84 | SET(CMAKE_RC_FLAGS "--target=pe-i386 --output-format=coff ${CMAKE_RC_FLAGS}") | |
78 | 85 | ENDIF(MINGW) |
79 | 86 | |
80 | 87 | IF(NOT WIN32) |
112 | 119 | INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS}) |
113 | 120 | LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS}) |
114 | 121 | ENDIF(LIBUSB_INCLUDE_DIRS) |
122 | ||
123 | # version.rc for Windows | |
124 | IF(WIN32) | |
125 | # Date for filling in rc file information | |
126 | MACRO (GET_CURRENT_YEAR RESULT) | |
127 | EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) | |
128 | STRING(REGEX REPLACE ".*(..)/(..)/(....).*" "\\3" ${RESULT} ${${RESULT}}) | |
129 | ENDMACRO (GET_CURRENT_YEAR) | |
130 | GET_CURRENT_YEAR(CURRENT_YEAR) | |
131 | MESSAGE("Year for copyright is " ${CURRENT_YEAR}) | |
132 | ||
133 | SET(RC_COMMENT "${PACKAGE_NAME} library") | |
134 | SET(RC_INTERNAL_NAME "${PACKAGE_NAME} ${WIN32_MODE}") | |
135 | SET(RC_ORIGINAL_NAME ${PACKAGE_NAME}.dll) | |
136 | SET(RC_FILE_TYPE VFT_DLL) | |
137 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/windows/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/windows/libnfc.rc @ONLY) | |
138 | ENDIF(WIN32) | |
115 | 139 | |
116 | 140 | ADD_SUBDIRECTORY(libnfc) |
117 | 141 | ADD_SUBDIRECTORY(include) |
10 | 10 | - MinGW-w64 compiler toolchain [1] |
11 | 11 | - LibUsb-Win32 1.2.5.0 (or greater) [2] |
12 | 12 | - CMake 2.8 [3] |
13 | - PCRE for Windows [4] | |
13 | 14 | |
14 | 15 | This was tested on Windows 7 64 bit, but should work on Windows Vista and |
15 | 16 | Windows XP and 32 bit as well. |
56 | 57 | http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm64-gcc-4.5.1.exe/download |
57 | 58 | [2] http://sourceforge.net/projects/libusb-win32/files/ |
58 | 59 | [3] http://www.cmake.org |
60 | [4] http://gnuwin32.sourceforge.net/packages/pcre.htm⏎ |
13 | 13 | |
14 | 14 | # Examples |
15 | 15 | FOREACH(source ${EXAMPLES-SOURCES}) |
16 | ADD_EXECUTABLE(${source} ${source}.c) | |
16 | SET (TARGETS ${source}.c) | |
17 | ||
18 | IF(WIN32) | |
19 | SET(RC_COMMENT "${PACKAGE_NAME} example") | |
20 | SET(RC_INTERNAL_NAME ${source}) | |
21 | SET(RC_ORIGINAL_NAME ${source}.exe) | |
22 | SET(RC_FILE_TYPE VFT_APP) | |
23 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../windows/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc @ONLY) | |
24 | LIST(APPEND TARGETS ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc) | |
25 | ENDIF(WIN32) | |
26 | ||
27 | ADD_EXECUTABLE(${source} ${TARGETS}) | |
17 | 28 | TARGET_LINK_LIBRARIES(${source} nfc) |
18 | 29 | TARGET_LINK_LIBRARIES(${source} nfcutils) |
19 | 30 | INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT examples) |
0 | 0 | # Windows MinGW workarounds |
1 | 1 | IF(WIN32) |
2 | message("Adding in contrib win32 sources") | |
3 | 2 | SET(WINDOWS_SOURCES ../contrib/win32/stdlib) |
4 | 3 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32) |
5 | message("Win32: " ${WINDOWS_SOURCES}) | |
4 | ||
5 | # Add in the rc for version information in the dll | |
6 | LIST(APPEND WINDOWS_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/../windows/libnfc.rc) | |
6 | 7 | ENDIF(WIN32) |
7 | 8 | |
8 | 9 | # Library's chips |
52 | 53 | TARGET_LINK_LIBRARIES(nfc ${LIBUSB_LIBRARIES}) |
53 | 54 | ENDIF(LIBUSB_FOUND) |
54 | 55 | |
55 | IF(WIN32) | |
56 | TARGET_LINK_LIBRARIES(nfc wsock32) | |
57 | ENDIF(WIN32) | |
58 | 56 | SET_TARGET_PROPERTIES(nfc PROPERTIES SOVERSION 0) |
59 | 57 | |
60 | 58 | IF(WIN32) |
59 | # Libraries that are windows specific | |
60 | TARGET_LINK_LIBRARIES(nfc wsock32) | |
61 | 61 | IF(PCRE_FOUND) |
62 | 62 | TARGET_LINK_LIBRARIES(nfc ${PCRE_LIBRARIES}) |
63 | 63 | ENDIF(PCRE_FOUND) |
64 | ||
65 | ADD_CUSTOM_COMMAND( | |
66 | OUTPUT libnfc.lib | |
67 | COMMAND dlltool -d ${CMAKE_CURRENT_SOURCE_DIR}/../windows/win32/nfc.def -l ${CMAKE_CURRENT_BINARY_DIR}/libnfc.lib ${CMAKE_CURRENT_BINARY_DIR}/libnfc.dll | |
68 | DEPENDS nfc ${CMAKE_CURRENT_SOURCE_DIR}/../windows/win32/nfc.def | |
69 | ) | |
70 | ADD_CUSTOM_TARGET(win32lib ALL DEPENDS libnfc.lib) | |
64 | 71 | |
65 | 72 | # On Windows the shared (runtime) library should be either in the same |
66 | 73 | # directory as the excutables or in the path, we add it to same directory |
16 | 16 | FOREACH(source ${UTILS-SOURCES}) |
17 | 17 | SET (TARGETS ${source}.c) |
18 | 18 | |
19 | IF(WIN32) | |
20 | SET(RC_COMMENT "${PACKAGE_NAME} utility") | |
21 | SET(RC_INTERNAL_NAME ${source}) | |
22 | SET(RC_ORIGINAL_NAME ${source}.exe) | |
23 | SET(RC_FILE_TYPE VFT_APP) | |
24 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../windows/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc @ONLY) | |
25 | LIST(APPEND TARGETS ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc) | |
26 | ENDIF(WIN32) | |
27 | ||
19 | 28 | IF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic")) |
20 | 29 | LIST(APPEND TARGETS mifare) |
21 | 30 | ENDIF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic")) |
32 | 41 | TARGET_LINK_LIBRARIES(${source} nfc) |
33 | 42 | TARGET_LINK_LIBRARIES(${source} nfcutils) |
34 | 43 | |
35 | ||
36 | 44 | INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT utils) |
37 | 45 | ENDFOREACH(source) |
38 | 46 |
0 | COMMONOPTS=/W3 /MD /DNDEBUG /DWIN32 /D_WIN32_DCOM /D_WIN32_WINNT=0x500 /D_CRT_SECURE_NO_DEPRECATE /Zp8 /DNTDDI_VERSION=0x05000400 | |
1 | ||
2 | DLLNAME=nfc | |
3 | ||
4 | NFCOPTS= /I..\include \ | |
5 | /I..\contrib\win32 \ | |
6 | /I..\contrib\win32\stdint \ | |
7 | /Iusb\include \ | |
8 | /I..\libnfc \ | |
9 | /I..\libnfc\buses \ | |
10 | /DDRIVER_PN531_USB_ENABLED \ | |
11 | /DDRIVER_PN533_USB_ENABLED \ | |
12 | /DDRIVER_ACR122_ENABLED \ | |
13 | /DDRIVER_ARYGON_ENABLED \ | |
14 | /DDRIVER_PN532_UART_ENABLED | |
15 | ||
16 | NFCLIBOPTS=/Dnfc_EXPORTS /DPACKAGE_VERSION=\"1.4.0\" | |
17 | ||
18 | CFLAGS=$(COMMONOPTS) /WX $(NFCOPTS) | |
19 | CXXFLAGS=$(COMMONOPTS) /EHa $(NFCOPTS) | |
20 | CC=cl.exe /nologo | |
21 | CXX=$(CC) | |
22 | CC_OUT_EXE=/Fe | |
23 | CC_OUT_DLL=/LD /Fe | |
24 | CC_OUT_OBJ=/Fo | |
25 | ||
26 | LIBNFC_DLL=bin\$(DLLNAME).dll | |
27 | NFC_LIST=bin\nfc-list.exe | |
28 | NFC_ANTICOL=bin\nfc-anticol.exe | |
29 | NFC_EMULATE=bin\nfc-emulate.exe | |
30 | NFC_MFCLASSIC=bin\nfc-mfclassic.exe | |
31 | NFC_MFULTRALIGHT=bin\nfc-mfultralight.exe | |
32 | NFC_POLL=bin\nfc-poll.exe | |
33 | NFC_RELAY=bin\nfc-relay.exe | |
34 | NFCIP_INITIATOR=bin\nfcip-initiator.exe | |
35 | NFCIP_TARGET=bin\nfcip-target.exe | |
36 | ||
37 | LIBNFC_OBJ= obj\nfc.obj \ | |
38 | obj\pn531_usb.obj \ | |
39 | obj\pn53x_usb.obj \ | |
40 | obj\usbstub.obj \ | |
41 | obj\uart.obj \ | |
42 | obj\pn53x.obj \ | |
43 | obj\mirror-subr.obj \ | |
44 | obj\iso14443-subr.obj \ | |
45 | obj\acr122.obj \ | |
46 | obj\arygon.obj \ | |
47 | obj\pn533_usb.obj \ | |
48 | obj\pn532_uart.obj | |
49 | ||
50 | NFC_LIST_OBJ=obj\nfc-list.obj \ | |
51 | obj\nfc-utils.obj | |
52 | ||
53 | NFC_POLL_OBJ=obj\nfc-poll.obj \ | |
54 | obj\nfc-utils.obj | |
55 | ||
56 | NFC_RELAY_OBJ=obj\nfc-relay.obj \ | |
57 | obj\nfc-utils.obj | |
58 | ||
59 | NFC_ANTICOL_OBJ=obj\nfc-anticol.obj \ | |
60 | obj\nfc-utils.obj | |
61 | ||
62 | NFC_EMULATE_OBJ=obj\nfc-emulate.obj \ | |
63 | obj\nfc-utils.obj | |
64 | ||
65 | NFCIP_INITIATOR_OBJ=obj\nfcip-initiator.obj \ | |
66 | obj\nfc-utils.obj | |
67 | ||
68 | NFCIP_TARGET_OBJ=obj\nfcip-target.obj \ | |
69 | obj\nfc-utils.obj | |
70 | ||
71 | NFC_MFCLASSIC_OBJ=obj\nfc-mfclassic.obj \ | |
72 | obj\mifare.obj \ | |
73 | obj\nfc-utils.obj | |
74 | ||
75 | NFC_MFULTRALIGHT_OBJ=obj\nfc-mfultralight.obj \ | |
76 | obj\mifare.obj \ | |
77 | obj\nfc-utils.obj | |
78 | ||
79 | all: obj bin $(LIBNFC_DLL) $(NFC_LIST) $(NFC_POLL) $(NFC_RELAY) $(NFCIP_INITIATOR) $(NFCIP_TARGET) $(NFC_ANTICOL) $(NFC_EMULATE) $(NFC_MFCLASSIC) $(NFC_MFULTRALIGHT) | |
80 | ||
81 | clean: | |
82 | for %d in ( $(LIBNFC_DLL) $(NFC_LIST) $(NFC_POLL) $(NFC_RELAY) ) do if exist %d del %d | |
83 | for %d in ( $(LIBNFC_OBJ) $(NFC_LIST_OBJ) ) do if exist %d del %d | |
84 | for %d in ( obj\nfc-list.res obj\$(DLLNAME).res ) do if exist %d del %d | |
85 | for %d in ( bin\$(DLLNAME).exp bin\$(DLLNAME).lib obj\$(DLLNAME).lib ) do if exist %d del %d | |
86 | for %d in ( $(NFC_RELAY_OBJ) ) do if exist %d del %d | |
87 | for %d in ( $(NFC_POLL_OBJ) obj\nfc-poll.res ) do if exist %d del %d | |
88 | for %d in ( $(NFC_RELAY_OBJ) obj\nfc-relay.res ) do if exist %d del %d | |
89 | for %d in ( $(NFCIP_INITIATOR) $(NFCIP_INITIATOR_OBJ) obj\nfcip-initiator.res ) do if exist %d del %d | |
90 | for %d in ( $(NFCIP_TARGET) $(NFCIP_TARGET_OBJ) obj\nfcip-target.res ) do if exist %d del %d | |
91 | for %d in ( $(NFC_MFCLASSIC) $(NFC_MFCLASSIC_OBJ) obj\nfc-mfclassic.res ) do if exist %d del %d | |
92 | for %d in ( $(NFC_MFULTRALIGHT) $(NFC_MFULTRALIGHT_OBJ) obj\nfc-mfultralight.res ) do if exist %d del %d | |
93 | for %d in ( $(NFC_EMULATE) $(NFC_EMULATE_OBJ) obj\nfc-emulate.res ) do if exist %d del %d | |
94 | for %d in ( $(NFC_ANTICOL) $(NFC_ANTICOL_OBJ) obj\nfc-anticol.res ) do if exist %d del %d | |
95 | if exist obj rmdir obj | |
96 | if exist bin rmdir bin | |
97 | if exist mm\out rmdir /s /q mm\out | |
98 | ||
99 | obj bin: | |
100 | mkdir $@ | |
101 | ||
102 | obj\$(DLLNAME).lib: $(LIBNFC_OBJ) | |
103 | if exist $@ del $@ | |
104 | lib /out:$@ $(LIBNFC_OBJ) | |
105 | ||
106 | $(LIBNFC_DLL): obj\$(DLLNAME).lib win32\$(DLLNAME).def obj\$(DLLNAME).res | |
107 | $(CC) $(CC_OUT_DLL)$@ \ | |
108 | obj\$(DLLNAME).lib \ | |
109 | obj\$(DLLNAME).res \ | |
110 | /link \ | |
111 | /DEF:win32\$(DLLNAME).def \ | |
112 | winscard.lib | |
113 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#2 | |
114 | if exist $@.manifest del $@.manifest | |
115 | ||
116 | $(NFC_LIST): $(NFC_LIST_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfc-list.res | |
117 | $(CC) $(CC_OUT_EXE)$@ $(NFC_LIST_OBJ) bin\$(DLLNAME).lib obj\nfc-list.res | |
118 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
119 | if exist $@.manifest del $@.manifest | |
120 | ||
121 | $(NFC_EMULATE): $(NFC_EMULATE_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfc-emulate.res | |
122 | $(CC) $(CC_OUT_EXE)$@ $(NFC_EMULATE_OBJ) bin\$(DLLNAME).lib obj\nfc-emulate.res | |
123 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
124 | if exist $@.manifest del $@.manifest | |
125 | ||
126 | $(NFC_POLL): $(NFC_POLL_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfc-poll.res | |
127 | $(CC) $(CC_OUT_EXE)$@ $(NFC_POLL_OBJ) bin\$(DLLNAME).lib obj\nfc-poll.res | |
128 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
129 | if exist $@.manifest del $@.manifest | |
130 | ||
131 | $(NFC_ANTICOL): $(NFC_ANTICOL_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfc-anticol.res | |
132 | $(CC) $(CC_OUT_EXE)$@ $(NFC_ANTICOL_OBJ) bin\$(DLLNAME).lib obj\nfc-anticol.res | |
133 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
134 | if exist $@.manifest del $@.manifest | |
135 | ||
136 | $(NFC_RELAY): $(NFC_RELAY_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfc-relay.res | |
137 | $(CC) $(CC_OUT_EXE)$@ $(NFC_RELAY_OBJ) bin\$(DLLNAME).lib obj\nfc-relay.res | |
138 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
139 | if exist $@.manifest del $@.manifest | |
140 | ||
141 | $(NFCIP_INITIATOR): $(NFCIP_INITIATOR_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfcip-initiator.res | |
142 | $(CC) $(CC_OUT_EXE)$@ $(NFCIP_INITIATOR_OBJ) bin\$(DLLNAME).lib obj\nfcip-initiator.res | |
143 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
144 | if exist $@.manifest del $@.manifest | |
145 | ||
146 | $(NFCIP_TARGET): $(NFCIP_TARGET_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfcip-target.res | |
147 | $(CC) $(CC_OUT_EXE)$@ $(NFCIP_TARGET_OBJ) bin\$(DLLNAME).lib obj\nfcip-target.res | |
148 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
149 | if exist $@.manifest del $@.manifest | |
150 | ||
151 | $(NFC_MFCLASSIC): $(NFC_MFCLASSIC_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfc-mfclassic.res | |
152 | $(CC) $(CC_OUT_EXE)$@ $(NFC_MFCLASSIC_OBJ) bin\$(DLLNAME).lib obj\nfc-mfclassic.res | |
153 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
154 | if exist $@.manifest del $@.manifest | |
155 | ||
156 | $(NFC_MFULTRALIGHT): $(NFC_MFULTRALIGHT_OBJ) $(LIBNFC_DLL) bin\$(DLLNAME).lib obj\nfc-mfultralight.res | |
157 | $(CC) $(CC_OUT_EXE)$@ $(NFC_MFULTRALIGHT_OBJ) bin\$(DLLNAME).lib obj\nfc-mfultralight.res | |
158 | if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;#1 | |
159 | if exist $@.manifest del $@.manifest | |
160 | ||
161 | obj\mifare.obj: ..\examples\mifare.c | |
162 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\mifare.c | |
163 | ||
164 | obj\nfc-relay.obj: ..\examples\nfc-relay.c | |
165 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-relay.c | |
166 | ||
167 | obj\nfc-mfclassic.obj: ..\examples\nfc-mfclassic.c | |
168 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-mfclassic.c | |
169 | ||
170 | obj\nfc-mfultralight.obj: ..\examples\nfc-mfultralight.c | |
171 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-mfultralight.c | |
172 | ||
173 | obj\nfc-emulate.obj: ..\examples\nfc-emulate.c | |
174 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-emulate.c | |
175 | ||
176 | obj\nfcip-initiator.obj: ..\examples\nfcip-initiator.c | |
177 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfcip-initiator.c | |
178 | ||
179 | obj\nfcip-target.obj: ..\examples\nfcip-target.c | |
180 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfcip-target.c | |
181 | ||
182 | obj\nfc-poll.obj: ..\examples\nfc-poll.c | |
183 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-poll.c | |
184 | ||
185 | obj\nfc-anticol.obj: ..\examples\nfc-anticol.c | |
186 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-anticol.c | |
187 | ||
188 | obj\nfc-list.obj: ..\examples\nfc-list.c | |
189 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-list.c | |
190 | ||
191 | obj\nfc-utils.obj: ..\examples\nfc-utils.c | |
192 | $(CC) /c $(CC_OUT_OBJ)$@ $(CFLAGS) ..\examples\nfc-utils.c | |
193 | ||
194 | obj\nfc.obj: ..\libnfc\nfc.c | |
195 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\nfc.c | |
196 | ||
197 | obj\iso14443-subr.obj: ..\libnfc\iso14443-subr.c | |
198 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\iso14443-subr.c | |
199 | ||
200 | obj\pn531_usb.obj: ..\libnfc\drivers\pn531_usb.c | |
201 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\drivers\pn531_usb.c | |
202 | ||
203 | obj\pn533_usb.obj: ..\libnfc\drivers\pn533_usb.c | |
204 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\drivers\pn533_usb.c | |
205 | ||
206 | obj\pn532_uart.obj: ..\libnfc\drivers\pn532_uart.c | |
207 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\drivers\pn532_uart.c | |
208 | ||
209 | obj\pn53x_usb.obj: ..\libnfc\drivers\pn53x_usb.c | |
210 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\drivers\pn53x_usb.c | |
211 | ||
212 | obj\acr122.obj: ..\libnfc\drivers\acr122.c | |
213 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\drivers\acr122.c | |
214 | ||
215 | obj\arygon.obj: ..\libnfc\drivers\arygon.c | |
216 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\drivers\arygon.c | |
217 | ||
218 | obj\pn53x.obj: ..\libnfc\chips\pn53x.c | |
219 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\chips\pn53x.c | |
220 | ||
221 | obj\uart.obj: ..\libnfc\buses\uart.c | |
222 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\buses\uart.c | |
223 | ||
224 | obj\usbstub.obj: usb\src\usbstub.cpp | |
225 | $(CXX) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CXXFLAGS) usb\src\usbstub.cpp | |
226 | ||
227 | obj\mirror-subr.obj: ..\libnfc\mirror-subr.c | |
228 | $(CC) /c $(CC_OUT_OBJ)$@ $(NFCLIBOPTS) $(CFLAGS) ..\libnfc\mirror-subr.c | |
229 | ||
230 | obj\$(DLLNAME).res: win32\$(DLLNAME).rc | |
231 | rc /r $(RCFLAGS) /fo$@ win32\$(DLLNAME).rc | |
232 | ||
233 | obj\nfc-list.res: win32\nfc-list.rc | |
234 | rc /r $(RCFLAGS) /fo$@ win32\nfc-list.rc | |
235 | ||
236 | obj\nfc-poll.res: win32\nfc-poll.rc | |
237 | rc /r $(RCFLAGS) /fo$@ win32\nfc-poll.rc | |
238 | ||
239 | obj\nfc-relay.res: win32\nfc-relay.rc | |
240 | rc /r $(RCFLAGS) /fo$@ win32\nfc-relay.rc | |
241 | ||
242 | obj\nfcip-initiator.res: win32\nfcip-initiator.rc | |
243 | rc /r $(RCFLAGS) /fo$@ win32\nfcip-initiator.rc | |
244 | ||
245 | obj\nfcip-target.res: win32\nfcip-target.rc | |
246 | rc /r $(RCFLAGS) /fo$@ win32\nfcip-target.rc | |
247 | ||
248 | obj\nfc-anticol.res: win32\nfc-anticol.rc | |
249 | rc /r $(RCFLAGS) /fo$@ win32\nfc-anticol.rc | |
250 | ||
251 | obj\nfc-emulate.res: win32\nfc-emulate.rc | |
252 | rc /r $(RCFLAGS) /fo$@ win32\nfc-emulate.rc | |
253 | ||
254 | obj\nfc-mfclassic.res: win32\nfc-mfclassic.rc | |
255 | rc /r $(RCFLAGS) /fo$@ win32\nfc-mfclassic.rc | |
256 | ||
257 | obj\nfc-mfultralight.res: win32\nfc-mfultralight.rc | |
258 | rc /r $(RCFLAGS) /fo$@ win32\nfc-mfultralight.rc | |
259 | ||
260 | install: all | |
261 | cd mm | |
262 | call make.bat | |
263 | cd .. | |
264 | ||
265 | ||
266 |
0 | ;---------------------------------------------------------------------------- | |
1 | ; MODULE NAME: LIBNFC.MM | |
2 | ; | |
3 | ; $Author: USER "rogerb" $ | |
4 | ; $Revision: 1267 $ | |
5 | ; $Date: 02 Jun 2006 17:10:46 $ | |
6 | ; $Logfile: C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/TryMe.mm.pvcs $ | |
7 | ; | |
8 | ; DESCRIPTION | |
9 | ; ~~~~~~~~~~~ | |
10 | ; This is a simple sample/test MSI. Takes about 30 seconds to build and | |
11 | ; validate on my AMD 3200. | |
12 | ; | |
13 | ; Any line within this file that begins with ";" can be ignored as its | |
14 | ; only a comment so there are only 3 important lines in this file: | |
15 | ; | |
16 | ; 1. #include "ME.MMH" | |
17 | ; 2. <$DirectoryTree Key="INSTALLDIR" ... | |
18 | ; 3. <$Files "TryMe.*" DestDir="INSTALLDIR"> | |
19 | ;---------------------------------------------------------------------------- | |
20 | ||
21 | ; #define? COMPANY_PRODUCT_ICON ..\win32\libnfc.ico ;; override from company.mmh | |
22 | #define? UISAMPLE_DIALOG_FILE_dlgbmp nfcleft.bmp ;; override uisample.mmh | |
23 | #define? UISAMPLE_BLINE_TEXT www.nfc-tools.org | |
24 | #define? COMPANY_WANT_TO_INSTALL_DOCUMENTATION N | |
25 | ||
26 | ;--- Include MAKEMSI support (with my customisations and MSI branding) ------ | |
27 | #define VER_FILENAME.VER libnfc.Ver ;;I only want one VER file for all samples! (this line not actually required in "tryme.mm") | |
28 | #include "ME.MMH" | |
29 | ||
30 | ;--- Want to debug (not common) --------------------------------------------- | |
31 | ;#debug on | |
32 | ;#Option DebugLevel=^NONE, +OpSys^ | |
33 | ||
34 | ||
35 | ;--- Define default location where file should install and add files -------- | |
36 | <$DirectoryTree Key="INSTALLDIR" Dir="[ProgramFilesFolder]libnfc-1.3.4" CHANGE="\" PrimaryFolder="Y"> | |
37 | <$DirectoryTree Key="INSTALLDIR2" Dir="[INSTALLDIR]bin" > | |
38 | <$DirectoryTree Key="INSTALLDIR3" Dir="[INSTALLDIR]lib" > | |
39 | <$DirectoryTree Key="INSTALLDIR4" Dir="[INSTALLDIR]include" > | |
40 | <$DirectoryTree Key="INSTALLDIR5" Dir="[INSTALLDIR4]nfc" > | |
41 | <$Files "..\bin\nfc-list.exe" DestDir="INSTALLDIR2" > | |
42 | <$Files "..\bin\nfc-poll.exe" DestDir="INSTALLDIR2" > | |
43 | <$Files "..\bin\nfc-relay.exe" DestDir="INSTALLDIR2" > | |
44 | <$Files "..\bin\nfc-emulate.exe" DestDir="INSTALLDIR2" > | |
45 | <$Files "..\bin\nfc-mfultralight.exe" DestDir="INSTALLDIR2" > | |
46 | <$Files "..\bin\nfc-mfclassic.exe" DestDir="INSTALLDIR2" > | |
47 | <$Files "..\bin\nfcip-initiator.exe" DestDir="INSTALLDIR2" > | |
48 | <$Files "..\bin\nfcip-target.exe" DestDir="INSTALLDIR2" > | |
49 | <$Files "..\bin\nfc.dll" DestDir="SystemFolder" > | |
50 | <$Files "..\bin\nfc.lib" DestDir="INSTALLDIR3" > | |
51 | <$Files "..\..\include\nfc\nfc.h" DestDir="INSTALLDIR5" > | |
52 | <$Files "..\..\include\nfc\nfc-messages.h" DestDir="INSTALLDIR5" > | |
53 | <$Files "..\..\include\nfc\nfc-types.h" DestDir="INSTALLDIR5" > |
0 | ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
1 | ; ProductName = libnfc | |
2 | ; DESCRIPTION = Public platform independent Near Field Communication (NFC) library | |
3 | ; Installed = WINDOWS_ALL | |
4 | ; Guid.UpgradeCode = {5880D072-659D-4038-894D-C85BF514B95A} | |
5 | ; MsiName = libnfc-1.4.0 | |
6 | ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
7 | ||
8 | ;############################################################################ | |
9 | VERSION : 1.4.0.0 | |
10 | DATE : 26 Oct 2010 | |
11 | CHANGES : Example Packaging | |
12 |
0 | set OLDPATH=%PATH% | |
1 | set PATH=%PATH%;"c:\program files\makemsi" | |
2 | rmdir /s /q out | |
3 | call "%ProgramFiles%\MakeMSI\mm.cmd" "libnfc.mm" | |
4 | if errorlevel 1 goto failed | |
5 | ||
6 | :success | |
7 | echo success | |
8 | goto doneall | |
9 | ||
10 | :failed | |
11 | echo failed | |
12 | ||
13 | :doneall | |
14 | set PATH=%OLDPATH% |
0 | ; Copyright 2009, Snapper Services Limited, New Zealand | |
1 | ; All rights reserved | |
2 | ; $Id: me.mmh 1224 2010-05-04 04:14:44Z roger.brown $ | |
3 | ||
4 | ;---------------------------------------------------------------------------- | |
5 | ; | |
6 | ; MODULE NAME: ME.MMH | |
7 | ; | |
8 | ; $Author: USER "Dennis" $ | |
9 | ; $Revision: 1224 $ | |
10 | ; $Date: 27 Sep 2007 17:38:34 $ | |
11 | ; $Logfile: C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/ME.mmh.pvcs $ | |
12 | ; | |
13 | ; Very simplistic example of a MAKEMSI customisation/branding file, see | |
14 | ; "DENNIS.MMH" for a more complex variation (please don't use it though...). | |
15 | ;---------------------------------------------------------------------------- | |
16 | ||
17 | ||
18 | ||
19 | ;---------------------------------------------------------------------------- | |
20 | ;--- Set up some options specific to my requirements ------------------------ | |
21 | ;---------------------------------------------------------------------------- | |
22 | #define? DEPT_ARP_URL_PUBLISHER http://www.MyUrl.com/See/ME.MMH/ | |
23 | #define? DEPT_ARP_URL_TECHNICAL_SUPPORT http://www.MyUrl.com/See/ME.MMH/Support | |
24 | #define? DEPT_NAME no department | |
25 | #define? DEPT_ADDRESS New Zealand | |
26 | #define? COMPANY_CONTACT_NAME <$DEPT_NAME> | |
27 | #define? COMPANY_CONTACT_NAME_PHONE ;;No phone | |
28 | #define? COMPANY_SUMMARY_SCHEMA 110 ;;Minimum v1.1 Installer | |
29 | ||
30 | ||
31 | ||
32 | ;---------------------------------------------------------------------------- | |
33 | ;--- Override/set some standard defaults ------------------------------------ | |
34 | ;---------------------------------------------------------------------------- | |
35 | #define? DBG_ALL Y ;;Add MAKEMSI debugging to "console file" | |
36 | #define? DBG_SAY_LOCATION call Say2Logs <$DBG_INDENT> || ' ' || time() || ' ' ;;Adding time makes it a bit slower but useful for debugging slow builds... | |
37 | #define? COMMONFRAMEWORK_ZIP_SOURCE_FOR_BACKUP N ;;No "insurance" until I bother to install "info zip"... | |
38 | #define? DEFAULT_SERVICE_CONTROL_UNINSTALL_EVENTS ;;I think this option is safer than the MAKEMSI default | |
39 | #define? DEFAULT_SERVICE_CONTROL_INSTALL_EVENTS ;;I think this option is better | |
40 | #define? DEFAULT_FILE_WANT_FILEHASH Y ;;My box can generate MD5 hashes! | |
41 | #define? COMPANY_PREPROCESS_LICENCE_FILE Y ;;Default is to preprocess licence files | |
42 | #define? MAKEMSI_HTML_EXTENSION hta ;;Default extension (HTML Application - gets around WINXP SP2 issue) | |
43 | #define? UISAMPLE_LEFTSIDE_TEXT_FONT_NAME Tahoma | |
44 | #define? UISAMPLE_LEFTSIDE_TEXT_FONT_SIZE 8 | |
45 | #define? UISAMPLE_LEFTSIDE_TEXT_FONT_COLOR &H000000 ;;Black | |
46 | #( | |
47 | #define? UISAMPLE_LEFTSIDE_TEXT | |
48 | #) | |
49 | #( | |
50 | #define? @VALIDATE_TEXT_FOR_MISSINGDATA ;;Example only as now duplicates exact text as new default value | |
51 | This column is not mentioned in the _Validation table. | |
52 | Either add the validation data or use the "@validate" parameter | |
53 | on the "row" command (or alter its default). | |
54 | #) | |
55 | ||
56 | ||
57 | ||
58 | ;---------------------------------------------------------------------------- | |
59 | ;--- Include MAKEMSI support ------------------------------------------------ | |
60 | ;---------------------------------------------------------------------------- | |
61 | #include "DEPT.MMH" | |
62 | ||
63 | ||
64 | ;---------------------------------------------------------------------------- | |
65 | ;--- I want to compress any DLL based custom actions generated by MAKEMSI --- | |
66 | ;---------------------------------------------------------------------------- | |
67 | <$GetFullBuildTimeFileName RcVar="@@FullUpxExeName" Macro="DENNIS_UPX.EXE" File="upx.exe" MustExist="N"> | |
68 | #if [@@FullUpxExeName = ''] | |
69 | ;--- If UPX.EXE doesn't exist report an error --------------------------- | |
70 | ;#error "DLL not being compressed (UPX.EXE not found)" ;;This is also a sample, can't expect users to have "UPX.EXE"... | |
71 | #info "DLL custom action code will not be compressed (UPX.EXE not found)" | |
72 | #else | |
73 | ;--- "UPX.EXE" was found ------------------------------------------------ | |
74 | #( | |
75 | ;--- Define the macro that MAKEMSI will use as required ------------- | |
76 | #define+ DLLCA-C_COMPRESS_DLL_COMMAND_LINE ;;Need to OVERRIDE value (we couldn't do it earler or "GetFullBuildTimeFileName" wouldn't exist!) | |
77 | ||
78 | ;--- I expect "upx.exe" to be in the "PATH" environment variable ---- | |
79 | "<??@@FullUpxExeName>" ;;Full name of UPX.EXE (get from "http://upx.sourceforge.net/") | |
80 | ||
81 | ;--- I want highest compression ------------------------------------- | |
82 | --best | |
83 | ||
84 | ;--- Backup the DLL as a debugging aid... --------------------------- | |
85 | -k | |
86 | #) | |
87 | #endif |
0 | /* | |
1 | * from the libusb-win32 project | |
2 | * | |
3 | * Copyright (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com> | |
4 | * | |
5 | * This library is covered by the LGPL, read LICENSE for details. | |
6 | * | |
7 | */ | |
8 | ||
9 | /* | |
10 | * $Id: usb.h 1220 2010-05-04 03:14:56Z roger.brown $ | |
11 | */ | |
12 | ||
13 | ||
14 | #ifndef __USB_H__ | |
15 | #define __USB_H__ | |
16 | ||
17 | #include <stdlib.h> | |
18 | #include <windows.h> | |
19 | ||
20 | /* | |
21 | * 'interface' is defined somewhere in the Windows header files. This macro | |
22 | * is deleted here to avoid conflicts and compile errors. | |
23 | */ | |
24 | ||
25 | #ifdef interface | |
26 | #undef interface | |
27 | #endif | |
28 | ||
29 | /* | |
30 | * PATH_MAX from limits.h can't be used on Windows if the dll and | |
31 | * import libraries are build/used by different compilers | |
32 | */ | |
33 | ||
34 | #define LIBUSB_PATH_MAX 512 | |
35 | ||
36 | ||
37 | /* | |
38 | * USB spec information | |
39 | * | |
40 | * This is all stuff grabbed from various USB specs and is pretty much | |
41 | * not subject to change | |
42 | */ | |
43 | ||
44 | /* | |
45 | * Device and/or Interface Class codes | |
46 | */ | |
47 | #define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ | |
48 | #define USB_CLASS_AUDIO 1 | |
49 | #define USB_CLASS_COMM 2 | |
50 | #define USB_CLASS_HID 3 | |
51 | #define USB_CLASS_PRINTER 7 | |
52 | #define USB_CLASS_MASS_STORAGE 8 | |
53 | #define USB_CLASS_HUB 9 | |
54 | #define USB_CLASS_DATA 10 | |
55 | #define USB_CLASS_VENDOR_SPEC 0xff | |
56 | ||
57 | /* | |
58 | * Descriptor types | |
59 | */ | |
60 | #define USB_DT_DEVICE 0x01 | |
61 | #define USB_DT_CONFIG 0x02 | |
62 | #define USB_DT_STRING 0x03 | |
63 | #define USB_DT_INTERFACE 0x04 | |
64 | #define USB_DT_ENDPOINT 0x05 | |
65 | ||
66 | #define USB_DT_HID 0x21 | |
67 | #define USB_DT_REPORT 0x22 | |
68 | #define USB_DT_PHYSICAL 0x23 | |
69 | #define USB_DT_HUB 0x29 | |
70 | ||
71 | /* | |
72 | * Descriptor sizes per descriptor type | |
73 | */ | |
74 | #define USB_DT_DEVICE_SIZE 18 | |
75 | #define USB_DT_CONFIG_SIZE 9 | |
76 | #define USB_DT_INTERFACE_SIZE 9 | |
77 | #define USB_DT_ENDPOINT_SIZE 7 | |
78 | #define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ | |
79 | #define USB_DT_HUB_NONVAR_SIZE 7 | |
80 | ||
81 | ||
82 | /* ensure byte-packed structures */ | |
83 | #include <pshpack1.h> | |
84 | ||
85 | ||
86 | /* All standard descriptors have these 2 fields in common */ | |
87 | struct usb_descriptor_header { | |
88 | unsigned char bLength; | |
89 | unsigned char bDescriptorType; | |
90 | }; | |
91 | ||
92 | /* String descriptor */ | |
93 | struct usb_string_descriptor { | |
94 | unsigned char bLength; | |
95 | unsigned char bDescriptorType; | |
96 | unsigned short wData[1]; | |
97 | }; | |
98 | ||
99 | /* HID descriptor */ | |
100 | struct usb_hid_descriptor { | |
101 | unsigned char bLength; | |
102 | unsigned char bDescriptorType; | |
103 | unsigned short bcdHID; | |
104 | unsigned char bCountryCode; | |
105 | unsigned char bNumDescriptors; | |
106 | }; | |
107 | ||
108 | /* Endpoint descriptor */ | |
109 | #define USB_MAXENDPOINTS 32 | |
110 | struct usb_endpoint_descriptor { | |
111 | unsigned char bLength; | |
112 | unsigned char bDescriptorType; | |
113 | unsigned char bEndpointAddress; | |
114 | unsigned char bmAttributes; | |
115 | unsigned short wMaxPacketSize; | |
116 | unsigned char bInterval; | |
117 | unsigned char bRefresh; | |
118 | unsigned char bSynchAddress; | |
119 | ||
120 | unsigned char *extra; /* Extra descriptors */ | |
121 | int extralen; | |
122 | }; | |
123 | ||
124 | #define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ | |
125 | #define USB_ENDPOINT_DIR_MASK 0x80 | |
126 | ||
127 | #define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ | |
128 | #define USB_ENDPOINT_TYPE_CONTROL 0 | |
129 | #define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 | |
130 | #define USB_ENDPOINT_TYPE_BULK 2 | |
131 | #define USB_ENDPOINT_TYPE_INTERRUPT 3 | |
132 | ||
133 | /* Interface descriptor */ | |
134 | #define USB_MAXINTERFACES 32 | |
135 | struct usb_interface_descriptor { | |
136 | unsigned char bLength; | |
137 | unsigned char bDescriptorType; | |
138 | unsigned char bInterfaceNumber; | |
139 | unsigned char bAlternateSetting; | |
140 | unsigned char bNumEndpoints; | |
141 | unsigned char bInterfaceClass; | |
142 | unsigned char bInterfaceSubClass; | |
143 | unsigned char bInterfaceProtocol; | |
144 | unsigned char iInterface; | |
145 | ||
146 | struct usb_endpoint_descriptor *endpoint; | |
147 | ||
148 | unsigned char *extra; /* Extra descriptors */ | |
149 | int extralen; | |
150 | }; | |
151 | ||
152 | #define USB_MAXALTSETTING 128 /* Hard limit */ | |
153 | ||
154 | struct usb_interface { | |
155 | struct usb_interface_descriptor *altsetting; | |
156 | ||
157 | int num_altsetting; | |
158 | }; | |
159 | ||
160 | /* Configuration descriptor information.. */ | |
161 | #define USB_MAXCONFIG 8 | |
162 | struct usb_config_descriptor { | |
163 | unsigned char bLength; | |
164 | unsigned char bDescriptorType; | |
165 | unsigned short wTotalLength; | |
166 | unsigned char bNumInterfaces; | |
167 | unsigned char bConfigurationValue; | |
168 | unsigned char iConfiguration; | |
169 | unsigned char bmAttributes; | |
170 | unsigned char MaxPower; | |
171 | ||
172 | struct usb_interface *interface; | |
173 | ||
174 | unsigned char *extra; /* Extra descriptors */ | |
175 | int extralen; | |
176 | }; | |
177 | ||
178 | /* Device descriptor */ | |
179 | struct usb_device_descriptor { | |
180 | unsigned char bLength; | |
181 | unsigned char bDescriptorType; | |
182 | unsigned short bcdUSB; | |
183 | unsigned char bDeviceClass; | |
184 | unsigned char bDeviceSubClass; | |
185 | unsigned char bDeviceProtocol; | |
186 | unsigned char bMaxPacketSize0; | |
187 | unsigned short idVendor; | |
188 | unsigned short idProduct; | |
189 | unsigned short bcdDevice; | |
190 | unsigned char iManufacturer; | |
191 | unsigned char iProduct; | |
192 | unsigned char iSerialNumber; | |
193 | unsigned char bNumConfigurations; | |
194 | }; | |
195 | ||
196 | struct usb_ctrl_setup { | |
197 | unsigned char bRequestType; | |
198 | unsigned char bRequest; | |
199 | unsigned short wValue; | |
200 | unsigned short wIndex; | |
201 | unsigned short wLength; | |
202 | }; | |
203 | ||
204 | /* | |
205 | * Standard requests | |
206 | */ | |
207 | #define USB_REQ_GET_STATUS 0x00 | |
208 | #define USB_REQ_CLEAR_FEATURE 0x01 | |
209 | /* 0x02 is reserved */ | |
210 | #define USB_REQ_SET_FEATURE 0x03 | |
211 | /* 0x04 is reserved */ | |
212 | #define USB_REQ_SET_ADDRESS 0x05 | |
213 | #define USB_REQ_GET_DESCRIPTOR 0x06 | |
214 | #define USB_REQ_SET_DESCRIPTOR 0x07 | |
215 | #define USB_REQ_GET_CONFIGURATION 0x08 | |
216 | #define USB_REQ_SET_CONFIGURATION 0x09 | |
217 | #define USB_REQ_GET_INTERFACE 0x0A | |
218 | #define USB_REQ_SET_INTERFACE 0x0B | |
219 | #define USB_REQ_SYNCH_FRAME 0x0C | |
220 | ||
221 | #define USB_TYPE_STANDARD (0x00 << 5) | |
222 | #define USB_TYPE_CLASS (0x01 << 5) | |
223 | #define USB_TYPE_VENDOR (0x02 << 5) | |
224 | #define USB_TYPE_RESERVED (0x03 << 5) | |
225 | ||
226 | #define USB_RECIP_DEVICE 0x00 | |
227 | #define USB_RECIP_INTERFACE 0x01 | |
228 | #define USB_RECIP_ENDPOINT 0x02 | |
229 | #define USB_RECIP_OTHER 0x03 | |
230 | ||
231 | /* | |
232 | * Various libusb API related stuff | |
233 | */ | |
234 | ||
235 | #define USB_ENDPOINT_IN 0x80 | |
236 | #define USB_ENDPOINT_OUT 0x00 | |
237 | ||
238 | /* Error codes */ | |
239 | #define USB_ERROR_BEGIN 500000 | |
240 | ||
241 | /* | |
242 | * This is supposed to look weird. This file is generated from autoconf | |
243 | * and I didn't want to make this too complicated. | |
244 | */ | |
245 | #define USB_LE16_TO_CPU(x) | |
246 | ||
247 | /* Data types */ | |
248 | /* struct usb_device; */ | |
249 | /* struct usb_bus; */ | |
250 | ||
251 | struct usb_device { | |
252 | struct usb_device *next, *prev; | |
253 | ||
254 | char filename[LIBUSB_PATH_MAX]; | |
255 | ||
256 | struct usb_bus *bus; | |
257 | ||
258 | struct usb_device_descriptor descriptor; | |
259 | struct usb_config_descriptor *config; | |
260 | ||
261 | void *dev; /* Darwin support */ | |
262 | ||
263 | unsigned char devnum; | |
264 | ||
265 | unsigned char num_children; | |
266 | struct usb_device **children; | |
267 | }; | |
268 | ||
269 | struct usb_bus { | |
270 | struct usb_bus *next, *prev; | |
271 | ||
272 | char dirname[LIBUSB_PATH_MAX]; | |
273 | ||
274 | struct usb_device *devices; | |
275 | unsigned long location; | |
276 | ||
277 | struct usb_device *root_dev; | |
278 | }; | |
279 | ||
280 | /* Version information, Windows specific */ | |
281 | struct usb_version { | |
282 | struct { | |
283 | int major; | |
284 | int minor; | |
285 | int micro; | |
286 | int nano; | |
287 | } dll; | |
288 | struct { | |
289 | int major; | |
290 | int minor; | |
291 | int micro; | |
292 | int nano; | |
293 | } driver; | |
294 | }; | |
295 | ||
296 | ||
297 | struct usb_dev_handle; | |
298 | typedef struct usb_dev_handle usb_dev_handle; | |
299 | ||
300 | /* Variables */ | |
301 | #ifndef __USB_C__ | |
302 | #define usb_busses usb_get_busses() | |
303 | #endif | |
304 | ||
305 | ||
306 | ||
307 | #include <poppack.h> | |
308 | ||
309 | ||
310 | #ifdef __cplusplus | |
311 | extern "C" { | |
312 | #endif | |
313 | ||
314 | /* Function prototypes */ | |
315 | ||
316 | /* usb.c */ | |
317 | usb_dev_handle *usb_open(struct usb_device *dev); | |
318 | int usb_close(usb_dev_handle *dev); | |
319 | int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, | |
320 | size_t buflen); | |
321 | int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, | |
322 | size_t buflen); | |
323 | ||
324 | /* descriptors.c */ | |
325 | int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, | |
326 | unsigned char type, unsigned char index, | |
327 | void *buf, int size); | |
328 | int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, | |
329 | unsigned char index, void *buf, int size); | |
330 | ||
331 | /* <arch>.c */ | |
332 | int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, | |
333 | int timeout); | |
334 | int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, | |
335 | int timeout); | |
336 | int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, | |
337 | int timeout); | |
338 | int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, | |
339 | int timeout); | |
340 | int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, | |
341 | int value, int index, char *bytes, int size, | |
342 | int timeout); | |
343 | int usb_set_configuration(usb_dev_handle *dev, int configuration); | |
344 | int usb_claim_interface(usb_dev_handle *dev, int interface); | |
345 | int usb_release_interface(usb_dev_handle *dev, int interface); | |
346 | int usb_set_altinterface(usb_dev_handle *dev, int alternate); | |
347 | int usb_resetep(usb_dev_handle *dev, unsigned int ep); | |
348 | int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); | |
349 | int usb_reset(usb_dev_handle *dev); | |
350 | ||
351 | char *usb_strerror(void); | |
352 | ||
353 | void usb_init(void); | |
354 | void usb_set_debug(int level); | |
355 | int usb_find_busses(void); | |
356 | int usb_find_devices(void); | |
357 | struct usb_device *usb_device(usb_dev_handle *dev); | |
358 | struct usb_bus *usb_get_busses(void); | |
359 | ||
360 | ||
361 | /* Windows specific functions */ | |
362 | ||
363 | #define LIBUSB_HAS_INSTALL_SERVICE_NP 1 | |
364 | int usb_install_service_np(void); | |
365 | void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, | |
366 | LPSTR cmd_line, int cmd_show); | |
367 | ||
368 | #define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 | |
369 | int usb_uninstall_service_np(void); | |
370 | void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, | |
371 | LPSTR cmd_line, int cmd_show); | |
372 | ||
373 | #define LIBUSB_HAS_INSTALL_DRIVER_NP 1 | |
374 | int usb_install_driver_np(const char *inf_file); | |
375 | void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, | |
376 | LPSTR cmd_line, int cmd_show); | |
377 | ||
378 | #define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 | |
379 | int usb_touch_inf_file_np(const char *inf_file); | |
380 | void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, | |
381 | LPSTR cmd_line, int cmd_show); | |
382 | ||
383 | #define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 | |
384 | int usb_install_needs_restart_np(void); | |
385 | ||
386 | const struct usb_version *usb_get_version(void); | |
387 | ||
388 | int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, | |
389 | unsigned char ep, int pktsize); | |
390 | int usb_bulk_setup_async(usb_dev_handle *dev, void **context, | |
391 | unsigned char ep); | |
392 | int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, | |
393 | unsigned char ep); | |
394 | ||
395 | int usb_submit_async(void *context, char *bytes, int size); | |
396 | int usb_reap_async(void *context, int timeout); | |
397 | int usb_reap_async_nocancel(void *context, int timeout); | |
398 | int usb_cancel_async(void *context); | |
399 | int usb_free_async(void **context); | |
400 | ||
401 | ||
402 | #ifdef __cplusplus | |
403 | } | |
404 | #endif | |
405 | ||
406 | #endif /* __USB_H__ */ | |
407 |
0 | /************************************************************************** | |
1 | * | |
2 | * Copyright 2010, Roger Brown | |
3 | * | |
4 | * This file is part of Roger Brown's Toolkit. | |
5 | * | |
6 | * Roger Brown's Toolkit is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * Roger Brown's Toolkit is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with Roger Brown's Toolkit. If not, see <http://www.gnu.org/licenses/>. | |
18 | * | |
19 | */ | |
20 | ||
21 | /* | |
22 | * $Id: usbstub.cpp 1220 2010-05-04 03:14:56Z roger.brown $ | |
23 | */ | |
24 | ||
25 | /* | |
26 | * this is a stub loader for the LIBUSB0.DLL | |
27 | */ | |
28 | ||
29 | #include <usb.h> | |
30 | ||
31 | #define LIBUSB_CALLTYPE __cdecl | |
32 | ||
33 | extern "C" | |
34 | { | |
35 | typedef void (LIBUSB_CALLTYPE *voidProc)(void); | |
36 | } | |
37 | ||
38 | class CStubLoader | |
39 | { | |
40 | HMODULE hDll; | |
41 | CRITICAL_SECTION cs; | |
42 | const char *name; | |
43 | ||
44 | void bomb(DWORD dw) | |
45 | { | |
46 | RaiseException(dw,EXCEPTION_NONCONTINUABLE,0,0); | |
47 | } | |
48 | ||
49 | public: | |
50 | ~CStubLoader() | |
51 | { | |
52 | /* if (hDll) | |
53 | { | |
54 | FreeLibrary(hDll); | |
55 | }*/ | |
56 | ||
57 | DeleteCriticalSection(&cs); | |
58 | } | |
59 | ||
60 | CStubLoader(const char *n) : name(n) | |
61 | { | |
62 | InitializeCriticalSection(&cs); | |
63 | } | |
64 | ||
65 | HMODULE get_dll(void) | |
66 | { | |
67 | HMODULE h=NULL; | |
68 | DWORD dw=0; | |
69 | ||
70 | EnterCriticalSection(&cs); | |
71 | ||
72 | if (!hDll) | |
73 | { | |
74 | hDll=LoadLibrary(name); | |
75 | if (!hDll) dw=GetLastError(); | |
76 | } | |
77 | ||
78 | h=hDll; | |
79 | ||
80 | LeaveCriticalSection(&cs); | |
81 | ||
82 | if (!h) | |
83 | { | |
84 | bomb(dw); | |
85 | } | |
86 | ||
87 | return h; | |
88 | } | |
89 | ||
90 | voidProc GetProc(const char *name) | |
91 | { | |
92 | voidProc p=(voidProc)GetProcAddress(get_dll(),name); | |
93 | ||
94 | if (!p) | |
95 | { | |
96 | bomb(GetLastError()); | |
97 | } | |
98 | ||
99 | return p; | |
100 | } | |
101 | }; | |
102 | ||
103 | ||
104 | static CStubLoader libusb0("LIBUSB0"); | |
105 | ||
106 | extern "C" | |
107 | { | |
108 | # define MAP_FN(ret,name,args) \ | |
109 | typedef ret (LIBUSB_CALLTYPE *pfn_##name##_t)args; \ | |
110 | static ret LIBUSB_CALLTYPE load_##name args; \ | |
111 | static pfn_##name##_t pfn_##name=load_##name,test_##name=##name; | |
112 | ||
113 | # define LOAD_FN(name) int success=1; __try { pfn_##name=(pfn_##name##_t)libusb0.GetProc(#name); } __except(1) { success=0; } | |
114 | ||
115 | MAP_FN(int,usb_reset,(usb_dev_handle *dev)) | |
116 | MAP_FN(int,usb_claim_interface,(usb_dev_handle *dev,int)) | |
117 | MAP_FN(int,usb_find_busses,(void)) | |
118 | MAP_FN(int,usb_find_devices,(void)) | |
119 | MAP_FN(void,usb_init,(void)) | |
120 | MAP_FN(int,usb_close,(usb_dev_handle *dev)) | |
121 | MAP_FN(int,usb_bulk_write,(usb_dev_handle *,int,char *,int,int)); | |
122 | MAP_FN(int,usb_bulk_read,(usb_dev_handle *,int,char *,int,int)); | |
123 | MAP_FN(usb_dev_handle *,usb_open,(struct usb_device *)); | |
124 | MAP_FN(int,usb_set_configuration,(usb_dev_handle *,int)); | |
125 | MAP_FN(usb_bus *,usb_get_busses,(void)); | |
126 | MAP_FN(int,usb_release_interface,(usb_dev_handle *,int)); | |
127 | MAP_FN(int,usb_get_string_simple,(usb_dev_handle *dev, int index, char *buf,size_t buflen)); | |
128 | ||
129 | static int LIBUSB_CALLTYPE load_usb_reset(usb_dev_handle *dev) | |
130 | { | |
131 | LOAD_FN(usb_reset); | |
132 | ||
133 | return success ? usb_reset(dev) : -1; | |
134 | } | |
135 | ||
136 | static int LIBUSB_CALLTYPE load_usb_claim_interface(usb_dev_handle *dev,int interface) | |
137 | { | |
138 | LOAD_FN(usb_claim_interface) | |
139 | ||
140 | return success ? usb_claim_interface(dev,interface) : -1; | |
141 | } | |
142 | ||
143 | static int LIBUSB_CALLTYPE load_usb_release_interface(usb_dev_handle *dev,int interface) | |
144 | { | |
145 | LOAD_FN(usb_release_interface) | |
146 | ||
147 | return success ? usb_release_interface(dev,interface) : -1; | |
148 | } | |
149 | ||
150 | static int LIBUSB_CALLTYPE load_usb_close(usb_dev_handle *dev) | |
151 | { | |
152 | LOAD_FN(usb_close) | |
153 | ||
154 | return success ? usb_close(dev) : -1; | |
155 | } | |
156 | ||
157 | static usb_dev_handle * LIBUSB_CALLTYPE load_usb_open(struct usb_device *dev) | |
158 | { | |
159 | LOAD_FN(usb_open) | |
160 | ||
161 | return success ? usb_open(dev) : NULL; | |
162 | } | |
163 | ||
164 | static int LIBUSB_CALLTYPE load_usb_find_devices(void) | |
165 | { | |
166 | LOAD_FN(usb_find_devices) | |
167 | ||
168 | return success ? usb_find_devices() : -1; | |
169 | } | |
170 | ||
171 | static int LIBUSB_CALLTYPE load_usb_find_busses(void) | |
172 | { | |
173 | LOAD_FN(usb_find_busses) | |
174 | ||
175 | return success ? usb_find_busses() : -1; | |
176 | } | |
177 | ||
178 | static int LIBUSB_CALLTYPE load_usb_set_configuration(usb_dev_handle *dev,int configuration) | |
179 | { | |
180 | LOAD_FN(usb_set_configuration) | |
181 | ||
182 | return success ? usb_set_configuration(dev,configuration) : -1; | |
183 | } | |
184 | ||
185 | static usb_bus * LIBUSB_CALLTYPE load_usb_get_busses(void) | |
186 | { | |
187 | LOAD_FN(usb_get_busses) | |
188 | ||
189 | return success ? usb_get_busses() : NULL; | |
190 | } | |
191 | ||
192 | static void LIBUSB_CALLTYPE load_usb_init(void) | |
193 | { | |
194 | LOAD_FN(usb_init) | |
195 | ||
196 | if (success) usb_init(); | |
197 | } | |
198 | ||
199 | static int LIBUSB_CALLTYPE load_usb_bulk_read(usb_dev_handle *dev,int ep,char *bytes,int size,int timeout) | |
200 | { | |
201 | LOAD_FN(usb_bulk_read); | |
202 | ||
203 | return success ? usb_bulk_read(dev,ep,bytes,size,timeout) : -1; | |
204 | } | |
205 | ||
206 | static int LIBUSB_CALLTYPE load_usb_bulk_write(usb_dev_handle *dev,int ep,char *bytes,int size,int timeout) | |
207 | { | |
208 | LOAD_FN(usb_bulk_write); | |
209 | ||
210 | return success ? usb_bulk_write(dev,ep,bytes,size,timeout) : -1; | |
211 | } | |
212 | ||
213 | static int LIBUSB_CALLTYPE load_usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, | |
214 | size_t buflen) | |
215 | { | |
216 | LOAD_FN(usb_get_string_simple); | |
217 | ||
218 | return success ? usb_get_string_simple(dev,index,buf,buflen) : -1; | |
219 | } | |
220 | } | |
221 | ||
222 | int LIBUSB_CALLTYPE usb_claim_interface(usb_dev_handle *dev, int interface) | |
223 | { | |
224 | return pfn_usb_claim_interface(dev,interface); | |
225 | } | |
226 | ||
227 | int LIBUSB_CALLTYPE usb_reset(usb_dev_handle *dev) | |
228 | { | |
229 | return pfn_usb_reset(dev); | |
230 | } | |
231 | ||
232 | int LIBUSB_CALLTYPE usb_find_busses(void) | |
233 | { | |
234 | return pfn_usb_find_busses(); | |
235 | } | |
236 | ||
237 | int LIBUSB_CALLTYPE usb_find_devices(void) | |
238 | { | |
239 | return pfn_usb_find_devices(); | |
240 | } | |
241 | ||
242 | void LIBUSB_CALLTYPE usb_init(void) | |
243 | { | |
244 | pfn_usb_init(); | |
245 | } | |
246 | ||
247 | int LIBUSB_CALLTYPE usb_close(usb_dev_handle *dev) | |
248 | { | |
249 | return pfn_usb_close(dev); | |
250 | } | |
251 | ||
252 | usb_dev_handle * LIBUSB_CALLTYPE usb_open(struct usb_device *dev) | |
253 | { | |
254 | return pfn_usb_open(dev); | |
255 | } | |
256 | ||
257 | int LIBUSB_CALLTYPE usb_set_configuration(usb_dev_handle *dev, int configuration) | |
258 | { | |
259 | return pfn_usb_set_configuration(dev,configuration); | |
260 | } | |
261 | ||
262 | struct usb_bus * LIBUSB_CALLTYPE usb_get_busses(void) | |
263 | { | |
264 | return pfn_usb_get_busses(); | |
265 | } | |
266 | ||
267 | int LIBUSB_CALLTYPE usb_release_interface(usb_dev_handle *dev, int interface) | |
268 | { | |
269 | return pfn_usb_release_interface(dev,interface); | |
270 | } | |
271 | ||
272 | int LIBUSB_CALLTYPE usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, | |
273 | int timeout) | |
274 | { | |
275 | return pfn_usb_bulk_write(dev,ep,bytes,size,timeout); | |
276 | } | |
277 | ||
278 | int LIBUSB_CALLTYPE usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, | |
279 | int timeout) | |
280 | { | |
281 | return pfn_usb_bulk_read(dev,ep,bytes,size,timeout); | |
282 | } | |
283 | ||
284 | int LIBUSB_CALLTYPE usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, | |
285 | size_t buflen) | |
286 | { | |
287 | return pfn_usb_get_string_simple(dev,index,buf,buflen); | |
288 | } | |
289 | ||
290 | ||
291 | ||
292 | ||
293 |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_PATCH@,0 | |
4 | PRODUCTVERSION @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_PATCH@,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS 0L | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE @RC_FILE_TYPE@ | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "040904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "@RC_COMMENT@\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "\0" | |
22 | VALUE "FileVersion", "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@.0\0" | |
23 | VALUE "InternalName", "@RC_INTERNAL_NAME@ @WIN32_MODE@\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) @CURRENT_YEAR@\0" | |
25 | VALUE "OriginalFilename", "@RC_ORIGINAL_NAME@\0" | |
26 | VALUE "ProductName", "@PACKAGE_NAME@ @WIN32_MODE@\0" | |
27 | VALUE "ProductVersion", "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x0409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfc-anticol\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-ANTICOL.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfc-emulate\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-EMULATE.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfc-list\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-LIST.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfc-mfclassic\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-MFCLASSIC.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfc-mfultralight\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-MFULTRALIGHT.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfc-poll\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-POLL.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfc-relay\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-RELAY.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | LIBRARY NFC | |
1 | VERSION 1.3.9 | |
0 | LIBRARY libnfc | |
1 | VERSION 1.7 | |
2 | 2 | |
3 | 3 | EXPORTS |
4 | nfc_list_devices | |
5 | nfc_connect | |
6 | nfc_disconnect | |
7 | nfc_configure | |
8 | nfc_initiator_init | |
9 | nfc_initiator_select_passive_target | |
10 | nfc_initiator_list_passive_targets | |
11 | nfc_initiator_select_dep_target | |
12 | nfc_initiator_deselect_target | |
13 | nfc_initiator_poll_targets | |
14 | nfc_initiator_transceive_bits | |
15 | nfc_initiator_transceive_bytes | |
16 | nfc_target_init | |
17 | nfc_target_receive_bits | |
18 | nfc_target_receive_bytes | |
19 | nfc_target_send_bits | |
20 | nfc_target_send_bytes | |
21 | nfc_device_name | |
22 | iso14443a_crc | |
23 | append_iso14443a_crc | |
24 | nfc_version | |
25 | nfc_perror | |
26 | nfc_strerror | |
27 | nfc_strerror_r | |
4 | nfc_init | |
5 | nfc_exit | |
6 | nfc_open | |
7 | nfc_close | |
8 | nfc_abbort_command | |
9 | nfc_list_devices | |
10 | nfc_idle | |
11 | nfc_initiator_init | |
12 | nfc_initiator_init_secure_element | |
13 | nfc_initiator_select_passive_target | |
14 | nfc_initiator_list_passive_targets | |
15 | nfc_initiator_poll_target | |
16 | nfc_initiator_select_dep_target | |
17 | nfc_initiator_poll_dep_target | |
18 | nfc_initiator_deselect_target | |
19 | nfc_initiator_poll_targets | |
20 | nfc_initiator_transceive_bytes | |
21 | nfc_initiator_transceive_bits | |
22 | nfc_initiator_transceive_bytes_timed | |
23 | nfc_initiator_transceive_bits_timed | |
24 | nfc_initiator_target_is_present | |
25 | nfc_target_init | |
26 | nfc_target_send_bytes | |
27 | nfc_target_receive_bytes | |
28 | nfc_target_send_bits | |
29 | nfc_target_receive_bits | |
30 | nfc_strerror | |
31 | nfc_strerror_r | |
32 | nfc_perror | |
33 | nfc_device_get_last_error | |
34 | nfc_device_get_name | |
35 | nfc_device_get_connstring | |
36 | nfc_device_get_supported_modulation | |
37 | nfc_device_get_supported_baud_rate | |
38 | nfc_device_set_property_int | |
39 | nfc_device_set_property_bool | |
40 | iso14443a_crc | |
41 | iso14443a_crc_append | |
42 | iso14443a_locate_historical_bytes | |
43 | nfc_version | |
44 | nfc_device_get_information_about | |
45 | str_nfc_modulation_type | |
46 | str_nfc_baud_rate | |
47 | str_nfc_target |
0 | #include <windows.h> | |
1 | ||
2 | 1 VERSIONINFO | |
3 | PRODUCTVERSION 1,3,9,0 | |
4 | FILEOS VOS__WINDOWS32 | |
5 | FILEVERSION 1,3,9,0 | |
6 | FILETYPE VFT_DLL | |
7 | BEGIN | |
8 | BLOCK "StringFileInfo" | |
9 | BEGIN | |
10 | BLOCK "140904E4" | |
11 | BEGIN | |
12 | VALUE "CompanyName","nfc.org\000\000" | |
13 | VALUE "LegalCopyright","Copyright (C) 2009, Roel Verdult\000\000" | |
14 | VALUE "ProductName","nfc\000\000" | |
15 | VALUE "ProductVersion","1.4.0.0\000\000" | |
16 | VALUE "Comments","Demonstration Win32 packaging\000\000" | |
17 | VALUE "FileDescription","Near Field Communication Library\000\000" | |
18 | VALUE "FileVersion","1.4.0.0\000\000" | |
19 | VALUE "InternalName","nfc\000\000" | |
20 | VALUE "OriginalFilename","NFC.DLL\000\000" | |
21 | END | |
22 | END | |
23 | BLOCK "VarFileInfo" | |
24 | BEGIN | |
25 | VALUE "Translation", 0x1409, 1252 | |
26 | END | |
27 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfcip-initiator\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFC-INITIATOR.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |
0 | #include "windows.h" | |
1 | ||
2 | 1 VERSIONINFO | |
3 | FILEVERSION 1,3,9,0 | |
4 | PRODUCTVERSION 1,3,9,0 | |
5 | FILEFLAGSMASK 0x3fL | |
6 | #ifdef _DEBUG | |
7 | FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE | |
8 | #else | |
9 | FILEFLAGS VS_FF_PRERELEASE | |
10 | #endif | |
11 | FILEOS VOS_NT_WINDOWS32 | |
12 | FILETYPE VFT_APP | |
13 | FILESUBTYPE 0x0L | |
14 | BEGIN | |
15 | BLOCK "StringFileInfo" | |
16 | BEGIN | |
17 | BLOCK "140904e4" | |
18 | BEGIN | |
19 | VALUE "Comments", "example from libnfc\0" | |
20 | VALUE "CompanyName", "libnfc.org\0" | |
21 | VALUE "FileDescription", "NFC test application\0" | |
22 | VALUE "FileVersion", "1.4.0.0\0" | |
23 | VALUE "InternalName", "nfcip-target\0" | |
24 | VALUE "LegalCopyright", "Copyright (C) 2009, Roel Verdult\0" | |
25 | VALUE "OriginalFilename", "NFCIP-TARGET.EXE\0" | |
26 | VALUE "ProductName", "libnfc\0" | |
27 | VALUE "ProductVersion", "1.4.0.0\0" | |
28 | END | |
29 | END | |
30 | BLOCK "VarFileInfo" | |
31 | BEGIN | |
32 | VALUE "Translation", 0x1409, 1252 | |
33 | END | |
34 | END |