aboutsummaryrefslogtreecommitdiffstats
path: root/dev-util/mtools/files/mtools-new-libnfc-version.patch
blob: 3a44984cd0c85f39134e9eb5a1cf7fb917ac5fc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- configure.ac	(revision 24)
+++ configure.ac	(working copy)
@@ -30,7 +30,7 @@
 fi
 
 # Checks for libraries.
-AC_CHECK_LIB(nfc, nfc_connect,,AC_MSG_ERROR(Install libnfc))
+AC_CHECK_LIB(nfc, nfc_version,,AC_MSG_ERROR(Install libnfc))
 AC_CHECK_LIB(freefare, mifare_classic_connect,,AC_MSG_ERROR(Install libfreefare))
 AC_CHECK_LIB(gthread-2.0, g_thread_init)
 
--- src/Nfc.cpp	(revision 24)
+++ src/Nfc.cpp	(working copy)
@@ -31,22 +31,24 @@
 };
 
 Nfc::Nfc() : dev(NULL), tags(NULL) {
+	nfc_init(NULL);
 	selectedTag = -1;
 	connect();
 }
 
 Nfc::~Nfc() {
 	disconnect();
+	nfc_exit(NULL);
 }
 
 void Nfc::connect() {
 	if(dev) return;
-	dev = nfc_connect(NULL);
+	dev = nfc_open(NULL, NULL);
 }
 
 void Nfc::disconnect() {
 	if (!dev) return;
-	nfc_disconnect(dev);
+	nfc_close(dev);
 	dev = NULL;
 }
 
--- src/Nfc.h	(revision 24)
+++ src/Nfc.h	(working copy)
@@ -83,7 +80,7 @@
 
 	Nfc::Tag* findTag();
 protected:
-	nfc_device_t* dev;
+	nfc_device* dev;
 
 	int selectedTag;
 	MifareTag* tags;
--- src/Utils.h	(revision 24)
+++ src/Utils.h	(working copy)
@@ -30,7 +30,7 @@
 		return ss.str().c_str();
 	}
 
-	static std::string pByteToStrHex(byte_t* bytes, unsigned int len) {
+	static std::string pByteToStrHex(uint8_t* bytes, unsigned int len) {
 		std::stringstream ss;
 		for(unsigned int i = 0; i < len; i++)
 			ss << std::hex << (unsigned int)bytes[i];