From b57259b51dee6918cbd9a372f3323b9ff1c5eb67 Mon Sep 17 00:00:00 2001 From: Ondrej Mikle Date: Sun, 6 Dec 2015 17:06:40 +0100 Subject: [PATCH] Renamed module and files to nfc_smartcard --- .gitignore | 6 ++++-- Makefile | 14 +++++++------- brmdoor_authenticator.py | 2 +- brmdoor_nfc.i | 13 ------------- brmdoor_nfc_daemon.py | 2 +- brmdoor_nfc.cpp => nfc_smartcard.cpp | 2 +- brmdoor_nfc.h => nfc_smartcard.h | 0 nfc_smartcard.i | 13 +++++++++++++ test_nfc.py | 2 +- 9 files changed, 28 insertions(+), 26 deletions(-) delete mode 100644 brmdoor_nfc.i rename brmdoor_nfc.cpp => nfc_smartcard.cpp (99%) rename brmdoor_nfc.h => nfc_smartcard.h (100%) create mode 100644 nfc_smartcard.i diff --git a/.gitignore b/.gitignore index 48d7d6f..f764b4e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ *.pyc #SWIG -brmdoor_nfc_wrap.cxx -brmdoor_nfc.py +nfc_smartcard_wrap.cxx +nfc_smartcard.py #Vim, GDB, Doxygen tags @@ -26,3 +26,5 @@ brmdoor_libnfc.kpf #Testing config brmdoor_nfc.config +# flags for custom installed libnfc to be sourced into environment +env_flags diff --git a/Makefile b/Makefile index b8c68fe..a4ae9e3 100644 --- a/Makefile +++ b/Makefile @@ -3,22 +3,22 @@ PYTHON_CONFIG := python$(DEFAULT_PYTHON_VERSION)-config PYTHON_INCLUDES := $(shell $(PYTHON_CONFIG) --includes) CXXFLAGS += -Wall -g $(PYTHON_INCLUDES) -fPIC LDFLAGS += -lnfc -OBJECTS = brmdoor_nfc.o brmdoor_nfc_wrap.o -SWIG_GENERATED = brmdoor_nfc_wrap.cxx brmdoor_nfc.py -PY_MODULE = _brmdoor_nfc.so +OBJECTS = nfc_smartcard.o nfc_smartcard_wrap.o +SWIG_GENERATED = nfc_smartcard_wrap.cxx nfc_smartcard.py +PY_MODULE = _nfc_smartcard.so all: $(PY_MODULE) $(PY_MODULE): $(OBJECTS) g++ -shared -o $@ $(OBJECTS) $(LDFLAGS) -brmdoor_nfc.o: brmdoor_nfc.cpp brmdoor_nfc.h - g++ -c $(CXXFLAGS) brmdoor_nfc.cpp +nfc_smartcard.o: nfc_smartcard.cpp nfc_smartcard.h + g++ -c $(CXXFLAGS) nfc_smartcard.cpp -brmdoor_nfc_wrap.o: brmdoor_nfc_wrap.cxx +nfc_smartcard_wrap.o: nfc_smartcard_wrap.cxx g++ -c $(CXXFLAGS) $< -brmdoor_nfc_wrap.cxx: brmdoor_nfc.i brmdoor_nfc.h +nfc_smartcard_wrap.cxx: nfc_smartcard.i nfc_smartcard.h swig -python -c++ $< clean: diff --git a/brmdoor_authenticator.py b/brmdoor_authenticator.py index f37800b..817ddd1 100644 --- a/brmdoor_authenticator.py +++ b/brmdoor_authenticator.py @@ -4,7 +4,7 @@ import hmac import hashlib import logging -from brmdoor_nfc import NFCError +from nfc_smartcard import NFCError class UidRecord(object): diff --git a/brmdoor_nfc.i b/brmdoor_nfc.i deleted file mode 100644 index d5eed62..0000000 --- a/brmdoor_nfc.i +++ /dev/null @@ -1,13 +0,0 @@ -%module brmdoor_nfc - -%{ -#include "brmdoor_nfc.h" -%} - -%include std_string.i -%include std_except.i -%include stdint.i - -%include "brmdoor_nfc.h" - - diff --git a/brmdoor_nfc_daemon.py b/brmdoor_nfc_daemon.py index 4f54514..7716873 100755 --- a/brmdoor_nfc_daemon.py +++ b/brmdoor_nfc_daemon.py @@ -8,7 +8,7 @@ import ConfigParser from binascii import hexlify -from brmdoor_nfc import NFCDevice, NFCError +from nfc_smartcard import NFCDevice, NFCError from brmdoor_authenticator import UidAuthenticator, YubikeyHMACAuthenthicator import unlocker diff --git a/brmdoor_nfc.cpp b/nfc_smartcard.cpp similarity index 99% rename from brmdoor_nfc.cpp rename to nfc_smartcard.cpp index 5f02411..bc729a8 100644 --- a/brmdoor_nfc.cpp +++ b/nfc_smartcard.cpp @@ -5,7 +5,7 @@ #include -#include "brmdoor_nfc.h" +#include "nfc_smartcard.h" using namespace std; diff --git a/brmdoor_nfc.h b/nfc_smartcard.h similarity index 100% rename from brmdoor_nfc.h rename to nfc_smartcard.h diff --git a/nfc_smartcard.i b/nfc_smartcard.i new file mode 100644 index 0000000..dcc98d2 --- /dev/null +++ b/nfc_smartcard.i @@ -0,0 +1,13 @@ +%module nfc_smartcard + +%{ +#include "nfc_smartcard.h" +%} + +%include std_string.i +%include std_except.i +%include stdint.i + +%include "nfc_smartcard.h" + + diff --git a/test_nfc.py b/test_nfc.py index 26decbd..dd68e17 100755 --- a/test_nfc.py +++ b/test_nfc.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -from brmdoor_nfc import NFCDevice, NFCError +from nfc_smartcard import NFCDevice, NFCError from binascii import hexlify def formatAPDU(apdu):