Module: RUPNP::SSDP
- Defined in:
- lib/rupnp/ssdp.rb,
lib/rupnp/ssdp/http.rb
Overview
SSDP module. This a discovery part of UPnP.
Defined Under Namespace
Modules: HTTP, 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
34 35 36 37 |
# File 'lib/rupnp/ssdp.rb', line 34 def self.listen(={}) EM.open_datagram_socket(MULTICAST_IP, DISCOVERY_PORT, SSDP::Listener, ) end |
.notify(type, stype, options = {}) ⇒ Object
Notify announces
41 42 43 44 |
# File 'lib/rupnp/ssdp.rb', line 41 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
27 28 29 30 |
# File 'lib/rupnp/ssdp.rb', line 27 def self.search(target=:all, ={}) [:search_target] = KNOWN_TARGETS[target] || target EM.open_datagram_socket '0.0.0.0', 0, SSDP::Searcher, end |