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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3dd7616b9d33ec7f2cbccda0a98f61f88bb4c2be
4
- data.tar.gz: 9580f9caa21caaedb64fcdb4422f8be9b1b20e19
3
+ metadata.gz: e0c9a1a8175a6160095e39d443a2ceb0a1a54c57
4
+ data.tar.gz: 6161a8e9c52d167b9244a0568bebb112aa70ce0f
5
5
  SHA512:
6
- metadata.gz: d3f87ff89ad122a248a161379e10703e78d323215980681e6e755d54e30b5cadae9b4ecdf8b91df7e04de072cbf162e3fe9940a3512070b0e8de80db5c357831
7
- data.tar.gz: 6b0c01c300fdaf803a46e1d49a48f6830785fd5b08cdf71bfd44d96c611627ad3dc60d5f8e7b8d015fdbef3cf9391faf7e76542b7dfd53ef9a044b0df1d4d94a
6
+ metadata.gz: e7582fe5acc6c0dc9e859f7a3935c949b7d111229b6eb930b215368ec92bc2f06518b02e3d1c4c771ee9790770bfa2b7a6afc9c89576c3ea8cc03979fbb58128
7
+ data.tar.gz: 7f3274ece8bdfc0954f919c318460ecd465f9ec91bed8d8f8d1c56d7eee49647d4fb6d55ab648278ff0229fa157e504e2be53aad7d8bdcf809ec9f021d24a63c
@@ -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 ' + $CFLAGS
6
+ $CFLAGS = '-Wall -pedantic -O3 -c -fPIC' + $CFLAGS
7
7
  $LDFLAGS = '-pthread ' + $LDFLAGS
8
8
  $LIBPATH.push(RbConfig::CONFIG['libdir'])
9
9
 
@@ -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
- NFC.nfc_set_cmd(@reader,cmd)
98
- NFC.nfc_reader_do(@reader)
99
- if (obj[:reddit].read_string(obj[:reddit_len])[3..-3]== nil)
100
- temp = nil
101
- else
102
- temp=Result.new(obj[:reddit].read_string(obj[:reddit_len])[3..-3])
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 #}}}
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'nfclib'
3
- s.version = '0.0.136'
3
+ s.version = '0.0.137'
4
4
  s.date = '2014-08-05'
5
5
  s.summary ="NFC-Reader Library."
6
6
  s.description ="Executes command and gets results in c, everthing else ruby-yo"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfclib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.136
4
+ version: 0.0.137
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Stertz