I am very new to arduino.
I want to send data using Ethernet MAC address only .
I referred to this previous topic(Ethernet Raw Socket - Networking, Protocols, and Devices - Arduino Forum).
While creating socket it gets stuck at this command "W5100.execCmdSn(s, Sock_OPEN); " which in turn calls --> "while (readSnCR(s));" Here, it is stuck.
I am using Arduino Due. I dont know where i am going wrong. I need some help in resolving this.
#include <SPI.h> // needed for Ethernet library communication with the W5100 (Arduino ver>0018)
#include <Ethernet.h>
#include <utility/w5100.h>
SOCKET s; // our socket that will be opened in RAW mode
byte buf[1500+14]; // buffer to send through socket
int buflen; // length of data to send
void setup() {
// initialize the w5100 chip and open a RAW socket
W5100.init();
W5100.writeSnMR(s, SnMR::MACRAW);
W5100.execCmdSn(s, Sock_OPEN);
}
void loop() {
buflen=60; // we will be sending 'buflen' bytes across the wire
// filling buffer with some data ...
for (int i=0; i<buflen; i++) {
buf*=random(256);*
}
// sending buffer
W5100.send_data_processing(s, buf, buflen);
W5100.execCmdSn(s, Sock_SEND_MAC);
delay(1000);
}