Hi Tasio,
Could you test the following code for me, I haven't got access to a machine that responds to WOL at the moment.
According to the Wake on LAN monitor, the magic packet sent is OK, but I'd like to know that it actually works before making a HomeGenie APP for this.
Here is the code in C#. (or you can import the .hgx file)
// CSharp Automation Program Plugin
// Example for using Helper Classes:
// Modules.WithName("Light 1").On();
string MACAddress = "A4-F7-32-A4-79-87";
string BroadcastAddress = "192.168.0.255";
// Remove '-'
if (MACAddress.Contains("-")) { MACAddress = MACAddress.Replace("-", String.Empty); }
// Remove ':'
if (MACAddress.Contains(":")) { MACAddress = MACAddress.Replace(":", String.Empty); }
// Build Magic packet as string, begin with 6 x 0xFF
string MagicPacket = "FFFFFFFFFFFF";
// Add 16 times the MAC address.
for (int i = 1; i <= 16; i++)
{
MagicPacket += MACAddress;
}
byte[] packet = System.Runtime.Remoting.Metadata.W3cXsd2001.SoapHexBinary.Parse(MagicPacket).Value;
System.Net.Sockets.UdpClient client = new System.Net.Sockets.UdpClient();
client.Connect(BroadcastAddress, 4343);
// Send the Magic packet packet.
client.Send(packet, packet.Length);
Thanks for your help.