2014-03-24 05:47:39 -07:00
|
|
|
|
using System;
|
2014-04-10 08:06:54 -07:00
|
|
|
|
using System.Net;
|
2014-03-24 05:47:39 -07:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Dlna.Server
|
|
|
|
|
{
|
|
|
|
|
public sealed class UpnpDevice
|
|
|
|
|
{
|
|
|
|
|
public readonly Uri Descriptor;
|
|
|
|
|
public readonly string Type;
|
|
|
|
|
public readonly string USN;
|
|
|
|
|
public readonly Guid Uuid;
|
2014-04-10 08:06:54 -07:00
|
|
|
|
public readonly IPAddress Address;
|
2014-03-24 05:47:39 -07:00
|
|
|
|
|
2014-04-10 08:06:54 -07:00
|
|
|
|
public UpnpDevice(Guid aUuid, string aType, Uri aDescriptor, IPAddress address)
|
2014-03-24 05:47:39 -07:00
|
|
|
|
{
|
|
|
|
|
Uuid = aUuid;
|
|
|
|
|
Type = aType;
|
|
|
|
|
Descriptor = aDescriptor;
|
|
|
|
|
|
2014-04-10 08:06:54 -07:00
|
|
|
|
Address = address;
|
|
|
|
|
|
2014-04-19 22:21:08 -07:00
|
|
|
|
if (Type.StartsWith("uuid:", StringComparison.OrdinalIgnoreCase))
|
2014-03-24 05:47:39 -07:00
|
|
|
|
{
|
|
|
|
|
USN = Type;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-04-19 22:21:08 -07:00
|
|
|
|
USN = String.Format("uuid:{0}::{1}", Uuid.ToString("N"), Type);
|
2014-03-24 05:47:39 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|