2019-08-09 21:16:24 +00:00
|
|
|
using System.Net.NetworkInformation;
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
namespace MediaBrowser.Model.System
|
|
|
|
{
|
2019-08-09 21:16:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Provides the MAC address and port for wake-on-LAN functionality.
|
|
|
|
/// </summary>
|
2018-12-27 23:27:57 +00:00
|
|
|
public class WakeOnLanInfo
|
|
|
|
{
|
2019-08-09 21:16:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="macAddress">The MAC address.</param>
|
2020-04-05 16:10:56 +00:00
|
|
|
public WakeOnLanInfo(PhysicalAddress macAddress) : this(macAddress.ToString())
|
2019-08-09 21:16:24 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="macAddress">The MAC address.</param>
|
2020-04-05 16:10:56 +00:00
|
|
|
public WakeOnLanInfo(string macAddress) : this()
|
2019-08-09 21:16:24 +00:00
|
|
|
{
|
|
|
|
MacAddress = macAddress;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
|
|
|
|
/// </summary>
|
2018-12-27 23:27:57 +00:00
|
|
|
public WakeOnLanInfo()
|
|
|
|
{
|
|
|
|
Port = 9;
|
|
|
|
}
|
2020-04-05 16:10:56 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the MAC address of the device.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The MAC address.</value>
|
2021-02-20 22:13:04 +00:00
|
|
|
public string? MacAddress { get; }
|
2020-04-05 16:10:56 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the wake-on-LAN port.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The wake-on-LAN port.</value>
|
|
|
|
public int Port { get; set; }
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
2019-01-13 19:31:15 +00:00
|
|
|
}
|