humble_rpi-plugin-nfc 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2ef23653ccfdb949577536569cd9414322cbfd2
4
- data.tar.gz: 40bbc19d2b0e4b5bc1dce9e477335abc55df7e1f
3
+ metadata.gz: 7976a92ac5bf609a4108d2c5de1d9a5e542d9a62
4
+ data.tar.gz: d8afee1080f546a0769fca0e5faaa36d27a0b2ae
5
5
  SHA512:
6
- metadata.gz: 344050e07455892c3a971ab352077ec679db4a692ef92eab32a626a3cbcb311c96650251339469de59b8ae66c7928dc43772013e1c7425076ad348c2afb5ccf3
7
- data.tar.gz: 3a598120fffd9c5fa91ee02dac6c77cac35a91db2394438bec3365c0ac699c44ed86c0f6aa324a348bf652793e3e2484c33559ebc63f9370c82ed97284460f32
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
- @readers[0].poll(Mifare::Classic::Tag, IsoDep::Tag, Mifare::Ultralight::Tag) do |tag|
28
+ @readers[0].poll(Mifare::Classic::Tag,
29
+ Mifare::Ultralight::Tag, IsoDep::Tag) do |tag|
28
30
 
29
31
  begin
30
-
31
- notifier.notice "%s/nfc: detected %s" % [device_id, tag]
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.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-09 00:00:00.000000000 Z
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