/// <summary>Sends a Wake On LAN signal (magic packet) to a specific IP address with the physical address.</summary> /// <param name="address">The instance of the physical address that should be used in the magic packet.</param> /// <param name="target">Destination <see cref="IPAddress"/>.</param> /// <param name="password">The SecureOn password of the client.</param> /// <exception cref="ArgumentNullException"><paramref name="address"/> is null.</exception> /// <returns>An asynchronous <see cref="Task"/> which sends a Wake On LAN signal (magic packet) to a client.</returns> public static Task SendWolAsync(this PhysicalAddress address, IPAddress target, SecureOnPassword password) { if (address == null) { throw new ArgumentNullException(nameof(address)); } return(target.SendWolAsync(address.GetAddressBytes(), password)); }
/// <summary> /// Sendet ein Wake-On-LAN-Signal an die IP-Adresse der target-Instanz mit der MAC-Adresse der Instanz in einem separaten Thread. /// </summary> /// <param name="address">Die Instanz der MacAddress, die im Wake-On-LAN-Signal angesprochen werden soll.</param> /// <param name="target">Der Ziel-IPEndPoint.</param> /// <returns>Ein asynchroner Task, welcher ein Wake-On-LAN-Signal an einen Client sendet.</returns> public static Task SendWolAsync(this MacAddress address, IPAddress target) { return target.SendWolAsync(address.Address); }
/// <summary> /// Sendet ein Wake-On-LAN-Signal an die IP-Adresse der target-Instanz mit der MAC-Adresse der Instanz in einem separaten Thread. /// </summary> /// <param name="address">Die Instanz der MacAddress, die im Wake-On-LAN-Signal angesprochen werden soll.</param> /// <param name="target">Der Ziel-IPEndPoint.</param> /// <param name="password">Das SecureOn-Passwort des Clients.</param> /// <exception cref="System.ArgumentNullException">password ist null.</exception> /// <returns>Ein asynchroner Task, welcher ein Wake-On-LAN-Signal an einen Client sendet.</returns> public static Task SendWolAsync(this MacAddress address, IPAddress target, SecureOnPassword password) { return target.SendWolAsync(address.Address, password); }
/// <summary>Sends a Wake On LAN signal (magic packet) to a client.</summary> /// <param name="target">Destination <see cref="IPAddress"/>.</param> /// <param name="macAddress">The MAC address of the client.</param> /// <param name="port">The port to send the packet to.</param> /// <exception cref="ArgumentException">The length of the <see cref="T:System.Byte" /> array <paramref name="macAddress"/> is not 6.</exception> /// <exception cref="ArgumentNullException"><paramref name="macAddress"/> is null.</exception> /// <returns>An asynchronous <see cref="Task"/> which sends a Wake On LAN signal (magic packet) to a client.</returns> public static Task SendWolAsync(this IPAddress target, byte[] macAddress, int port) => target.SendWolAsync(macAddress, port, null);
/// <summary>Sends a Wake On LAN signal (magic packet) to a client.</summary> /// <param name="target">Destination <see cref="IPAddress"/>.</param> /// <param name="macAddress">The MAC address of the client.</param> /// <exception cref="ArgumentException">The length of the <see cref="PhysicalAddress" /> <paramref name="macAddress"/> is not 6.</exception> /// <exception cref="ArgumentNullException"><paramref name="macAddress"/> is null.</exception> /// <returns>An asynchronous <see cref="Task"/> which sends a Wake On LAN signal (magic packet) to a client.</returns> public static Task SendWolAsync(this IPAddress target, PhysicalAddress macAddress) => target.SendWolAsync(macAddress, null);
public static Task SendWolAsync(this IPAddress target, byte mac0, byte mac1, byte mac2, byte mac3, byte mac4, byte mac5) => target.SendWolAsync(mac0, mac1, mac2, mac3, mac4, mac5, DefaultWolPort);
/// <summary>Sends a Wake On LAN signal (magic packet) to a specific IP address with the physical address.</summary> /// <param name="address">The instance of the physical address that should be used in the magic packet.</param> /// <param name="target">Destination <see cref="IPAddress"/>.</param> /// <param name="password">The SecureOn password of the client.</param> /// <exception cref="ArgumentNullException"><paramref name="address"/> is null.</exception> /// <returns>An asynchronous <see cref="Task"/> which sends a Wake On LAN signal (magic packet) to a client.</returns> public static Task SendWolAsync(this PhysicalAddress address, IPAddress target, SecureOnPassword password) { if (address == null) throw new ArgumentNullException(nameof(address)); return target.SendWolAsync(address.GetAddressBytes(), password); }
/// <summary> /// Sendet ein Wake-On-LAN-Signal an die IP-Adresse der target-Instanz, was als asynchroner Vorgang mithilfe eines Taskobjekts angegeben wird. /// </summary> /// <param name="address">Die Instanz der MacAddress, die im Wake-On-LAN-Signal angesprochen werden soll.</param> /// <param name="target">Der Ziel-IPEndPoint.</param> /// <returns>Ein asynchroner Task, welcher ein Wake-On-LAN-Signal an einen Client sendet.</returns> public static Task SendWolAsync(this PhysicalAddress address, IPAddress target) { if (address == null) throw new ArgumentNullException("address"); return target.SendWolAsync(address.GetAddressBytes()); }