ISsdpDevicePublisher.cs 1.5 KB

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