Module: RUPNP

Defined in:
lib/rupnp.rb,
lib/rupnp/http.rb,
lib/rupnp/ssdp.rb,
lib/rupnp/event.rb,
lib/rupnp/tools.rb,
lib/rupnp/cp/base.rb,
lib/rupnp/constants.rb,
lib/rupnp/log_mixin.rb,
lib/rupnp/control_point.rb,
lib/rupnp/ssdp/listener.rb,
lib/rupnp/ssdp/notifier.rb,
lib/rupnp/ssdp/searcher.rb,
lib/rupnp/cp/event_server.rb,
lib/rupnp/cp/remote_device.rb,
lib/rupnp/cp/remote_service.rb,
lib/rupnp/ssdp/search_responder.rb,
lib/rupnp/ssdp/msearch_responder.rb,
lib/rupnp/ssdp/usearch_responder.rb,
lib/rupnp/ssdp/multicast_connection.rb

Overview

Module for RUPNP namespace

Author:

  • Sylvain Daubert

Defined Under Namespace

Modules: CP, HTTP, LogMixin, SSDP, Tools Classes: ControlPoint, Discover, Error, Event

Constant Summary collapse

VERSION =

RUPNP version

'0.3.0'
MULTICAST_IP =

Multicast IP for UPnP

'239.255.255.250'.freeze
DISCOVERY_PORT =

Default port for UPnP

1900
DEFAULT_TTL =

Default TTL for UPnP

2
UPNP_VERSION =

UPnP version

'1.1'.freeze
USER_AGENT =

User agent for UPnP messages

`uname -s`.chomp + "/#{`uname -r `.chomp.gsub(/-.*/, '')} " +
"UPnP/#{UPNP_VERSION} rupnp/#{VERSION}".freeze
HOST_IP =

Host IP

Socket.ip_address_list.
find_all { |ai| ai.ipv4? && !ai.ipv4_loopback? }.last.ip_address.freeze
EVENT_SUB_DEFAULT_PORT =

Default port for listening for events

8080
EVENT_SUB_DEFAULT_TIMEOUT =

Default timeout for event subscription (in seconds)

30 * 60

Class Method Summary collapse

Class Method Details

.log_levelSymbol

Get log level

Returns:

  • (Symbol)


39
40
41
# File 'lib/rupnp.rb', line 39

def self.log_level
  @log_level
end

.log_level=(lvl) ⇒ Object

Set log level

Parameters:

  • lvl (:debug, :info, :warn, :error)


33
34
35
# File 'lib/rupnp.rb', line 33

def self.log_level=(lvl)
  @log_level = lvl
end

.logdevIO

Get log device

Returns:

  • (IO)

    io used to log



27
28
29
# File 'lib/rupnp.rb', line 27

def self.logdev
  @logdev
end

.logdev=(io_or_string) ⇒ IO

Set log device

Parameters:

  • io_or_string (IO, String)

    io or filename to log to

Returns:

  • (IO)


17
18
19
20
21
22
23
# File 'lib/rupnp.rb', line 17

def self.logdev=(io_or_string)
  if io_or_string.is_a? String
    @logdev = File.open(io_or_string, 'w')
  else
    @logdev = io_or_string
  end
end