ruby-nfc 1.1.0 → 1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/ruby-nfc/tags/tag.rb +15 -0
  3. metadata +6 -6
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWMzYmQwMDJkYzBlMmMzZjM0NmRhNTdmYWJhNjk0Y2E2MDM5ZGYwOQ==
4
+ MGMwZTM5MGEwYWFiODNjNWQ0YTBiMDBhMWNhZjQwOWE2NDdiYTE2ZQ==
5
5
  data.tar.gz: !binary |-
6
- Mjk2ZmVmNGIxMDQwY2I0ZDFjNDJmZTYxZWJjNTM1NjlkOTkwMDYzMA==
6
+ Yzc1MGE4MjZhMGE4OGM1YjdiODNhYzEyY2Q3YWQ0ZjcyNTYzOTRmNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGJkOTIxOWY1YTNjY2JlN2FhMTQ2NDNmNDkzNWQzYTI2OTdlNGRkOTk3MDVj
10
- YTdmNjA0N2UzNzgxNjYyMDc5NjY4NzI2MWIzNTRiMjg3YzUyY2ZmOGU2MTVl
11
- YmI3NzM0NTc5MDFhYWIxZmY2OGU1NTYwZGY0OTAzNTE0NTI0MDI=
9
+ NzIwODVjMTFmYjBkZDY3M2Q4ODE5YjJhYzY3NTU1ODZmNmEzMzBmNzEyMDE5
10
+ MGYxY2Q1ZDRiNTJkNjlmMTZkMjUyMzUyMjc4YTk5YmZmY2M2Mzg3YjZjMGZm
11
+ ZDJhYzQzZWY4MTQ3MzFmMTIwYWU0ZDc1YzNmNmQxYmI5MTdiZDg=
12
12
  data.tar.gz: !binary |-
13
- ODVmMTQzYzI2NGQ1Mjg0N2NiMGE5ZDgwOTE4ZmMxZjRjNDI2MjZkNjI1ZWEx
14
- NWYyYWE0NTU2MWEyNzczYmRjM2I2Mjc3MDM4NzFiMmY0NDRjOWUwYTJmMWI1
15
- ZjBiN2JhMTQ2OWFmNGM2OGE1MTMwODM1MGY2NjMzNzM1ZDlmZTY=
13
+ MjNmZmZiNDdjMTFkMGFkMWY0YjM0ZjVkN2MwNTkyZGExZTUwZTQ4YTcyN2Yx
14
+ YTI5ZmJhMWVmMjdmOWE0ODIzNzE3YzY4M2ZlYjU2ZTg2MzMyMjMwZGZmNTJm
15
+ MDk3NTY2NDUwOGU4NWExNDVjMzcyNWE0YzVhODYyZTJmM2I3NmY=
@@ -24,6 +24,21 @@ module NFC
24
24
  @target.processed?
25
25
  end
26
26
 
27
+ def present?
28
+ modulation = LibNFC::Modulation.new
29
+ modulation[:nmt] = :NMT_ISO14443A
30
+ modulation[:nbr] = :NBR_106
31
+
32
+ ptr = FFI::MemoryPointer.new(:char, @target[:nti][:nai][:szUidLen])
33
+ ptr.put_bytes(0, uid)
34
+
35
+ res = LibNFC.nfc_initiator_select_passive_target(@reader.ptr, modulation, ptr,
36
+ @target[:nti][:nai][:szUidLen],
37
+ FFI::Pointer::NULL)
38
+
39
+ return res >= 1
40
+ end
41
+
27
42
  def disconnect; end
28
43
 
29
44
  def uid
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-nfc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Chechel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -42,7 +42,7 @@ description: ! " \tThis gem is built on top of libnfc and libfreefare using ffi
42
42
  supports:\n\t\t * Reading and writing Mifare Classic and Ultralight tags\n\t\t *
43
43
  Android HCE / Blackberry VTE emulated tags\n\t\t * Dual-interface smart cards like
44
44
  MasterCard PayPass or Visa payWave\n"
45
- email: maximchick@gmail.com
45
+ email: hexdigest@gmail.com
46
46
  executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
@@ -60,12 +60,12 @@ files:
60
60
  - ./lib/ruby-nfc/tags/mifare/tag.rb
61
61
  - ./lib/ruby-nfc/tags/mifare/ultralight.rb
62
62
  - ./lib/ruby-nfc/tags/tag.rb
63
- homepage: https://github.com/maximchick/ruby-nfc
63
+ homepage: https://github.com/hexdigest/ruby-nfc
64
64
  licenses:
65
65
  - MIT
66
66
  metadata: {}
67
67
  post_install_message: ! " \tDon't forget to install libnfc and libfreefare\n \tsee
68
- installation instructions here: \n \thttps://github.com/maximchick/ruby-nfc\n"
68
+ installation instructions here: \n \thttps://github.com/hexdigest/ruby-nfc\n"
69
69
  rdoc_options: []
70
70
  require_paths:
71
71
  - lib
@@ -83,7 +83,7 @@ requirements:
83
83
  - libnfc, v1.7.x
84
84
  - libfreefare
85
85
  rubyforge_project:
86
- rubygems_version: 2.2.2
86
+ rubygems_version: 2.4.8
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Provides NFC functionality for Ruby