I have now programmed a code where i can switch on/off an LED with a by using magic packet(the code is below). In this context, I would like to hear if it is possible to programme the code so it switches on the LED with one mac adress in the magic packet and switches off the LED with another?

// buffers for receiving and sending datachar packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,char ReplyBuffer[] = "The power is on"; // a string to send backchar ReplyBuffer1[] = "The power is off";

// An EthernetUDP instance to let us send and receive packets over UDPEthernetUDP Udp;

Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); Udp.write(ReplyBuffer); Udp.endPacket(); delay(10);Checking the size of the packet seems a very imprecise way of doing what you want and the flow of the code is odd too.

char ReplyBuffer[] = "The power is on";char ReplyBuffer1[] = "The power is off"

Quote

Checking the size of the packet seems a very imprecise way of doing what you want and the flow of the code is odd too.

Im very new to programming arduino so i just testing out some codes, but if you have a better and smart way to do it then ill be happy if you could help me out

Quote

So, turn on the LED and respond if the packet size is greater than 100 but turn it off again and respond again if it is greater than 115

Yeah but basically i just want it to switch on and off the LED by using either magicpackets or UDP. i would prefer Magicpackets but i haven't found any code for thisAnd instead of the respons i would like to be able to make a request where the arduino respond if the LED is ON or OFF