/*
* Arduino WakeMyPc
* Ricardo Dias
* http://ricardo-dias.com/
*
* This sketch sends the "magic packet" to wake up
* a PC on Local Area Network when a push-button
* is pressed.
*/
#include <Ethernet.h>
#include <UdpRaw.h>
// ARDUINO CONFIG
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // Arduino MAC
byte ip[] = { 192, 168, 2, 145 }; // Arduino IP
byte gateway[] = { 192, 168, 2, 1 }; // Gateway IP address
int localPort = 8888; //local port to listen on
// THE TARGET
byte targetIp[] = { 192, 168, 2, 114 };
int targetPort = 5456;
byte wolMac[] = { 0x20,0x89,0x84,0x61,0xCA,0x41 }; // The target PC Mac Address
void setup() {
Ethernet.begin(mac,ip,gateway);
UdpRaw.begin(localPort);
// Will run the sendPkt() function when a button wired to
// pin 2 is pressed
attachInterrupt(0, sendPkt, RISING);
}
void loop() {
delay(1);
}
void sendPkt(){
// The 'magic packet' consists of 6 times 0xFF followed by 16 times
// the hardware address (MAC).
byte all[102];
int i,c1,j=0;
for(i = 0; i < 6; i++,j++){
all[j] = 0xFF;
}
for(i = 0; i < 16; i++){
for( c1 = 0; c1 < 6; c1++,j++)
all[j] = wolMac[c1];
}
UdpRaw.sendPacket(all,102,targetIp,targetPort);
}
In file included from C:\Users\Julian\Documents\Arduino\libraries\Ethernet\Dhcp.cpp:4:
C:\Users\Julian\Documents\Arduino\libraries\Ethernet/w5100.h: In static member function ‘static void W5100Class::setSS()’:
C:\Users\Julian\Documents\Arduino\libraries\Ethernet/w5100.h:365: error: ‘cli’ was not declared in this scope
C:\Users\Julian\Documents\Arduino\libraries\Ethernet/w5100.h: In static member function ‘static void W5100Class::resetSS()’:
C:\Users\Julian\Documents\Arduino\libraries\Ethernet/w5100.h:366: error: ‘sei’ was not declared in this scope
Was mache ich falsch?