Class: LifxDash::Snoop
- Inherits:
-
Object
- Object
- LifxDash::Snoop
- Defined in:
- lib/lifx_dash/snoop.rb
Instance Attribute Summary collapse
-
#iface ⇒ Object
readonly
Returns the value of attribute iface.
Instance Method Summary collapse
-
#initialize(network_iface_id) ⇒ Snoop
constructor
A new instance of Snoop.
- #run ⇒ Object
Constructor Details
#initialize(network_iface_id) ⇒ Snoop
Returns a new instance of Snoop.
8 9 10 |
# File 'lib/lifx_dash/snoop.rb', line 8 def initialize(network_iface_id) @iface = network_iface_id end |
Instance Attribute Details
#iface ⇒ Object (readonly)
Returns the value of attribute iface.
6 7 8 |
# File 'lib/lifx_dash/snoop.rb', line 6 def iface @iface end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lifx_dash/snoop.rb', line 12 def run puts "Snooping for dash button packets on #{iface} ... press [CTRL-c] to stop\n\n" LifxDash::Capturer.new(iface).listen do |pkt, mac| LOGGER.info "possible Dash button press from MAC address: #{mac} -- pkt summary: #{pkt.peek}" end end |