Project

rupnp

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
RUPNP is a Ruby UPnP framework. For now, only control points (clients) are supported. Devices (servers) will be later.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.2.6
~> 2.14.0
~> 0.8.2
~> 1.16.1

Runtime

~> 2.3.0
~> 0.9.12
~> 2.3.0
~> 2.3.0
 Project Readme

RUPNP will be a Ruby UPNP framework.

Its first purpose is to make my first eventmachine development.

Create a control point

RUPNP will help you to create a UPnP control point (a client) :

require 'rupnp'

EM.run do
  # Search for root devices
  cp = RUPNP::ControlPoint(:root)
  cp.start do |new_devices, disappeared_devices|
    new_devices.subscribe do |device|
      # Do what you want here with new devices
      # Services are available through device.services
    end
    disappeared_devices.subscribe do |device|
      # Do what you want here with devices which unsubscribe
    end
  end
end

Create a device

TODO

discover utility

discover is a command line utility to act as a control point:

$ discover
discover> search ssdp:all
1 devices found
discover> devices[0].class
=> RUPNP::CP::RemoteDevice
discover>

The search command take an argument : the target for a UPnP M-SEARCH. This argument may be:

  • ssdp:all;
  • upnp:rootdevice;
  • a URN as upnp:{URN}. If no argument is given, default to ssdp:all.

discover use pry. So, in discover, you can use the power of Pry.