2020-11-27 01:16:14 +02:00
|
|
|
|
using NetworkResurrector.Abstractions;
|
2020-11-27 01:35:31 +02:00
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Net.NetworkInformation;
|
2020-11-27 01:16:14 +02:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace NetworkResurrector.WakeOnLan.Nikeee
|
|
|
|
|
{
|
|
|
|
|
public class WakeOnLanService : IWakeOnLanService
|
|
|
|
|
{
|
2020-11-27 01:35:31 +02:00
|
|
|
|
public async Task<(bool success, string message)> Wake(string macAddress)
|
2020-11-27 01:16:14 +02:00
|
|
|
|
{
|
2020-11-27 01:35:31 +02:00
|
|
|
|
var mac = PhysicalAddress.Parse(macAddress);
|
|
|
|
|
await mac.SendWolAsync();
|
|
|
|
|
|
|
|
|
|
return (true, "Success");
|
2020-11-27 01:16:14 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|