humble_rpi-plugin-nfc 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +2 -0
- data.tar.gz.sig +0 -0
- data/lib/humble_rpi-plugin-nfc.rb +44 -0
- metadata +68 -0
- metadata.gz.sig +2 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4b0273536b90a24498987e5ddbd7795d95ef576c
|
4
|
+
data.tar.gz: 9fee8c8c4b04a48fdcdd519586ac25b15b41c6aa
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 27a543ce80600a220f22aae43bfc3f5454cd03e990888c41b8dd913e035389b81989ac34a26cd9975e8b0058159ba288bec112efe34a70933cd1b31119ede3bd
|
7
|
+
data.tar.gz: c17727bcd3819c056e6704fa31922427fbf681b08afd539c334adb3814150b8fb9a1631e0773b9500e1092ff7c805cf419bca1eb76e9f2810911e06113b3d813
|
checksums.yaml.gz.sig
ADDED
data.tar.gz.sig
ADDED
Binary file
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: humble_rpi-plugin-nfc.rb
|
4
|
+
|
5
|
+
require 'ruby-nfc'
|
6
|
+
|
7
|
+
|
8
|
+
class HumbleRPiPluginNFC
|
9
|
+
|
10
|
+
|
11
|
+
def initialize(settings: {}, variables: {})
|
12
|
+
|
13
|
+
@notifier = variables[:notifier]
|
14
|
+
@device_id = variables[:device_id] || 'pi'
|
15
|
+
@readers = NFC::Reader.all
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
def start()
|
20
|
+
|
21
|
+
notifier = @notifier
|
22
|
+
device_id = @device_id
|
23
|
+
|
24
|
+
puts 'ready to detect RFID tags'
|
25
|
+
|
26
|
+
|
27
|
+
@readers[0].poll(Mifare::Classic::Tag, IsoDep::Tag, Mifare::Ultralight::Tag) do |tag|
|
28
|
+
|
29
|
+
begin
|
30
|
+
|
31
|
+
notifier.notice "%s/nfc: detected %s" % [device_id, tag]
|
32
|
+
|
33
|
+
rescue Exception => e
|
34
|
+
p e
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
alias on_start start
|
42
|
+
|
43
|
+
|
44
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: humble_rpi-plugin-nfc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTE2MDIwOTAwNDk0M1oXDTE3MDIwODAwNDk0M1owSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
+
ggEBANxfQ7tnouort66rPMds3S8ms5qpXMmHRURhVDJaSihcO1N/TdM5DPHzm0bn
|
19
|
+
Iu1SwpVe33MWdk8jUogfxCfY4yd/AwCx3JstDkl/SRy7Fqak/vYwy31b2QRns7wn
|
20
|
+
CxxX3DA+dxkGsjp9I60nXy2BnJd/BoanL9+5C9/Fu/BbewtO12rsDGu9gbt+GHXr
|
21
|
+
2YxB6GefKu4bxbNFOoRmgdOmzMTnmjSgjt05nirUxNiBy890XmH3vOyAAulIPeKM
|
22
|
+
TcUqWNPCcG1GRMrFoAnNw/XfPgko1tymUg/ori7mmgEogj+ficqyHFE1M6/t4nek
|
23
|
+
rvUQn154yDbExOVBWH75l2Xa7JcCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUn4DwuRtAWjAidwAF+xZQE0qfNgwwJgYDVR0RBB8w
|
25
|
+
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEARmfPEY3j
|
27
|
+
qS3qBLhUAyYwXQ/ML3z3SKKtdENvM8K7zRPj29LUbWUjMDtLrFZnGWTEfJHW9ltM
|
28
|
+
xPbSPu87ybnrT2mL4UpxE1m83NmHgCXSJ3qX+OophwMmOSjnO62eIXzBZw2YShkt
|
29
|
+
kgZuCOQoUoyMp9NN0BCT4mYb18nWuOScBLy0SOOiHRITJNrdqIrtVqRFv7kdL76D
|
30
|
+
qJR4CNyU/NZW6wQb97+e3Ed2PZNn/gYaR6VAbfbx6WPXT2XpYlmprC2HBqd19wC2
|
31
|
+
CP8vWSGgYGVdZrCcuXbI+aRp9YwnGy4VyynFS3taPopg64vu8fGPKd3i0z/aKKP9
|
32
|
+
0RGDuBJUo3xsAw==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2016-02-09 00:00:00.000000000 Z
|
35
|
+
dependencies: []
|
36
|
+
description:
|
37
|
+
email: james@r0bertson.co.uk
|
38
|
+
executables: []
|
39
|
+
extensions: []
|
40
|
+
extra_rdoc_files: []
|
41
|
+
files:
|
42
|
+
- lib/humble_rpi-plugin-nfc.rb
|
43
|
+
homepage: https://github.com/jrobertson/humble_rpi-plugin-nfc
|
44
|
+
licenses:
|
45
|
+
- MIT
|
46
|
+
metadata: {}
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 2.4.8
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: A humble_rpi plugin for reading NFC RFID tags (using the ruby-nfc gem) and
|
67
|
+
publishing the identifier to the messaging broker
|
68
|
+
test_files: []
|
metadata.gz.sig
ADDED