Class SsdpDevice
Base class representing the common details of a (root or embedded) device, either to be published or that has been located.
Namespace: MediaBrowser.Model.Ssdp
Assembly: MediaBrowser.Model.dll
Syntax
public abstract class SsdpDevice
Remarks
Do not derive new types directly from this class. New device classes should derive from either SsdpRootDevice or SsdpEmbeddedDevice.
Constructors
SsdpDevice()
Derived type constructor, allows constructing a device with no parent. Should only be used from derived types that are or inherit from SsdpRootDevice.
Declaration
protected SsdpDevice()
Properties
DeviceClass
Declaration
public string DeviceClass { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Devices
Returns a read-only enumerable set of SsdpDevice objects representing children of this device. Child devices are optional.
Declaration
public SsdpDevice[] Devices { get; }
Property Value
Type | Description |
---|---|
SsdpDevice[] |
DeviceType
Sets or returns the core device type (not including namespace, version etc.). Required.
Declaration
public string DeviceType { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DeviceTypeNamespace
Sets or returns the namespace for the DeviceType of this device. Optional, but defaults to UPnP schema so should be changed if DeviceType is not a UPnP device type.
Declaration
public string DeviceTypeNamespace { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DeviceVersion
Sets or returns the version of the device type. Optional, defaults to 1.
Declaration
public int DeviceVersion { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Defaults to a value of 1.
See Also
FriendlyName
Sets or returns a friendly/display name for this device on the network. Something the user can identify the device/instance by, i.e Lounge Main Light. Required.
Declaration
public string FriendlyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
A short description for the end user.
FullDeviceType
Returns the full device type string.
Declaration
public string FullDeviceType { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The format used is urn:DeviceTypeNamespace:device:DeviceType:DeviceVersion
Manufacturer
Sets or returns the name of the manufacturer of this device. Required.
Declaration
public string Manufacturer { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ManufacturerUrl
Sets or returns a URL to the manufacturers web site. Optional.
Declaration
public Uri ManufacturerUrl { get; set; }
Property Value
Type | Description |
---|---|
System.Uri |
ModelDescription
Sets or returns a description of this device model. Recommended.
Declaration
public string ModelDescription { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
A long description for the end user.
ModelName
Sets or returns the name of this model. Required.
Declaration
public string ModelName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ModelNumber
Sets or returns the number of this model. Recommended.
Declaration
public string ModelNumber { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ModelUrl
Sets or returns a URL to a web page with details of this device model. Optional.
Declaration
public Uri ModelUrl { get; set; }
Property Value
Type | Description |
---|---|
System.Uri |
Remarks
Optional. May be relative to base URL.
PresentationUrl
Sets or returns the URL to a web page that can be used to configure/manager/use the device. Recommended.
Declaration
public Uri PresentationUrl { get; set; }
Property Value
Type | Description |
---|---|
System.Uri |
Remarks
May be relative to base URL.
SerialNumber
Sets or returns the serial number for this device. Recommended.
Declaration
public string SerialNumber { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Udn
Returns (or sets*) a unique device name for this device. Optional, not recommended to be explicitly set.
Declaration
public string Udn { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
* In general you should not explicitly set this property. If it is not set (or set to null/empty string) the property will return a UDN value that is correct as per the UPnP specification, based on the other device properties.
The setter is provided to allow for devices that do not correctly follow the specification (when we discover them), rather than to intentionally deviate from the specification.
If a value is explicitly set, it is used verbatim, and so any prefix (such as uuid:) must be provided in the value.
Upc
Sets or returns the universal product code of the device, if any. Optional.
Declaration
public string Upc { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
If not blank, must be exactly 12 numeric digits.
Uuid
Sets or returns the universally unique identifier for this device (without the uuid: prefix). Required.
Declaration
public string Uuid { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Must be the same over time for a specific device instance (i.e. must survive reboots).
For UPnP 1.0 this can be any unique string. For UPnP 1.1 this should be a 128 bit number formatted in a specific way, preferably generated using the time and MAC based algorithm. See section 1.1.4 of http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf for details.
Technically this library implements UPnP 1.0, so any value is allowed, but we advise using UPnP 1.1 compatible values for good behaviour and forward compatibility with future versions.
Methods
AddDevice(SsdpEmbeddedDevice)
Adds a child device to the Devices collection.
Declaration
public void AddDevice(SsdpEmbeddedDevice device)
Parameters
Type | Name | Description |
---|---|---|
SsdpEmbeddedDevice | device | The SsdpEmbeddedDevice instance to add. |
Remarks
If the device is already a member of the Devices collection, this method does nothing.
Also sets the RootDevice property of the added device and all descendant devices to the relevant SsdpRootDevice instance.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if the |
System.InvalidOperationException | Thrown if the |
ToRootDevice()
Declaration
public SsdpRootDevice ToRootDevice()
Returns
Type | Description |
---|---|
SsdpRootDevice |