I want to send magic packet to wake up a specific PC(specific MAC address) connected to an mbed through LAN . I have found the following code in code project.
My MAC Address : 00-C0-9F-BD-E4-3A (sample).....how can i declare this and fill this in the array.* I have little knowledge in Programming. so please ignore any mistake or miss interpretation.
BYTE magicP[102];
...
//Fill in magic packet with 102 Bytes of data
//Header
//fill 6 Bytes with 0xFF
for (int i=0;i<6;i++)
magicP[i] = 0xff;
//First 6 bytes (these must be repeated!!)
//fill bytes 6-12
for (i=0;i<6;i++) {
//Get 2 charachters from mac address and convert it to int to fill
//magic packet
magicP[i+6] = HexStrToInt(macAddr.Mid(i*2,2));
}
//fill remaining 90 bytes (15 time repeat)
for (i=0;i<15;i++) memcpy(&magicP[(i+2)*6],&magicP[6],6);
...
here is the like where i have found this code: http://www.codeproject.com/KB/IP/WOL.aspx