ISsdpDevicePublisher.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Threading.Tasks;
  3. namespace Rssdp.Infrastructure
  4. {
  5. /// <summary>
  6. /// Interface for components that publish the existence of SSDP devices.
  7. /// </summary>
  8. /// <remarks>
  9. /// <para>Publishing a device includes sending notifications (alive and byebye) as well as responding to search requests when appropriate.</para>
  10. /// </remarks>
  11. /// <seealso cref="SsdpRootDevice"/>
  12. /// <seealso cref="ISsdpDeviceLocator"/>
  13. public interface ISsdpDevicePublisher
  14. {
  15. /// <summary>
  16. /// Adds a device (and it's children) to the list of devices being published by this server, making them discoverable to SSDP clients.
  17. /// </summary>
  18. /// <param name="device">The <see cref="SsdpRootDevice"/> instance to add.</param>
  19. /// <returns>An awaitable <see cref="Task"/>.</returns>
  20. void AddDevice(SsdpRootDevice device);
  21. /// <summary>
  22. /// Removes a device (and it's children) from the list of devices being published by this server, making them undiscoverable.
  23. /// </summary>
  24. /// <param name="device">The <see cref="SsdpRootDevice"/> instance to add.</param>
  25. /// <returns>An awaitable <see cref="Task"/>.</returns>
  26. Task RemoveDevice(SsdpRootDevice device);
  27. /// <summary>
  28. /// Returns a read only list of devices being published by this instance.
  29. /// </summary>
  30. /// <seealso cref="SsdpDevice"/>
  31. System.Collections.Generic.IEnumerable<SsdpRootDevice> Devices { get; }
  32. }
  33. }