Adding function "sendEthernet" to EtherCard Library

Hello, for my application "man in the midle" I needed to put on ethernet link a fully forged packet . So I add a function (inspiired by sendUdp!) in EtherCard.h static void sendEthernet (char *data,uint16_t len);

in tcpip.cpp: void EtherCard_bis::sendEthernet (char *data,uint16_t datalen) { if (datalen>WAS220+42) datalen = WAS220+42; memcpy(gPB , data, datalen); packetSend(datalen); }

Note: as signaled in another post, I remplaced the constant "22O" by a value acording to buffer size: define WAS220 ENC28J60::bufferSize-42 // Udp payload allowed.

Regards. PO.

previous post was issued from another workshop, so ignore the “_bis”,
here is the correct text:
in tcpip.cpp:
void EtherCard::sendEthernet (char data,uint16_t datalen) {
** if (datalen>WAS220+42)
** datalen = WAS220+42;**
** memcpy(gPB , data, datalen);**
** packetSend(datalen);**

Iapologize for the mismatch!