Sha256: 5f4fcd52ef4f86a4bfb02682a1055e95cabb5d30f56aad39878cf9544ea39dcb

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

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) :
```ruby
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.

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rupnp-0.3.0 README.md
rupnp-0.2.2 README.md
rupnp-0.2.1 README.md
rupnp-0.2.0 README.md
rupnp-0.1.0 README.md