nfc 3.0.0 → 3.1.0

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: dc2c9944d61cd728376a5378a2a0cfb715915016
4
- data.tar.gz: ba8a58d9b55211a2898d03a3b37445b5000a9bae
3
+ metadata.gz: 8f993289f67ac61a6258cb65aab3ef22ebdf6c09
4
+ data.tar.gz: 9bd06f63aec5247bddcf5fcaf01c154d52c7164d
5
5
  SHA512:
6
- metadata.gz: b69c386aac1fde6be05e7f9cfe59d3e6ad4b06a8b73e49ef5391e99d755735fd5aa811b53917a00ceb3be2d2e5c7eb1362acdc7e1b49db468a6b656c5abbd5d3
7
- data.tar.gz: 48841e7078653b6abc9e8604bf96ae821cdd0fe3432ffeb07e6d13cecfcd3486464afbd3d72294b101a9aa473099933a626d284fa1a842932d0f7ba0caacdb62
6
+ metadata.gz: 4aeeac8d1cd5463b2f9e07e82fed92dee031b3d6f40ae67aaed6ef627c6f1600338ad6cefb7dd1edc8d5eb524de1ccfb4471475dacabfd6ddcdfee6dc272584a
7
+ data.tar.gz: 310d063baffa97b2683242005cf728bf756fdd1efb907c1d31d767f659c416e4cacae62fddef46d434f602d3554fe06b2218d761e79eb66c4a282aeb8c83d1d4
@@ -42,19 +42,22 @@ static VALUE select_passive_target(VALUE self, VALUE tag)
42
42
  *
43
43
  * Poll the +tag+ type from the device
44
44
  */
45
- static VALUE poll_target(VALUE self, VALUE tag, VALUE ms)
45
+ static VALUE poll_target(VALUE self, VALUE tag, VALUE poll_nr, VALUE ms)
46
46
  {
47
47
  nfc_device * dev;
48
48
  nfc_modulation * mod;
49
49
  nfc_target * ti;
50
50
  int code;
51
-
51
+ int ms_c, poll_nr_c;
52
52
  Data_Get_Struct(self, nfc_device, dev);
53
53
  Data_Get_Struct(tag, nfc_modulation, mod);
54
54
 
55
+ ms_c = FIX2INT(ms);
56
+ poll_nr_c = FIX2INT(poll_nr);
57
+
55
58
  ti = (nfc_target *)xmalloc(sizeof(nfc_target));
56
59
 
57
- code = nfc_initiator_poll_target(dev, mod, 1, 0, 1, ti);
60
+ code = nfc_initiator_poll_target(dev, mod, 1, poll_nr_c, ms_c, ti);
58
61
 
59
62
  if (code > 0) {
60
63
  switch(mod->nmt) {
@@ -160,7 +163,7 @@ void init_device()
160
163
  cNfcDevice = rb_define_class_under(mNfc, "Device", rb_cObject);
161
164
  rb_define_method(cNfcDevice, "initiator_init", initiator_init, 0);
162
165
  rb_define_method(cNfcDevice, "select_passive_target", select_passive_target, 1);
163
- rb_define_method(cNfcDevice, "poll_target", poll_target, 1);
166
+ rb_define_method(cNfcDevice, "poll_target", poll_target, 3);
164
167
  rb_define_method(cNfcDevice, "name", name, 0);
165
168
  rb_define_method(cNfcDevice, "deselect", dev_deselect, 0);
166
169
 
data/lib/nfc.rb CHANGED
@@ -8,5 +8,5 @@ require 'nfc/felica'
8
8
  # NFC is a class for dealing with Near Field Communication systems. This
9
9
  # library will read RFID tags from an RFID reader.
10
10
  module NFC
11
- VERSION = '3.0.0'
11
+ VERSION = '3.1.0'
12
12
  end
@@ -12,5 +12,8 @@ module NFC
12
12
  def select
13
13
  select_passive_target NFC::Device::IM_ISO14443A_106
14
14
  end
15
+ def poll poll_nr = 1, ms = 1
16
+ poll_target NFC::Device::IM_ISO14443A_106, poll_nr,ms
17
+ end
15
18
  end
16
19
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-19 00:00:00.000000000 Z
11
+ date: 2013-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '4.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hoe
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.6'
55
55
  description: |-
@@ -67,7 +67,7 @@ extra_rdoc_files:
67
67
  - Manifest.txt
68
68
  - README.rdoc
69
69
  files:
70
- - .autotest
70
+ - ".autotest"
71
71
  - CHANGELOG.rdoc
72
72
  - Manifest.txt
73
73
  - README.rdoc
@@ -86,24 +86,24 @@ files:
86
86
  - lib/nfc/iso14443a.rb
87
87
  - test/test_context.rb
88
88
  - test/test_device.rb
89
- - .gemtest
89
+ - ".gemtest"
90
90
  homepage: http://seattlerb.rubyforge.org
91
91
  licenses: []
92
92
  metadata: {}
93
93
  post_install_message:
94
94
  rdoc_options:
95
- - --main
95
+ - "--main"
96
96
  - README.rdoc
97
97
  require_paths:
98
98
  - lib
99
99
  required_ruby_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  requirements: []