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.
- checksums.yaml +8 -8
- data/lib/ruby-nfc/tags/tag.rb +15 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGMwZTM5MGEwYWFiODNjNWQ0YTBiMDBhMWNhZjQwOWE2NDdiYTE2ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Yzc1MGE4MjZhMGE4OGM1YjdiODNhYzEyY2Q3YWQ0ZjcyNTYzOTRmNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzIwODVjMTFmYjBkZDY3M2Q4ODE5YjJhYzY3NTU1ODZmNmEzMzBmNzEyMDE5
|
10
|
+
MGYxY2Q1ZDRiNTJkNjlmMTZkMjUyMzUyMjc4YTk5YmZmY2M2Mzg3YjZjMGZm
|
11
|
+
ZDJhYzQzZWY4MTQ3MzFmMTIwYWU0ZDc1YzNmNmQxYmI5MTdiZDg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjNmZmZiNDdjMTFkMGFkMWY0YjM0ZjVkN2MwNTkyZGExZTUwZTQ4YTcyN2Yx
|
14
|
+
YTI5ZmJhMWVmMjdmOWE0ODIzNzE3YzY4M2ZlYjU2ZTg2MzMyMjMwZGZmNTJm
|
15
|
+
MDk3NTY2NDUwOGU4NWExNDVjMzcyNWE0YzVhODYyZTJmM2I3NmY=
|
data/lib/ruby-nfc/tags/tag.rb
CHANGED
@@ -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.
|
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:
|
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:
|
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/
|
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/
|
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.
|
86
|
+
rubygems_version: 2.4.8
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Provides NFC functionality for Ruby
|