Yamaha MusicCast™ v0.2.2 MusicCast.UPnP.Service
A module for working with UPnP compliant services.
- It can automatically generate UPnP compliant clients from XML specifications.
- It provides pub/sub cababilities to subscribe and forward UPnP event notifcations.
- It provides a mechanism to define custom behavior for specific notification types.
Example
defmodule AVTransport do
use MusicCast.UPnP.Service, type: "AVTransport:1"
end
By default, the service will be generated from the priv/<transport_1.xml>
file of the current application
but it can be configured to be any subdirectory of priv by specifying the :priv
option.
The MusicCast.UPnP.Serializable
protocol provides a way to define your own casting implementation
based on the concret event notification type. See cast_event/2
for more details about event serialization.
Summary
Functions
Execute the given action
on the given UPnP service
Returns a service event struct from the given XML payload
Returns a map representing the UPnP service
Subscribes to a UPnP service
Unsubscribes from a UPnP service
Types
t() :: %MusicCast.UPnP.Service{device: %{device_type: String.t, device_type: String.t, friendly_name: String.t, manufacturer: String.t, manufacturer_url: String.t, model_description: String.t, model_name: String.t, model_number: String.t, model_url: String.t, udn: String.t, presentation_url: String.t, icon_list: %{width: Integer.t, height: Integer.t, depth: Integer.t, mime_type: String.t, url: String.t}, service_list: %{service_type: String.t, service_id: String.t, scpd_url: String.t, control_url: String.t, event_sub_url: String.t}}, url: String.t, version: %{major: Integer.t, minor: Integer.t}}
Functions
Execute the given action
on the given UPnP service.
Returns a service event struct from the given XML payload.
By implementing the MusicCast.UPnP.Serializable
protocol for the given service
,
you can provide your casting implementation. Have a look at MusicCast.UPnP.AVTransport
for a concret example.
Returns a map representing the UPnP service.
subscribe(String.t, String.t, Integer.t) :: {:ok, subscription} | {:error, term}
Subscribes to a UPnP service.