UpnpDevice.cs 794 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Net;
  3. namespace MediaBrowser.Dlna.Server
  4. {
  5. public sealed class UpnpDevice
  6. {
  7. public readonly Uri Descriptor;
  8. public readonly string Type;
  9. public readonly string USN;
  10. public readonly string Uuid;
  11. public readonly IPAddress Address;
  12. public UpnpDevice(string aUuid, string aType, Uri aDescriptor, IPAddress address)
  13. {
  14. Uuid = aUuid;
  15. Type = aType;
  16. Descriptor = aDescriptor;
  17. Address = address;
  18. if (Type.StartsWith("uuid:", StringComparison.OrdinalIgnoreCase))
  19. {
  20. USN = Type;
  21. }
  22. else
  23. {
  24. USN = String.Format("uuid:{0}::{1}", Uuid, Type);
  25. }
  26. }
  27. }
  28. }