WakeOnLanInfo.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Net.NetworkInformation;
  2. namespace MediaBrowser.Model.System
  3. {
  4. /// <summary>
  5. /// Provides the MAC address and port for wake-on-LAN functionality.
  6. /// </summary>
  7. public class WakeOnLanInfo
  8. {
  9. /// <summary>
  10. /// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
  11. /// </summary>
  12. /// <param name="macAddress">The MAC address.</param>
  13. public WakeOnLanInfo(PhysicalAddress macAddress) : this(macAddress.ToString())
  14. {
  15. }
  16. /// <summary>
  17. /// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
  18. /// </summary>
  19. /// <param name="macAddress">The MAC address.</param>
  20. public WakeOnLanInfo(string macAddress) : this()
  21. {
  22. MacAddress = macAddress;
  23. }
  24. /// <summary>
  25. /// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
  26. /// </summary>
  27. public WakeOnLanInfo()
  28. {
  29. Port = 9;
  30. }
  31. /// <summary>
  32. /// Gets the MAC address of the device.
  33. /// </summary>
  34. /// <value>The MAC address.</value>
  35. public string? MacAddress { get; }
  36. /// <summary>
  37. /// Gets or sets the wake-on-LAN port.
  38. /// </summary>
  39. /// <value>The wake-on-LAN port.</value>
  40. public int Port { get; set; }
  41. }
  42. }