Class SsdpRootDevice
Represents a 'root' device, a device that has no parent. Used for publishing devices and for the root device in a tree of discovered devices.
Inherited Members
Namespace: Rssdp
Assembly: cs.temp.dll.dll
Syntax
public class SsdpRootDevice : SsdpDevice
Remarks
Child (embedded) devices are represented by the SsdpDevice in the Devices property.
Root devices contain some information that applies to the whole device tree and is therefore not present on child devices, such as CacheLifetime and Location.
Constructors
SsdpRootDevice()
Default constructor.
Declaration
public SsdpRootDevice()
SsdpRootDevice(Uri, TimeSpan, String)
Partial deserialisation constructor.
Declaration
public SsdpRootDevice(Uri location, TimeSpan cacheLifetime, string deviceDescriptionXml)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | location | The url from which the device description document was retrieved. |
| System.TimeSpan | cacheLifetime | A System.TimeSpan representing the time maximum period of time the device description can be cached for. |
| System.String | deviceDescriptionXml | The device description XML as a string. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if the |
| System.ArgumentException | Thrown if the |
SsdpRootDevice(Uri, TimeSpan, String, Nullable<XmlReaderSettings>)
Full deserialisation constructor.
Declaration
public SsdpRootDevice(Uri location, TimeSpan cacheLifetime, string deviceDescriptionXml, XmlReaderSettings? xmlReaderSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | location | The url from which the device description document was retrieved. |
| System.TimeSpan | cacheLifetime | A System.TimeSpan representing the time maximum period of time the device description can be cached for. |
| System.String | deviceDescriptionXml | The device description XML as a string. |
| System.Nullable<XmlReaderSettings> | xmlReaderSettings | A |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if the |
| System.ArgumentException | Thrown if the |
Properties
CacheLifetime
Specifies how long clients can cache this device's details for. Optional but defaults to System.TimeSpan.Zero which means no-caching. Recommended value is half an hour.
Declaration
public TimeSpan CacheLifetime { get; set; }
Property Value
| Type | Description |
|---|---|
| System.TimeSpan |
Remarks
Specifiy System.TimeSpan.Zero to indicate no caching allowed.
Also used to specify how often to rebroadcast alive notifications.
The UPnP/SSDP specifications indicate this should not be less than 1800 seconds (half an hour), but this is not enforced by this library.
Location
Gets or sets the URL used to retrieve the description document for this device/tree. Required.
Declaration
public Uri Location { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Uri |
UrlBase
The base URL to use for all relative url's provided in other propertise (and those of child devices). Optional.
Declaration
public Uri UrlBase { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Uri |
Remarks
Defines the base URL. Used to construct fully-qualified URLs. All relative URLs that appear elsewhere in the description are combined with this base URL. If URLBase is empty or not given, the base URL is the URL from which the device description was retrieved (which is the preferred implementation; use of URLBase is no longer recommended). Specified by UPnP vendor. Single URL.
Methods
ToDescriptionDocument()
Saves the property values of this device object to an a string in the full UPnP device description XML format, including child devices and outer root node and XML document declaration.
Declaration
public virtual string ToDescriptionDocument()
Returns
| Type | Description |
|---|---|
| System.String | A string containing XML in the UPnP device description format |