Module: RUPNP::SSDP
- Defined in:
- lib/rupnp/ssdp.rb,
lib/rupnp/ssdp/multicast_connection.rb
Overview
SSDP module. This a discovery part of UPnP.
Defined Under Namespace
Modules: SearchResponder Classes: Listener, MSearchResponder, MulticastConnection, Notifier, Searcher, USearchResponder
Constant Summary collapse
- KNOWN_TARGETS =
Some shorcut for common targets
{ :all => 'ssdp:all', :root => 'upnp:rootdevice' }
Class Method Summary collapse
-
.listen(options = {}) ⇒ Object
Listen for devices’ announces.
-
.notify(type, stype, options = {}) ⇒ Object
Notify announces.
-
.search(target = :all, options = {}) ⇒ Object
Search devices.
Class Method Details
.listen(options = {}) ⇒ Object
Listen for devices’ announces
33 34 35 36 |
# File 'lib/rupnp/ssdp.rb', line 33 def self.listen(={}) EM.open_datagram_socket(MULTICAST_IP, DISCOVERY_PORT, SSDP::Listener, ) end |
.notify(type, stype, options = {}) ⇒ Object
Notify announces
40 41 42 43 |
# File 'lib/rupnp/ssdp.rb', line 40 def self.notify(type, stype, ={}) EM.open_datagram_socket(MULTICAST_IP, DISCOVERY_PORT, SSDP::Notifier, type, stype, ) end |
.search(target = :all, options = {}) ⇒ Object
Search devices
26 27 28 29 |
# File 'lib/rupnp/ssdp.rb', line 26 def self.search(target=:all, ={}) [:search_target] = KNOWN_TARGETS[target] || target EM.open_datagram_socket '0.0.0.0', 0, SSDP::Searcher, end |