Indeed, the first six bytes are 0xFF.
It's just because, I have defined the MAC address first.
But, to construct the packet, I use the 6 times 0xFF first (buf[0] to buf[5]
and then I add 16 times the MAC Address. buf[6] to buf [102]
<p$1$2$3$4$5$6>
I have got some questionning during my reading:
- Most program, I have found are using unsigned char instead of char. But, ethernet.send() only use char...
- Some code are using a specific port (7 or 9 or 40000), But, ethernet.send() does not define a port...
- Some code specify that UDP packet are needed, But, ethernet.send() does not define UDP or TCP..
SO, I am stuck
Does anyone has a sample Wake-on-lan code to wake up a PC by mbed. or any help on how can I send the packet(magic packet through ethernet).