nfclib 0.0.136 → 0.0.137
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/extconf.rb +1 -1
- data/ext/rathalos.c +2 -0
- data/lib/nfc.rb +11 -8
- data/nfclib.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0c9a1a8175a6160095e39d443a2ceb0a1a54c57
|
4
|
+
data.tar.gz: 6161a8e9c52d167b9244a0568bebb112aa70ce0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7582fe5acc6c0dc9e859f7a3935c949b7d111229b6eb930b215368ec92bc2f06518b02e3d1c4c771ee9790770bfa2b7a6afc9c89576c3ea8cc03979fbb58128
|
7
|
+
data.tar.gz: 7f3274ece8bdfc0954f919c318460ecd465f9ec91bed8d8f8d1c56d7eee49647d4fb6d55ab648278ff0229fa157e504e2be53aad7d8bdcf809ec9f021d24a63c
|
data/ext/extconf.rb
CHANGED
@@ -3,7 +3,7 @@ require 'mkmf'
|
|
3
3
|
spec = eval(File.read(File.dirname(__FILE__) + '/../nfclib.gemspec'))
|
4
4
|
PKG_NAME="nfclib"
|
5
5
|
|
6
|
-
$CFLAGS = '-Wall -pedantic -O3 -c -fPIC
|
6
|
+
$CFLAGS = '-Wall -pedantic -O3 -c -fPIC' + $CFLAGS
|
7
7
|
$LDFLAGS = '-pthread ' + $LDFLAGS
|
8
8
|
$LIBPATH.push(RbConfig::CONFIG['libdir'])
|
9
9
|
|
data/ext/rathalos.c
CHANGED
@@ -54,6 +54,7 @@ int main(int argc,char *argv[]) {
|
|
54
54
|
if(argc < 2)
|
55
55
|
byebye("Please set a command as first parameter (-n if you dont want to send a command)\nList of useful commands:\nv....gets Version\nvs Data.... Sets Version (255 255 for Firmware Version)\nb.... Gets Serialnumber\nre Adress.... Read EEPROM (Look at manual for specific addresses and values)\nwe Adress.... Write EEPROM\ndp.... Lower Polling Mode\ndd.... Lower Detection Mode\nx.... Reset\n-n...Do nothing\n");
|
56
56
|
|
57
|
+
for(j=0;j<10;j++){
|
57
58
|
x = nfc_reader_init("/dev/ttyUSB0");
|
58
59
|
|
59
60
|
nfc_set_cmd(x,argv[1]);
|
@@ -85,5 +86,6 @@ int main(int argc,char *argv[]) {
|
|
85
86
|
pthread_join(thread2,NULL);
|
86
87
|
*/
|
87
88
|
nfc_reader_destroy(x);
|
89
|
+
}
|
88
90
|
return 0;
|
89
91
|
}
|
data/lib/nfc.rb
CHANGED
@@ -44,10 +44,10 @@ module NFC
|
|
44
44
|
|
45
45
|
def hex
|
46
46
|
# @res.map{|e| e.to_s(16) }
|
47
|
-
@res.map{|e| "%02x" % e }.join
|
47
|
+
@res.map{|e| "%02x" % e }.join(' ')
|
48
48
|
end
|
49
49
|
def dec
|
50
|
-
@res
|
50
|
+
@res.join(' ')
|
51
51
|
end
|
52
52
|
def zero #{{{
|
53
53
|
checker = true
|
@@ -94,12 +94,15 @@ module NFC
|
|
94
94
|
|
95
95
|
def command( cmd) #{{{
|
96
96
|
obj = Struct.new(@reader)
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
97
|
+
temp = nil
|
98
|
+
while temp.nil? do
|
99
|
+
NFC.nfc_set_cmd(@reader,cmd)
|
100
|
+
NFC.nfc_reader_do(@reader)
|
101
|
+
if (obj[:reddit].read_string(obj[:reddit_len])[3..-3]== nil)
|
102
|
+
temp = nil
|
103
|
+
else
|
104
|
+
temp=Result.new(obj[:reddit].read_string(obj[:reddit_len])[3..-3])
|
105
|
+
end
|
103
106
|
end
|
104
107
|
temp
|
105
108
|
end #}}}
|
data/nfclib.gemspec
CHANGED