bla
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
|
||||
pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \
|
||||
rfid_layer2.h rfid_layer2_iso14443a.h \
|
||||
rfid_layer2_iso14443b.h rfid_layer2_iso15693.h \
|
||||
rfid_protocol.h rfid_protocol_tcl.h \
|
||||
rfid_protocol_mifare_ul.h \
|
||||
rfid_protocol_mifare_classic.h \
|
||||
rfid_reader.h \
|
||||
rfid_system.h \
|
||||
rfid_access_mifare_classic.h \
|
||||
rfid_reader_cm5121.h \
|
||||
rfid_reader_openpcd.h
|
||||
|
||||
@@ -0,0 +1,467 @@
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = include/librfid
|
||||
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILDENV = @BUILDENV@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FIRMWARE_PATH = @FIRMWARE_PATH@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPENCT_CFLAGS = @OPENCT_CFLAGS@
|
||||
OPENCT_LIBS = @OPENCT_LIBS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
to_host_path_cmd = @to_host_path_cmd@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
pkginclude_HEADERS = rfid.h rfid_scan.h rfid_asic.h rfid_asic_rc632.h \
|
||||
rfid_layer2.h rfid_layer2_iso14443a.h \
|
||||
rfid_layer2_iso14443b.h rfid_layer2_iso15693.h \
|
||||
rfid_protocol.h rfid_protocol_tcl.h \
|
||||
rfid_protocol_mifare_ul.h \
|
||||
rfid_protocol_mifare_classic.h \
|
||||
rfid_reader.h \
|
||||
rfid_system.h \
|
||||
rfid_access_mifare_classic.h \
|
||||
rfid_reader_cm5121.h \
|
||||
rfid_reader_openpcd.h
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/librfid/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/librfid/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-pkgincludeHEADERS install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,64 @@
|
||||
#ifndef _RFID_H
|
||||
#define _RFID_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define ENOTSUP 100
|
||||
#define ETIMEDOUT 101
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef unsigned short u_int16_t;
|
||||
typedef unsigned long u_int32_t;
|
||||
typedef unsigned long long u_int64_t;
|
||||
#endif/*__MINGW32__*/
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
#include <librfid/rfid_system.h>
|
||||
|
||||
#ifdef DEBUG_LIBRFID
|
||||
|
||||
#ifdef LIBRFID_FIRMWARE
|
||||
extern void debugp(const char *format, ...);
|
||||
extern const char *hexdump(const void *data, unsigned int len);
|
||||
#define rfid_hexdump(x, y) hexdump(x, y)
|
||||
#define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
|
||||
#define DEBUGPC(x, args ...) debugp(x, ## args)
|
||||
#else /* LIBRFID_FIRMWARE */
|
||||
extern const char *rfid_hexdump(const void *data, unsigned int len);
|
||||
#define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
|
||||
#define DEBUGPC(x, args ...) fprintf(stderr, x, ## args)
|
||||
#endif /* LIBRFID_FIRMWARE */
|
||||
|
||||
#else /* DEBUG */
|
||||
extern const char *rfid_hexdump(const void *data, unsigned int len);
|
||||
|
||||
#define DEBUGP(x, args ...)
|
||||
#define DEBUGPC(x, args ...)
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#endif
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
int rfid_init();
|
||||
|
||||
enum rfid_opt_level {
|
||||
RFID_LEVEL_ASIC,
|
||||
RFID_LEVEL_READER,
|
||||
RFID_LEVEL_LAYER2,
|
||||
RFID_LEVEL_LAYER3,
|
||||
};
|
||||
|
||||
enum rfid_frametype {
|
||||
RFID_14443A_FRAME_REGULAR,
|
||||
RFID_14443B_FRAME_REGULAR,
|
||||
RFID_MIFARE_FRAME,
|
||||
};
|
||||
|
||||
#endif /* _RFID_H */
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef _RFID_MIFARE_ACCESS_H
|
||||
#define _RFID_MIFARE_ACCESS_H
|
||||
|
||||
struct mfcl_access_sect {
|
||||
u_int8_t block[4];
|
||||
};
|
||||
|
||||
int mfcl_compile_access(u_int8_t *encoded,
|
||||
const struct mfcl_access_sect *ac);
|
||||
int mfcl_parse_access(struct mfcl_access_sect *ac, u_int8_t *encoded);
|
||||
|
||||
|
||||
enum mfcl_access_exp_data {
|
||||
MFCL_ACCESS_NEVER = 0,
|
||||
MFCL_ACCESS_KEY_A = 1,
|
||||
MFCL_ACCESS_KEY_B = 2,
|
||||
};
|
||||
|
||||
struct mfcl_access_exp_block {
|
||||
u_int8_t read:2,
|
||||
write:2,
|
||||
inc:2,
|
||||
dec:2;
|
||||
};
|
||||
|
||||
struct mfcl_access_exp_acc {
|
||||
u_int16_t key_a_rd:2,
|
||||
key_a_wr:2,
|
||||
acc_rd:2,
|
||||
acc_wr:2,
|
||||
key_b_rd:2,
|
||||
key_b_wr:2;
|
||||
};
|
||||
|
||||
|
||||
struct mfcl_access_exp_sect {
|
||||
struct mfcl_access_exp_block block[3];
|
||||
struct mfcl_access_exp_acc acc;
|
||||
};
|
||||
|
||||
void mfcl_access_to_exp(struct mfcl_access_exp_sect *exp,
|
||||
const struct mfcl_access_sect *sect);
|
||||
|
||||
char *mfcl_access_exp_stringify(const struct mfcl_access_exp_block *exp);
|
||||
char *mfcl_access_exp_acc_stringify(const struct mfcl_access_exp_acc *acc);
|
||||
#endif
|
||||
@@ -0,0 +1,55 @@
|
||||
#ifndef _RFID_ASIC_H
|
||||
#define _RFID_ASIC_H
|
||||
|
||||
enum rfid_frametype;
|
||||
|
||||
#include <librfid/rfid_asic_rc632.h>
|
||||
|
||||
/* a low-level transport, over which the ASIC layer can talk to its ASIC */
|
||||
struct rfid_asic_transport {
|
||||
char *name;
|
||||
union {
|
||||
struct rfid_asic_rc632_transport rc632;
|
||||
} priv;
|
||||
};
|
||||
|
||||
/* An instance handle to 'struct rfid_asic_transport' */
|
||||
struct rfid_asic_transport_handle {
|
||||
void *data; /* handle to stuff like even lower layers */
|
||||
|
||||
struct rfid_asic_transport *rat;
|
||||
};
|
||||
|
||||
/* Some implementation-specific data. A reader will specify one of these for
|
||||
* ASIC-specific parameters such as e.g. RC632 mod conductance */
|
||||
|
||||
struct rfid_asic_implementation {
|
||||
union {
|
||||
struct rfid_asic_rc632_impl rc632;
|
||||
} priv;
|
||||
};
|
||||
|
||||
struct rfid_asic_handle {
|
||||
struct rfid_asic_transport_handle *rath;
|
||||
unsigned int fc;
|
||||
unsigned int mtu;
|
||||
unsigned int mru;
|
||||
|
||||
union {
|
||||
struct rfid_asic_rc632_handle rc632;
|
||||
//struct rfid_asic_rc531_handle rc531;
|
||||
} priv;
|
||||
struct rfid_asic *asic;
|
||||
};
|
||||
|
||||
|
||||
struct rfid_asic {
|
||||
char *name;
|
||||
unsigned int fc; /* carrier frequency */
|
||||
union {
|
||||
struct rfid_asic_rc632 rc632;
|
||||
//struct rfid_asic_rc531 rc531;
|
||||
} priv;
|
||||
};
|
||||
|
||||
#endif /* _RFID_ASIC_H */
|
||||
@@ -0,0 +1,97 @@
|
||||
#ifndef _RFID_ASIC_RC632_H
|
||||
#define _RFID_ASIC_RC632_H
|
||||
|
||||
struct rfid_asic_transport_handle;
|
||||
|
||||
#include <librfid/rfid.h>
|
||||
#include <librfid/rfid_asic.h>
|
||||
|
||||
struct rfid_asic_rc632_transport {
|
||||
struct {
|
||||
int (*reg_write)(struct rfid_asic_transport_handle *rath,
|
||||
u_int8_t reg,
|
||||
u_int8_t value);
|
||||
int (*reg_read)(struct rfid_asic_transport_handle *rath,
|
||||
u_int8_t reg,
|
||||
u_int8_t *value);
|
||||
int (*fifo_write)(struct rfid_asic_transport_handle *rath,
|
||||
u_int8_t len,
|
||||
const u_int8_t *buf,
|
||||
u_int8_t flags);
|
||||
int (*fifo_read)(struct rfid_asic_transport_handle *rath,
|
||||
u_int8_t len,
|
||||
u_int8_t *buf);
|
||||
} fn;
|
||||
};
|
||||
|
||||
struct rfid_asic_handle;
|
||||
|
||||
struct iso14443a_atqa;
|
||||
struct iso14443a_anticol_cmd;
|
||||
|
||||
struct rfid_asic_rc632 {
|
||||
struct {
|
||||
int (*power_up)(struct rfid_asic_handle *h);
|
||||
int (*power_down)(struct rfid_asic_handle *h);
|
||||
int (*turn_on_rf)(struct rfid_asic_handle *h);
|
||||
int (*turn_off_rf)(struct rfid_asic_handle *h);
|
||||
int (*transceive)(struct rfid_asic_handle *h,
|
||||
enum rfid_frametype,
|
||||
const u_int8_t *tx_buf,
|
||||
unsigned int tx_len,
|
||||
u_int8_t *rx_buf,
|
||||
unsigned int *rx_len,
|
||||
u_int64_t timeout,
|
||||
unsigned int flags);
|
||||
struct {
|
||||
int (*init)(struct rfid_asic_handle *h);
|
||||
int (*transceive_sf)(struct rfid_asic_handle *h,
|
||||
u_int8_t cmd,
|
||||
struct iso14443a_atqa *atqa);
|
||||
int (*transceive_acf)(struct rfid_asic_handle *h,
|
||||
struct iso14443a_anticol_cmd *cmd,
|
||||
unsigned int *bit_of_col);
|
||||
int (*set_speed)(struct rfid_asic_handle *h,
|
||||
unsigned int tx,
|
||||
unsigned int speed);
|
||||
} iso14443a;
|
||||
struct {
|
||||
int (*init)(struct rfid_asic_handle *h);
|
||||
} iso14443b;
|
||||
struct {
|
||||
int (*init)(struct rfid_asic_handle *h);
|
||||
} iso15693;
|
||||
struct {
|
||||
int (*setkey)(struct rfid_asic_handle *h,
|
||||
const unsigned char *key);
|
||||
int (*auth)(struct rfid_asic_handle *h, u_int8_t cmd,
|
||||
u_int32_t serno, u_int8_t block);
|
||||
} mifare_classic;
|
||||
} fn;
|
||||
};
|
||||
|
||||
struct rc632_transport_handle {
|
||||
};
|
||||
|
||||
/* A handle to a specific RC632 chip */
|
||||
struct rfid_asic_rc632_handle {
|
||||
struct rc632_transport_handle th;
|
||||
};
|
||||
|
||||
struct rfid_asic_rc632_impl_proto {
|
||||
u_int8_t mod_conductance;
|
||||
u_int8_t cw_conductance;
|
||||
u_int8_t bitphase;
|
||||
u_int8_t threshold;
|
||||
};
|
||||
|
||||
struct rfid_asic_rc632_impl {
|
||||
u_int32_t mru; /* maximum receive unit (PICC->PCD) */
|
||||
u_int32_t mtu; /* maximum transmit unit (PCD->PICC) */
|
||||
//struct rfid_asic_rc632_impl_proto proto[NUM_RFID_PROTOCOLS];
|
||||
};
|
||||
|
||||
extern struct rfid_asic_handle * rc632_open(struct rfid_asic_transport_handle *th);
|
||||
extern void rc632_close(struct rfid_asic_handle *h);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,84 @@
|
||||
#ifndef _RFID_LAYER2_H
|
||||
#define _RFID_LAYER2_H
|
||||
|
||||
#include <librfid/rfid.h>
|
||||
|
||||
struct rfid_layer2_handle;
|
||||
struct rfid_reader_handle;
|
||||
|
||||
enum rfid_layer2_id {
|
||||
RFID_LAYER2_NONE,
|
||||
RFID_LAYER2_ISO14443A,
|
||||
RFID_LAYER2_ISO14443B,
|
||||
RFID_LAYER2_ISO15693,
|
||||
};
|
||||
|
||||
/* 0...0xffff = global options, 0x10000...0x1ffff = private options */
|
||||
#define RFID_OPT_L2_PRIV 0x00010000
|
||||
enum rfid_layer2_opt {
|
||||
RFID_OPT_LAYER2_UID = 0x0001,
|
||||
RFID_OPT_LAYER2_PROTO_SUPP = 0x0002,
|
||||
RFID_OPT_LAYER2_WUP = 0x0003,
|
||||
};
|
||||
|
||||
struct rfid_layer2_handle *rfid_layer2_init(struct rfid_reader_handle *rh,
|
||||
unsigned int id);
|
||||
int rfid_layer2_open(struct rfid_layer2_handle *l2h);
|
||||
int rfid_layer2_transceive(struct rfid_layer2_handle *l2h,
|
||||
enum rfid_frametype frametype,
|
||||
const unsigned char *tx_buf, unsigned int tx_len,
|
||||
unsigned char *rx_buf, unsigned int *rx_len,
|
||||
u_int64_t timeout, unsigned int flags);
|
||||
int rfid_layer2_close(struct rfid_layer2_handle *l2h);
|
||||
int rfid_layer2_fini(struct rfid_layer2_handle *l2h);
|
||||
int rfid_layer2_getopt(struct rfid_layer2_handle *ph, int optname,
|
||||
void *optval, unsigned int *optlen);
|
||||
int rfid_layer2_setopt(struct rfid_layer2_handle *ph, int optname,
|
||||
const void *optval, unsigned int optlen);
|
||||
char *rfid_layer2_name(struct rfid_layer2_handle *l2h);
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
#include <librfid/rfid_layer2_iso14443a.h>
|
||||
#include <librfid/rfid_layer2_iso14443b.h>
|
||||
#include <librfid/rfid_layer2_iso15693.h>
|
||||
|
||||
struct rfid_layer2 {
|
||||
unsigned int id;
|
||||
char *name;
|
||||
|
||||
struct {
|
||||
struct rfid_layer2_handle *(*init)(struct rfid_reader_handle *h);
|
||||
int (*open)(struct rfid_layer2_handle *h);
|
||||
int (*transceive)(struct rfid_layer2_handle *h,
|
||||
enum rfid_frametype frametype,
|
||||
const unsigned char *tx_buf,
|
||||
unsigned int tx_len, unsigned char *rx_buf,
|
||||
unsigned int *rx_len, u_int64_t timeout,
|
||||
unsigned int flags);
|
||||
int (*close)(struct rfid_layer2_handle *h);
|
||||
int (*fini)(struct rfid_layer2_handle *h);
|
||||
int (*getopt)(struct rfid_layer2_handle *h,
|
||||
int optname, void *optval, unsigned int *optlen);
|
||||
int (*setopt)(struct rfid_layer2_handle *h,
|
||||
int optname, const void *optval,
|
||||
unsigned int optlen);
|
||||
} fn;
|
||||
};
|
||||
|
||||
struct rfid_layer2_handle {
|
||||
struct rfid_reader_handle *rh;
|
||||
unsigned char uid[10]; /* triple size 14443a id is 10 bytes */
|
||||
unsigned int uid_len;
|
||||
unsigned int proto_supported;
|
||||
unsigned int flags;
|
||||
union {
|
||||
struct iso14443a_handle iso14443a;
|
||||
struct iso14443b_handle iso14443b;
|
||||
struct iso15693_handle iso15693;
|
||||
} priv;
|
||||
struct rfid_layer2 *l2;
|
||||
};
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,95 @@
|
||||
#ifndef _RFID_ISO14443A_H
|
||||
#define _RFID_ISO14443A_H
|
||||
|
||||
enum rfid_14443a_opt {
|
||||
RFID_OPT_14443A_SPEED_RX = 0x00010001,
|
||||
RFID_OPT_14443A_SPEED_TX = 0x00010002,
|
||||
RFID_OPT_14443A_ATQA = 0x00010003,
|
||||
RFID_OPT_14443A_WUPA = 0x00010004,
|
||||
};
|
||||
|
||||
enum rfid_14443_opt_speed {
|
||||
RFID_14443A_SPEED_106K = 0x01,
|
||||
RFID_14443A_SPEED_212K = 0x02,
|
||||
RFID_14443A_SPEED_424K = 0x04,
|
||||
RFID_14443A_SPEED_848K = 0x08,
|
||||
};
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* protocol definitions */
|
||||
|
||||
/* ISO 14443-3, Chapter 6.3.1 */
|
||||
enum iso14443a_sf_cmd {
|
||||
ISO14443A_SF_CMD_REQA = 0x26,
|
||||
ISO14443A_SF_CMD_WUPA = 0x52,
|
||||
ISO14443A_SF_CMD_OPT_TIMESLOT = 0x35, /* Annex C */
|
||||
/* 40 to 4f and 78 to 7f: proprietary */
|
||||
};
|
||||
|
||||
struct iso14443a_atqa {
|
||||
u_int8_t bf_anticol:5,
|
||||
rfu1:1,
|
||||
uid_size:2;
|
||||
u_int8_t proprietary:4,
|
||||
rfu2:4;
|
||||
} __attribute__((packed));
|
||||
|
||||
#define ISO14443A_HLTA 0x5000
|
||||
|
||||
/* ISO 14443-3, Chapter 6.3.2 */
|
||||
struct iso14443a_anticol_cmd {
|
||||
unsigned char sel_code;
|
||||
unsigned char nvb;
|
||||
unsigned char uid_bits[5];
|
||||
} __attribute__((packed));
|
||||
|
||||
enum iso14443a_anticol_sel_code {
|
||||
ISO14443A_AC_SEL_CODE_CL1 = 0x93,
|
||||
ISO14443A_AC_SEL_CODE_CL2 = 0x95,
|
||||
ISO14443A_AC_SEL_CODE_CL3 = 0x97,
|
||||
};
|
||||
|
||||
#define ISO14443A_BITOFCOL_NONE 0xffffffff
|
||||
|
||||
struct iso14443a_handle {
|
||||
unsigned int state;
|
||||
unsigned int level;
|
||||
unsigned int tcl_capable;
|
||||
struct iso14443a_atqa atqa;
|
||||
};
|
||||
|
||||
enum iso14443a_level {
|
||||
ISO14443A_LEVEL_NONE,
|
||||
ISO14443A_LEVEL_CL1,
|
||||
ISO14443A_LEVEL_CL2,
|
||||
ISO14443A_LEVEL_CL3,
|
||||
};
|
||||
|
||||
enum iso14443a_state {
|
||||
ISO14443A_STATE_ERROR,
|
||||
ISO14443A_STATE_NONE,
|
||||
ISO14443A_STATE_REQA_SENT,
|
||||
ISO14443A_STATE_ATQA_RCVD,
|
||||
ISO14443A_STATE_NO_BITFRAME_ANTICOL,
|
||||
ISO14443A_STATE_ANTICOL_RUNNING,
|
||||
ISO14443A_STATE_SELECTED,
|
||||
};
|
||||
|
||||
/* Section 6.1.2 values in usec, rounded up to next usec */
|
||||
#define ISO14443A_FDT_ANTICOL_LAST1 92 /* 1236 / fc = 91.15 usec */
|
||||
#define ISO14443A_FDT_ANTICOL_LAST0 87 /* 1172 / fc = 86.43 usec */
|
||||
|
||||
#define ISO14443_CARRIER_FREQ 13560000
|
||||
#define ISO14443A_FDT_OTHER_LAST1(n) (((n*128+84)*1000000)/ISO14443_CARRIER_FREQ)
|
||||
|
||||
|
||||
#include <librfid/rfid_layer2.h>
|
||||
extern const struct rfid_layer2 rfid_layer2_iso14443a;
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
|
||||
#endif /* _ISO14443A_H */
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef _RFID_LAYER2_ISO14443B_H
|
||||
#define _RFID_LAYER2_ISO14443B_H
|
||||
|
||||
#include <librfid/rfid_layer2.h>
|
||||
|
||||
enum rfid_iso14443_opt {
|
||||
RFID_OPT_14443B_CID = 0x00010001,
|
||||
RFID_OPT_14443B_FSC = 0x00010002,
|
||||
RFID_OPT_14443B_FSD = 0x00010003,
|
||||
RFID_OPT_14443B_FWT = 0x00010004,
|
||||
RFID_OPT_14443B_TR0 = 0x00010005,
|
||||
RFID_OPT_14443B_TR1 = 0x00010006,
|
||||
};
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
struct iso14443b_atqb {
|
||||
unsigned char fifty;
|
||||
unsigned char pupi[4];
|
||||
unsigned char app_data[4];
|
||||
struct {
|
||||
unsigned char bit_rate_capability;
|
||||
unsigned char protocol_type:4,
|
||||
max_frame_size:4;
|
||||
unsigned char fo:2,
|
||||
adc:2,
|
||||
fwi:4;
|
||||
} __attribute__ ((packed)) protocol_info;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct iso14443b_attrib_hdr {
|
||||
unsigned char one_d;
|
||||
unsigned char identifier[4];
|
||||
struct {
|
||||
unsigned char rfu:2,
|
||||
sof:1,
|
||||
eof:1,
|
||||
min_tr1:2,
|
||||
min_tr0:2;
|
||||
} __attribute__ ((packed)) param1;
|
||||
struct {
|
||||
unsigned char fsdi:4,
|
||||
spd_out:2,
|
||||
spd_in:2;
|
||||
} __attribute__ ((packed)) param2;
|
||||
struct {
|
||||
unsigned char protocol_type:4,
|
||||
rfu:4;
|
||||
} __attribute__ ((packed)) param3;
|
||||
struct {
|
||||
unsigned char cid:4,
|
||||
rfu:4;
|
||||
} __attribute__ ((packed)) param4;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct iso14443b_handle {
|
||||
unsigned int tcl_capable; /* do we support T=CL */
|
||||
|
||||
unsigned int cid; /* Card ID */
|
||||
|
||||
unsigned int fsc; /* max. frame size card */
|
||||
unsigned int fsd; /* max. frame size reader */
|
||||
|
||||
unsigned int fwt; /* frame waiting time (in usec) */
|
||||
|
||||
unsigned int mbl; /* maximum buffer length */
|
||||
|
||||
unsigned int tr0; /* pcd-eof to picc-subcarrier-on */
|
||||
unsigned int tr1; /* picc-subcarrier-on to picc-sof */
|
||||
|
||||
unsigned int flags;
|
||||
unsigned int state;
|
||||
};
|
||||
|
||||
enum {
|
||||
ISO14443B_CID_SUPPORTED = 0x01,
|
||||
ISO14443B_NAD_SUPPORTED = 0x02,
|
||||
};
|
||||
|
||||
enum {
|
||||
ISO14443B_STATE_ERROR,
|
||||
ISO14443B_STATE_NONE,
|
||||
ISO14443B_STATE_REQB_SENT,
|
||||
ISO14443B_STATE_ATQB_RCVD,
|
||||
ISO14443B_STATE_ATTRIB_SENT,
|
||||
ISO14443B_STATE_SELECTED,
|
||||
ISO14443B_STATE_HLTB_SENT,
|
||||
ISO14443B_STATE_HALTED,
|
||||
};
|
||||
|
||||
#include <librfid/rfid_layer2.h>
|
||||
extern const struct rfid_layer2 rfid_layer2_iso14443b;
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,177 @@
|
||||
#ifndef _RFID_ISO15693_H
|
||||
#define _RFID_ISO15693_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
07h = TagIt
|
||||
04h = I.CODE
|
||||
05h = Infineon
|
||||
02h = ST
|
||||
*/
|
||||
|
||||
/* protocol definitions */
|
||||
|
||||
#if 0
|
||||
struct rfid_15693_handle;
|
||||
|
||||
struct rfid_layer2_15693t {
|
||||
unsigned char *name;
|
||||
|
||||
struct {
|
||||
int (*init)(struct iso15693_handle *handle);
|
||||
int (*fini)(struct iso15693_handle *handle);
|
||||
|
||||
#if 0
|
||||
int (*transceive_sf)(struct iso14443a_handle *handle,
|
||||
unsigned char cmd,
|
||||
struct iso14443a_atqa *atqa);
|
||||
int (*transceive_acf)(struct iso14443a_handle *handle,
|
||||
struct iso14443a_anticol_cmd *acf,
|
||||
unsigned int *bit_of_col);
|
||||
#endif
|
||||
int (*transceive)(struct iso15693_handle *handle,
|
||||
const unsigned char *tx_buf,
|
||||
unsigned int tx_len,
|
||||
unsigned char *rx_buf,
|
||||
unsigned int *rx_len);
|
||||
} fn;
|
||||
|
||||
union {
|
||||
} priv;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct iso15693_handle {
|
||||
unsigned int state;
|
||||
unsigned int ask100:1,
|
||||
out256:1;
|
||||
};
|
||||
|
||||
enum rfid_15693_state {
|
||||
ISO15693_STATE_ERROR,
|
||||
ISO15693_STATE_NONE,
|
||||
};
|
||||
|
||||
enum rfid_15693_opt {
|
||||
RFID_OPT_15693_MOD_DEPTH = 0x00010001,
|
||||
RFID_OPT_15693_VCD_CODING = 0x00010002,
|
||||
RFID_OPT_15693_VICC_SUBC = 0x00010003,
|
||||
RFID_OPT_15693_VICC_SPEED = 0x00010004,
|
||||
};
|
||||
|
||||
enum rfid_15693_opt_mod_depth {
|
||||
RFID_15693_MOD_10ASK = 0x01,
|
||||
RFID_15693_MOD_100ASK = 0x02,
|
||||
};
|
||||
|
||||
enum rfid_15693_opt_vcd_coding {
|
||||
RFID_15693_VCD_CODING_1OUT256 = 0x01,
|
||||
RFID_15693_VCD_CODING_1OUT4 = 0x02,
|
||||
};
|
||||
|
||||
enum rfid_15693_opt_vicc_subc {
|
||||
RFID_15693_VICC_SUBC_SINGLE = 0x01,
|
||||
RFID_15693_VICC_SUBC_DUAL = 0x02,
|
||||
};
|
||||
|
||||
enum rfid_15693_opt_vicc_speed {
|
||||
RFID_15693_VICC_SPEED_SLOW = 0x01,
|
||||
RFID_15693_VICC_SPEED_FAST = 0x02,
|
||||
};
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
#define ISO15693_UID_LEN 8
|
||||
#define ISO15693_CRC_LEN 2
|
||||
|
||||
/* ISO 15693-3, Ch. 7.2 Table 3*/
|
||||
enum iso15693_request_flags {
|
||||
RFID_15693_F_SUBC_TWO = 0x01,
|
||||
RFID_15693_F_RATE_HIGH = 0x02,
|
||||
RFID_15693_F_INV_TABLE_5 = 0x04,
|
||||
RFID_15693_F_PROT_OEXT = 0x08,
|
||||
};
|
||||
|
||||
/* ISO 15693-3, Ch. 7.2 Table 4 */
|
||||
enum iso15693_request_flags_table4 {
|
||||
RFID_15693_F4_SELECTED = 0x10, /* only VICC in 'select' state */
|
||||
RFID_15693_F4_ADDRESS = 0x20, /* request is addressed */
|
||||
RFID_15693_F4_CUSTOM = 0x40,
|
||||
};
|
||||
|
||||
/* ISO 15693-3, Ch. 7.2 Table 5 */
|
||||
enum iso15693_request_flags_table5 {
|
||||
RFID_15693_F5_AFI_PRES = 0x10, /* AFI is present */
|
||||
RFID_15693_F5_NSLOTS_1 = 0x20, /* only 1 slot (instead of 16) */
|
||||
RFID_15693_F5_CUSTOM = 0x40,
|
||||
};
|
||||
|
||||
/* ISO 15963-3, Ch. 7.2 Figure 4 */
|
||||
struct iso15693_request {
|
||||
u_int8_t flags;
|
||||
u_int8_t command;
|
||||
u_int8_t data[0];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* ISO 15693, Ch. 7.3 Table 6 */
|
||||
enum iso15693_response_flags {
|
||||
RFID_15693_RF_ERROR = 0x01,
|
||||
RFID_15693_RF_EXTENDED = 0x08,
|
||||
};
|
||||
|
||||
/* ISO 15693, Ch. 7.3.2 Table 7 */
|
||||
enum iso15693_response_errors {
|
||||
RFID_15693_ERR_NOTSUPP = 0x01,
|
||||
RFID_15693_ERR_INVALID = 0x02, /* command not recognized */
|
||||
RFID_15693_ERR_UNKNOWN = 0x0f, /* unknown error */
|
||||
RFID_15693_ERR_BLOCK_NA = 0x10, /* block not available */
|
||||
RFID_15693_ERR_BLOCK_LOCKED = 0x11,
|
||||
RFID_15693_ERR_BLOCK_LOCKED_CH = 0x12,
|
||||
RFID_15693_ERR_BLOCK_NOTPROG = 0x13,
|
||||
RFID_15693_ERR_BLOCK_NOTLOCK = 0x14,
|
||||
};
|
||||
|
||||
/* ISO 15693, Ch. 7.4 */
|
||||
enum iso15693_vicc_states {
|
||||
RFID_15693_STATE_POWER_OFF,
|
||||
RFID_15693_STATE_READY,
|
||||
RFID_15693_STATE_QUIET,
|
||||
RFID_15693_STATE_SELECTED,
|
||||
};
|
||||
|
||||
/* ISO 15693, Ch. 9.1 Table 10*/
|
||||
enum iso15693_commands {
|
||||
/* Mandatory 0x01 .. 0x1f */
|
||||
ISO15693_CMD_INVENTORY = 0x01,
|
||||
ISO15693_CMD_STAY_QUIET = 0x02,
|
||||
/* Optional 0x20 .. 0x9f */
|
||||
ISO15693_CMD_READ_BLOCK_SINGLE = 0x20,
|
||||
ISO15693_CMD_WRITE_BLOCK_SINGLE = 0x21,
|
||||
ISO15693_CMD_LOCK_BLOCK = 0x22,
|
||||
ISO15693_CMD_READ_BLOCK_MULTI = 0x23,
|
||||
ISO15693_CMD_WRITE_BLOCK_MULTI = 0x24,
|
||||
ISO15693_CMD_SELECT = 0x25,
|
||||
ISO15693_CMD_RESET_TO_READY = 0x26,
|
||||
ISO15693_CMD_WRITE_AFI = 0x27,
|
||||
ISO15693_CMD_LOCK_AFI = 0x28,
|
||||
ISO15693_CMD_WRITE_DSFID = 0x29,
|
||||
ISO15693_CMD_LOCK_DSFID = 0x2a,
|
||||
ISO15693_CMD_GET_SYSINFO = 0x2b,
|
||||
ISO15693_CMD_GET_BLOCK_SECURITY = 0x2c,
|
||||
/* Custom 0xa0 .. 0xdf */
|
||||
ICODE_CMD_INVENTORY_READ = 0xa0,
|
||||
ICODE_CMD_FAST_INVENTORY_READ = 0xa1,
|
||||
ICODE_CMD_EAS_SET = 0xa2,
|
||||
ICODE_CMD_EAS_RESET = 0xa3,
|
||||
ICODE_CMD_EAS_LOCK = 0xa4,
|
||||
ICODE_CMD_EAS_ALARM = 0xa5,
|
||||
/* Proprietary 0xe0 .. 0xff */
|
||||
};
|
||||
|
||||
|
||||
#include <librfid/rfid_layer2.h>
|
||||
extern const struct rfid_layer2 rfid_layer2_iso15693;
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
#endif /* _ISO15693_H */
|
||||
@@ -0,0 +1,103 @@
|
||||
#ifndef _RFID_PROTOCOL_H
|
||||
#define _RFID_PROTOCOL_H
|
||||
|
||||
#include <librfid/rfid_layer2.h>
|
||||
|
||||
struct rfid_protocol_handle;
|
||||
|
||||
struct rfid_protocol_handle *
|
||||
rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id);
|
||||
int rfid_protocol_open(struct rfid_protocol_handle *ph);
|
||||
int rfid_protocol_transceive(struct rfid_protocol_handle *ph,
|
||||
const unsigned char *tx_buf, unsigned int tx_len,
|
||||
unsigned char *rx_buf, unsigned int *rx_len,
|
||||
unsigned int timeout, unsigned int flags);
|
||||
int
|
||||
rfid_protocol_read(struct rfid_protocol_handle *ph,
|
||||
unsigned int page,
|
||||
unsigned char *rx_data,
|
||||
unsigned int *rx_len);
|
||||
|
||||
int
|
||||
rfid_protocol_write(struct rfid_protocol_handle *ph,
|
||||
unsigned int page,
|
||||
unsigned char *tx_data,
|
||||
unsigned int tx_len);
|
||||
|
||||
int rfid_protocol_fini(struct rfid_protocol_handle *ph);
|
||||
int rfid_protocol_close(struct rfid_protocol_handle *ph);
|
||||
|
||||
int rfid_protocol_getopt(struct rfid_protocol_handle *ph, int optname,
|
||||
void *optval, unsigned int *optlen);
|
||||
|
||||
int rfid_protocol_setopt(struct rfid_protocol_handle *ph, int optname,
|
||||
const void *optval, unsigned int optlen);
|
||||
|
||||
char *rfid_protocol_name(struct rfid_protocol_handle *ph);
|
||||
|
||||
enum rfid_protocol_id {
|
||||
RFID_PROTOCOL_UNKNOWN,
|
||||
RFID_PROTOCOL_TCL,
|
||||
RFID_PROTOCOL_MIFARE_UL,
|
||||
RFID_PROTOCOL_MIFARE_CLASSIC,
|
||||
NUM_RFID_PROTOCOLS
|
||||
};
|
||||
|
||||
enum rfid_protocol_opt {
|
||||
RFID_OPT_PROTO_ID,
|
||||
RFID_OPT_PROTO_SIZE = 0x10000001,
|
||||
};
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
struct rfid_protocol {
|
||||
unsigned int id;
|
||||
char *name;
|
||||
struct {
|
||||
struct rfid_protocol_handle *(*init)(struct rfid_layer2_handle *l2h);
|
||||
int (*open)(struct rfid_protocol_handle *ph);
|
||||
int (*close)(struct rfid_protocol_handle *ph);
|
||||
int (*fini)(struct rfid_protocol_handle *ph);
|
||||
/* transceive for session based transport protocols */
|
||||
int (*transceive)(struct rfid_protocol_handle *ph,
|
||||
const unsigned char *tx_buf,
|
||||
unsigned int tx_len,
|
||||
unsigned char *rx_buf,
|
||||
unsigned int *rx_len,
|
||||
unsigned int timeout,
|
||||
unsigned int flags);
|
||||
/* read/write for synchronous memory cards */
|
||||
int (*read)(struct rfid_protocol_handle *ph,
|
||||
unsigned int page,
|
||||
unsigned char *rx_data,
|
||||
unsigned int *rx_len);
|
||||
int (*write)(struct rfid_protocol_handle *ph,
|
||||
unsigned int page,
|
||||
unsigned char *tx_data,
|
||||
unsigned int tx_len);
|
||||
int (*getopt)(struct rfid_protocol_handle *h,
|
||||
int optname, void *optval, unsigned int *optlen);
|
||||
int (*setopt)(struct rfid_protocol_handle *h,
|
||||
int optname, const void *optval,
|
||||
unsigned int optlen);
|
||||
} fn;
|
||||
};
|
||||
|
||||
#include <librfid/rfid_protocol_tcl.h>
|
||||
#include <librfid/rfid_protocol_mifare_ul.h>
|
||||
#include <librfid/rfid_protocol_mifare_classic.h>
|
||||
|
||||
struct rfid_protocol_handle {
|
||||
struct rfid_layer2_handle *l2h;
|
||||
struct rfid_protocol *proto;
|
||||
union {
|
||||
struct tcl_handle tcl;
|
||||
} priv; /* priv has to be last, since
|
||||
* it could contain additional
|
||||
* private data over the end of
|
||||
* sizeof(priv). */
|
||||
};
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
#endif /* _RFID_PROTOCOL_H */
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef _MIFARE_CLASSIC_H
|
||||
#define _MIFARE_CLASSIC_H
|
||||
|
||||
#include <librfid/rfid_protocol.h>
|
||||
|
||||
#define MIFARE_CL_KEYA_DEFAULT "\xa0\xa1\xa2\xa3\xa4\xa5"
|
||||
#define MIFARE_CL_KEYB_DEFAULT "\xb0\xb1\xb2\xb3\xb4\xb5"
|
||||
|
||||
#define MIFARE_CL_KEYA_DEFAULT_INFINEON "\xff\xff\xff\xff\xff\xff"
|
||||
#define MIFARE_CL_KEYB_DEFAULT_INFINEON MIFARE_CL_KEYA_DEFAULT_INFINEON
|
||||
|
||||
#define MIFARE_CL_KEY_LEN (sizeof(MIFARE_CL_KEYA_DEFAULT)-1)
|
||||
|
||||
#define MIFARE_CL_PAGE_MAX 0xff
|
||||
#define MIFARE_CL_PAGE_SIZE 20
|
||||
|
||||
#define RFID_CMD_MIFARE_AUTH1A 0x60
|
||||
#define RFID_CMD_MIFARE_AUTH1B 0x61
|
||||
|
||||
enum rfid_proto_mfcl_opt {
|
||||
RFID_OPT_P_MFCL_SIZE = 0x10000001,
|
||||
};
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
extern const struct rfid_protocol rfid_protocol_mfcl;
|
||||
|
||||
|
||||
#define MIFARE_CL_CMD_WRITE16 0xA0
|
||||
#define MIFARE_CL_CMD_WRITE4 0xA2
|
||||
#define MIFARE_CL_CMD_READ 0x30
|
||||
|
||||
#define MIFARE_CL_RESP_ACK 0x0a
|
||||
#define MIFARE_CL_RESP_NAK 0x00
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
extern int mfcl_set_key(struct rfid_protocol_handle *ph, unsigned char *key);
|
||||
extern int mfcl_auth(struct rfid_protocol_handle *ph, u_int8_t cmd, u_int8_t block);
|
||||
|
||||
#endif /* _MIFARE_CLASSIC_H */
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef _RFID_PROTOCOL_MFUL_H
|
||||
#define _RFID_PROTOCOL_MFUL_H
|
||||
|
||||
int rfid_mful_lock_page(struct rfid_protocol_handle *ph, unsigned int page);
|
||||
int rfid_mful_lock_otp(struct rfid_protocol_handle *ph);
|
||||
|
||||
#define MIFARE_UL_PAGE_MAX 15
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
#define MIFARE_UL_CMD_WRITE 0xA2
|
||||
#define MIFARE_UL_CMD_READ 0x30
|
||||
|
||||
#define MIFARE_UL_RESP_ACK 0x0a
|
||||
#define MIFARE_UL_RESP_NAK 0x00
|
||||
|
||||
#define MIFARE_UL_PAGE_LOCK 2
|
||||
#define MIFARE_UL_PAGE_OTP 3
|
||||
|
||||
extern const struct rfid_protocol rfid_protocol_mful;
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
#ifndef _RFID_PROTOCOL_TCL_H
|
||||
#define _RFID_PROTOCOL_TCL_H
|
||||
|
||||
enum rfid_proto_tcl_opt {
|
||||
RFID_OPT_P_TCL_ATS = 0x00010001,
|
||||
RFID_OPT_P_TCL_ATS_LEN = 0x00010002,
|
||||
};
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
enum tcl_transport_rate {
|
||||
TCL_RATE_106 = 0x01,
|
||||
TCL_RATE_212 = 0x02,
|
||||
TCL_RATE_424 = 0x04,
|
||||
TCL_RATE_848 = 0x08,
|
||||
};
|
||||
|
||||
enum tcl_transport_transceive_flags {
|
||||
TCL_TRANSP_F_TX_CRC = 0x01, /* transport adds TX CRC */
|
||||
TCL_TRANSP_F_RX_CRC = 0x02,
|
||||
};
|
||||
|
||||
struct tcl_handle {
|
||||
/* derived from ats */
|
||||
unsigned char *historical_bytes; /* points into ats */
|
||||
unsigned int historical_len;
|
||||
|
||||
unsigned int fsc; /* max frame size accepted by card */
|
||||
unsigned int fsd; /* max frame size accepted by reader */
|
||||
unsigned int fwt; /* frame waiting time (in usec)*/
|
||||
unsigned char ta; /* divisor information */
|
||||
unsigned char sfgt; /* start-up frame guard time (in usec) */
|
||||
|
||||
/* otherwise determined */
|
||||
unsigned int cid; /* Card ID */
|
||||
unsigned int nad; /* Node Address */
|
||||
|
||||
unsigned int flags;
|
||||
unsigned int state; /* protocol state */
|
||||
|
||||
unsigned int toggle; /* send toggle with next frame */
|
||||
|
||||
unsigned int ats_len;
|
||||
unsigned char ats[256]; /* ATS cannot be bigger than FSD-2 bytes,
|
||||
according to ISO 14443-4 5.2.2 */
|
||||
};
|
||||
|
||||
enum tcl_handle_flags {
|
||||
TCL_HANDLE_F_NAD_SUPPORTED = 0x0001,
|
||||
TCL_HANDLE_F_CID_SUPPORTED = 0x0002,
|
||||
TCL_HANDLE_F_NAD_USED = 0x0010,
|
||||
TCL_HANDLE_F_CID_USED = 0x0020,
|
||||
};
|
||||
|
||||
|
||||
enum tcl_pcb_bits {
|
||||
TCL_PCB_CID_FOLLOWING = 0x08,
|
||||
TCL_PCB_NAD_FOLLOWING = 0x04,
|
||||
};
|
||||
|
||||
enum tcl_pcd_state {
|
||||
TCL_STATE_NONE = 0x00,
|
||||
TCL_STATE_INITIAL,
|
||||
TCL_STATE_RATS_SENT, /* waiting for ATS */
|
||||
TCL_STATE_ATS_RCVD, /* ATS received */
|
||||
TCL_STATE_PPS_SENT, /* waiting for PPS response */
|
||||
TCL_STATE_ESTABLISHED, /* xchg transparent data */
|
||||
TCL_STATE_DESELECT_SENT, /* waiting for DESELECT response */
|
||||
TCL_STATE_DESELECTED, /* card deselected or HLTA'd */
|
||||
};
|
||||
|
||||
extern const struct rfid_protocol rfid_protocol_tcl;
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
#ifndef _RFID_READER_H
|
||||
#define _RFID_READER_H
|
||||
|
||||
#include <librfid/rfid_asic.h>
|
||||
#include <librfid/rfid_layer2_iso14443a.h>
|
||||
|
||||
struct rfid_reader_handle;
|
||||
|
||||
struct rfid_reader {
|
||||
char *name;
|
||||
unsigned int id;
|
||||
unsigned int l2_supported;
|
||||
unsigned int proto_supported;
|
||||
|
||||
int (*get_api_version)(
|
||||
struct rfid_reader_handle *h,
|
||||
u_int8_t *version);
|
||||
|
||||
int (*get_environment)(
|
||||
struct rfid_reader_handle *rh,
|
||||
unsigned char num_bytes,
|
||||
unsigned char *buf);
|
||||
|
||||
int (*set_environment)(
|
||||
struct rfid_reader_handle *rh,
|
||||
unsigned char num_bytes,
|
||||
const unsigned char *buf);
|
||||
|
||||
int (*reset)(struct rfid_reader_handle *h);
|
||||
|
||||
int (*transceive)(struct rfid_reader_handle *h,
|
||||
enum rfid_frametype frametype,
|
||||
const unsigned char *tx_buf, unsigned int tx_len,
|
||||
unsigned char *rx_buf, unsigned int *rx_len,
|
||||
u_int64_t timeout, unsigned int flags);
|
||||
struct rfid_reader_handle * (*open)(void *data);
|
||||
void (*close)(struct rfid_reader_handle *h);
|
||||
|
||||
struct rfid_14443a_reader {
|
||||
int (*init)(struct rfid_reader_handle *h);
|
||||
int (*transceive_sf)(struct rfid_reader_handle *h,
|
||||
unsigned char cmd,
|
||||
struct iso14443a_atqa *atqa);
|
||||
int (*transceive_acf)(struct rfid_reader_handle *h,
|
||||
struct iso14443a_anticol_cmd *cmd,
|
||||
unsigned int *bit_of_col);
|
||||
int (*set_speed)(struct rfid_reader_handle *h,
|
||||
unsigned int tx,
|
||||
unsigned int speed);
|
||||
unsigned int speed;
|
||||
} iso14443a;
|
||||
struct rfid_14443b_reader {
|
||||
int (*init)(struct rfid_reader_handle *rh);
|
||||
unsigned int speed;
|
||||
} iso14443b;
|
||||
struct rfid_15693_reader {
|
||||
int (*init)(struct rfid_reader_handle *rh);
|
||||
} iso15693;
|
||||
struct rfid_mifare_classic_reader {
|
||||
int (*setkey)(struct rfid_reader_handle *h, const unsigned char *key);
|
||||
int (*auth)(struct rfid_reader_handle *h, u_int8_t cmd,
|
||||
u_int32_t serno, u_int8_t block);
|
||||
} mifare_classic;
|
||||
};
|
||||
|
||||
enum rfid_reader_id {
|
||||
RFID_READER_CM5121,
|
||||
RFID_READER_PEGODA,
|
||||
RFID_READER_OPENPCD,
|
||||
};
|
||||
|
||||
struct rfid_reader_handle {
|
||||
struct rfid_asic_handle *ah;
|
||||
|
||||
union {
|
||||
|
||||
} priv;
|
||||
struct rfid_reader *reader;
|
||||
};
|
||||
|
||||
extern struct rfid_reader_handle *
|
||||
rfid_reader_open(void *data, unsigned int id);
|
||||
|
||||
extern void rfid_reader_close(struct rfid_reader_handle *rh);
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef _RFID_READER_CM5121_H
|
||||
#define _RFID_READER_CM5121_H
|
||||
|
||||
#include <librfid/rfid_reader.h>
|
||||
|
||||
#define CM5121_CW_CONDUCTANCE 0x3f
|
||||
#define CM5121_MOD_CONDUCTANCE 0x3f
|
||||
#define CM5121_14443A_BITPHASE 0xa9
|
||||
#define CM5121_14443A_THRESHOLD 0xff
|
||||
|
||||
#define CM5121_14443B_BITPHASE 0xad
|
||||
#define CM5121_14443B_THRESHOLD 0xff
|
||||
|
||||
extern int
|
||||
PC_to_RDR_Escape(void *handle,
|
||||
const unsigned char *tx_buf, size_t tx_len,
|
||||
unsigned char *rx_buf, size_t *rx_len);
|
||||
|
||||
extern const struct rfid_reader rfid_reader_cm5121;
|
||||
// extern struct rfid_asic_transport cm5121_ccid;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,102 @@
|
||||
#ifndef _OPENPCD_PROTO_H
|
||||
#define _OPENPCD_PROTO_H
|
||||
|
||||
/* This header file describes the USB protocol of the OpenPCD RFID reader */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
struct openpcd_hdr {
|
||||
u_int8_t cmd; /* command. high nibble: class,
|
||||
* low nibble: cmd */
|
||||
u_int8_t flags;
|
||||
u_int8_t reg; /* register */
|
||||
u_int8_t val; /* value (in case of write *) */
|
||||
u_int8_t data[0];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define OPCD_REV_LEN 16
|
||||
struct openpcd_compile_version {
|
||||
char svnrev[OPCD_REV_LEN];
|
||||
char by[OPCD_REV_LEN];
|
||||
char date[OPCD_REV_LEN];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define OPENPCD_FLAG_RESPOND 0x01 /* Response requested */
|
||||
#define OPENPCD_FLAG_ERROR 0x80 /* An error occurred */
|
||||
|
||||
enum openpcd_cmd_class {
|
||||
OPENPCD_CMD_CLS_GENERIC = 0x0,
|
||||
/* PCD (reader) side */
|
||||
OPENPCD_CMD_CLS_RC632 = 0x1,
|
||||
//OPENPCD_CMD_CLS_LED = 0x2,
|
||||
OPENPCD_CMD_CLS_SSC = 0x3,
|
||||
OPENPCD_CMD_CLS_PWM = 0x4,
|
||||
OPENPCD_CMD_CLS_ADC = 0x5,
|
||||
/* PICC (transponder) side */
|
||||
OPENPCD_CMD_CLS_PICC = 0xe,
|
||||
|
||||
OPENPCD_CMD_CLS_USBTEST = 0xf,
|
||||
};
|
||||
|
||||
#define OPENPCD_REG_MAX 0x3f
|
||||
|
||||
#define OPENPCD_CMD_CLS(x) (x >> 4)
|
||||
#define OPENPCD_CMD(x) (x & 0xf)
|
||||
|
||||
#define OPENPCD_CLS2CMD(x) (x << 4)
|
||||
|
||||
#define OPENPCD_CMD_GET_VERSION (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC))
|
||||
#define OPENPCD_CMD_SET_LED (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC))
|
||||
#define OPENPCD_CMD_GET_SERIAL (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC))
|
||||
#define OPENPCD_CMD_GET_API_VERSION (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC))
|
||||
#define OPENPCD_CMD_GET_ENVIRONMENT (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC))
|
||||
#define OPENPCD_CMD_SET_ENVIRONMENT (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC))
|
||||
#define OPENPCD_CMD_RESET (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_GENERIC))
|
||||
|
||||
/* CMD_CLS_RC632 */
|
||||
#define OPENPCD_CMD_WRITE_REG (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_WRITE_FIFO (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_WRITE_VFIFO (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_REG_BITS_CLEAR (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_REG_BITS_SET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_READ_REG (0x6|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_READ_FIFO (0x7|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_READ_VFIFO (0x8|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_DUMP_REGS (0x9|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
#define OPENPCD_CMD_IRQ (0xa|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_RC632))
|
||||
|
||||
/* CMD_CLS_SSC */
|
||||
#define OPENPCD_CMD_SSC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC))
|
||||
#define OPENPCD_CMD_SSC_WRITE (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_SSC))
|
||||
|
||||
/* CMD_CLS_PWM */
|
||||
#define OPENPCD_CMD_PWM_ENABLE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM))
|
||||
#define OPENPCD_CMD_PWM_DUTY_SET (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM))
|
||||
#define OPENPCD_CMD_PWM_DUTY_GET (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM))
|
||||
#define OPENPCD_CMD_PWM_FREQ_SET (0x4|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM))
|
||||
#define OPENPCD_CMD_PWM_FREQ_GET (0x5|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PWM))
|
||||
|
||||
/* CMD_CLS_PICC */
|
||||
#define OPENPCD_CMD_PICC_REG_WRITE (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC))
|
||||
#define OPENPCD_CMD_PICC_REG_READ (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_PICC))
|
||||
|
||||
/* CMD_CLS_ADC */
|
||||
#define OPENPCD_CMD_ADC_READ (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_ADC))
|
||||
|
||||
/* CMD_CLS_USBTEST */
|
||||
#define OPENPCD_CMD_USBTEST_IN (0x1|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST))
|
||||
#define OPENPCD_CMD_USBTEST_OUT (0x2|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST))
|
||||
|
||||
/* FIXME */
|
||||
#define OPENPCD_CMD_PIO_IRQ (0x3|OPENPCD_CLS2CMD(OPENPCD_CMD_CLS_USBTEST))
|
||||
|
||||
|
||||
#define OPENPCD_VENDOR_ID 0x2342
|
||||
#define OPENPCD_PRODUCT_ID 0x0001
|
||||
#define OPENPCD_OUT_EP 0x01
|
||||
#define OPENPCD_IN_EP 0x82
|
||||
#define OPENPCD_IRQ_EP 0x83
|
||||
|
||||
extern const struct rfid_reader rfid_reader_openpcd;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef _RFID_SCAN_H
|
||||
#define _RFID_SCAN_H
|
||||
|
||||
#include <librfid/rfid_reader.h>
|
||||
#include <librfid/rfid_layer2.h>
|
||||
#include <librfid/rfid_protocol.h>
|
||||
|
||||
struct rfid_layer2_handle *
|
||||
rfid_layer2_scan(struct rfid_reader_handle *rh);
|
||||
|
||||
struct rfid_protocol_handle *
|
||||
rfid_protocol_scan(struct rfid_layer2_handle *l2h);
|
||||
|
||||
int rfid_scan(struct rfid_reader_handle *rh,
|
||||
struct rfid_layer2_handle **l2h,
|
||||
struct rfid_protocol_handle **ph);
|
||||
|
||||
#endif /* _RFID_SCAN_H */
|
||||
@@ -0,0 +1,57 @@
|
||||
/* system / environment specific defines */
|
||||
|
||||
/* build for openpcd firmware */
|
||||
//#define LIBRFID_FIRMWARE
|
||||
|
||||
/* build without dynamic allocations */
|
||||
//#define LIBRFID_STATIC
|
||||
|
||||
#ifdef __LIBRFID__
|
||||
|
||||
#ifndef LIBRFID_STATIC
|
||||
/* If we're not doing a firmware compile, then we just use the regular
|
||||
* malloc()/free() functions as expected */
|
||||
|
||||
#define malloc_asic_handle(x) malloc(x)
|
||||
#define free_asic_handle(x) free(x)
|
||||
|
||||
#define malloc_layer2_handle(x) malloc(x)
|
||||
#define free_layer2_handle(x) free(x)
|
||||
|
||||
#define malloc_protocol_handle(x) malloc(x)
|
||||
#define free_protocol_handle(x) free(x)
|
||||
|
||||
#define malloc_rat_handle(x) malloc(x)
|
||||
#define free_rat_handle(x) free(x)
|
||||
|
||||
#define malloc_reader_handle(x) malloc(x)
|
||||
#define free_reader_handle(x) free(x)
|
||||
|
||||
#else
|
||||
/* If we're actually doing a firmware compile, then we use pre-allocated
|
||||
* handles in order to avoid dynamic memory allocation. */
|
||||
|
||||
#define EMPTY_STATEMENT do {} while(0)
|
||||
extern struct rfid_asic_handle rfid_ah;
|
||||
#define malloc_asic_handle(x) &rfid_ah
|
||||
#define free_asic_handle(x) EMPTY_STATEMENT
|
||||
|
||||
extern struct rfid_layer2_handle rfid_l2h;
|
||||
#define malloc_layer2_handle(x) &rfid_l2h
|
||||
#define free_layer2_handle(x) EMPTY_STATEMENT
|
||||
|
||||
extern struct rfid_protocol_handle rfid_ph;
|
||||
#define malloc_protocol_handle(x) &rfid_ph
|
||||
#define free_protocol_handle(x) EMPTY_STATEMENT
|
||||
|
||||
extern struct rfid_asic_transport_handle rfid_ath;
|
||||
#define malloc_rat_handle(x) &rfid_ath
|
||||
#define free_rat_handle(x) EMPTY_STATEMENT
|
||||
|
||||
extern struct rfid_reader_handle rfid_rh;
|
||||
#define malloc_reader_handle(x) &rfid_rh
|
||||
#define free_reader_handle(x) EMPTY_STATEMENT
|
||||
|
||||
#endif /* LIBRFID_STATIC */
|
||||
|
||||
#endif /* __LIBRFID__ */
|
||||
Reference in New Issue
Block a user