humble_rpi-plugin-nfc 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/humble_rpi-plugin-nfc.rb +8 -5
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7976a92ac5bf609a4108d2c5de1d9a5e542d9a62
|
4
|
+
data.tar.gz: d8afee1080f546a0769fca0e5faaa36d27a0b2ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d670bae40cf78af5a475c707b5cb2589f18cd252406693724d46cd70a7c9010932ff6b1aadea625b25f01c772e8d8148bd85b9c7d128b3912a7fd4bf5cc26fa0
|
7
|
+
data.tar.gz: 9c57bdb919d4398c18422772f7d356c52333e1ff494be31e88de97468855b2a379b3e8b263796007c7680daeeacfe07871f5de8a161699ce775e11661a6027b7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# file: humble_rpi-plugin-nfc.rb
|
4
4
|
|
5
5
|
require 'ruby-nfc'
|
6
|
+
require 'digest/md5'
|
6
7
|
|
7
8
|
|
8
9
|
class HumbleRPiPluginNFC
|
@@ -13,6 +14,7 @@ class HumbleRPiPluginNFC
|
|
13
14
|
@notifier = variables[:notifier]
|
14
15
|
@device_id = variables[:device_id] || 'pi'
|
15
16
|
@readers = NFC::Reader.all
|
17
|
+
@hashing = settings[:hashing] || true
|
16
18
|
|
17
19
|
end
|
18
20
|
|
@@ -23,12 +25,13 @@ class HumbleRPiPluginNFC
|
|
23
25
|
|
24
26
|
puts 'ready to detect RFID tags'
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
+
@readers[0].poll(Mifare::Classic::Tag,
|
29
|
+
Mifare::Ultralight::Tag, IsoDep::Tag) do |tag|
|
28
30
|
|
29
31
|
begin
|
30
|
-
|
31
|
-
|
32
|
+
|
33
|
+
tag_id = @hashing ? (Digest::MD5.new << tag.to_s).to_s : tag
|
34
|
+
notifier.notice "%s/nfc: detected %s" % [device_id, tag_id]
|
32
35
|
|
33
36
|
rescue Exception => e
|
34
37
|
p e
|
@@ -41,4 +44,4 @@ class HumbleRPiPluginNFC
|
|
41
44
|
alias on_start start
|
42
45
|
|
43
46
|
|
44
|
-
end
|
47
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: humble_rpi-plugin-nfc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
CP8vWSGgYGVdZrCcuXbI+aRp9YwnGy4VyynFS3taPopg64vu8fGPKd3i0z/aKKP9
|
32
32
|
0RGDuBJUo3xsAw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-02-
|
34
|
+
date: 2016-02-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ruby-nfc
|
metadata.gz.sig
CHANGED
Binary file
|