From OpenHome
Contents |
Radio Service
Overview
The Radio service offers a means for controlling radio presets.
If a device's Product service reports a source of type "Radio", then that device is guaranteed to also bear the Radio service. If the Radio service is available, all its properties and actions must be fully implemented.
Evented Properties
ChannelsMax
The maximum number of presets (and so the number of elements in IdArray). Does not vary at run-time.
Id
The id of the currently selected preset. Or 0 if no preset has ever been selected.
IdArray
A JSON integer array containing preset ids. Will always have ChannelsMax elements. A value of 0 implies that no preset is set for that slot.
Metadata
Metadata for the last preset to be selected.
Uri
Uri for the last preset to be selected.
Actions
Channel
Arguments: (out string uri, out string metadata)
Return the values of the Uri and Metadata properties.
ChannelsMax
Arguments: (out uint max)
Return the value of the ChannelsMax property.
Id
Arguments: (out uint id)
Return the value of the Id property.
IdArray
Arguments: (out uint token, out string idArray)
Return the value of the IdArray property.
IdArrayChanged
Arguments: (in uint token, out bool changed)
Check to see if the IdArray state variable has changed since gathering the specified IdArrayToken. This Token must have been previously collected from the IdArray action. This action is provided specifically for clients which cannot consume standard evented updates of properties.
Read
Arguments: (in uint id, out string metadata)
Given a channel preset id, return its associated metadata. The metadata will be of the form
{ "Title": "[title]" "Origin": "[id of origin of metadata]" "Uri": "[preset uri]" "Artwork": "[image url]" }
The elements listed above are guaranteed to be present; additional elements may also be included.
ReadList
Arguments: (in string ids, out string json)
Given a space separated list of channel preset ids, return their associated metadata. The metadata will be of the form
{ "channels": [ { "id": [preset_id_1], "metadata": { "Title": "[title]" "Origin": "[id of origin of metadata]" "Uri": "[preset uri]" "Artwork": "[image url]" } }, { "id": [preset_id_1], "metadata": { "Title": "[title]" "Origin": "[id of origin of metadata]" "Uri": "[preset uri]" "Artwork": "[image url]" } }, ........ ] }
UPnP Service Description
For devices supporting the UPnP protocol, the service description is
name: "Radio"
domain: "openhome.org.eriskay"
version: "1"
<?xml version="1.0"?> <scpd xmlns="urn:schemas-upnp-org:service-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <actionList> <action> <name>Channel</name> <argumentList> <argument> <name>Uri</name> <direction>out</direction> <relatedStateVariable>Uri</relatedStateVariable> </argument> <argument> <name>Metadata</name> <direction>out</direction> <relatedStateVariable>Metadata</relatedStateVariable> </argument> </argumentList> </action> <action> <name>Id</name> <argumentList> <argument> <name>Value</name> <direction>out</direction> <relatedStateVariable>Id</relatedStateVariable> </argument> </argumentList> </action> <action> <name>Read</name> <argumentList> <argument> <name>Id</name> <direction>in</direction> <relatedStateVariable>Id</relatedStateVariable> </argument> <argument> <name>Metadata</name> <direction>out</direction> <relatedStateVariable>Metadata</relatedStateVariable> </argument> </argumentList> </action> <action> <name>ReadList</name> <argumentList> <argument> <name>IdList</name> <direction>in</direction> <relatedStateVariable>IdList</relatedStateVariable> </argument> <argument> <name>ChannelList</name> <direction>out</direction> <relatedStateVariable>ChannelList</relatedStateVariable> </argument> </argumentList> </action> <action> <name>IdArray</name> <argumentList> <argument> <name>Token</name> <direction>out</direction> <relatedStateVariable>IdArrayToken</relatedStateVariable> </argument> <argument> <name>Array</name> <direction>out</direction> <relatedStateVariable>IdArray</relatedStateVariable> </argument> </argumentList> </action> <action> <name>IdArrayChanged</name> <argumentList> <argument> <name>Token</name> <direction>in</direction> <relatedStateVariable>IdArrayToken</relatedStateVariable> </argument> <argument> <name>Value</name> <direction>out</direction> <relatedStateVariable>IdArrayChanged</relatedStateVariable> </argument> </argumentList> </action> <action> <name>ChannelsMax</name> <argumentList> <argument> <name>Value</name> <direction>out</direction> <relatedStateVariable>ChannelsMax</relatedStateVariable> </argument> </argumentList> </action> </actionList> <serviceStateTable> <stateVariable sendEvents="yes"> <name>Uri</name> <dataType>string</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>Metadata</name> <dataType>string</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>Id</name> <dataType>ui4</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>IdArray</name> <dataType>string</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>ChannelsMax</name> <dataType>ui4</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>IdArrayToken</name> <dataType>ui4</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>IdArrayChanged</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>IdList</name> <dataType>string</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>ChannelList</name> <dataType>string</dataType> </stateVariable> </serviceStateTable> </scpd>