1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-10-19 21:09:48 +03:00

Backported Ethernet library from 1.5.x

This commit is contained in:
Cristian Maglie
2014-10-17 12:20:30 +02:00
parent 6ecb174c40
commit b9b0fcdadc
22 changed files with 348 additions and 265 deletions

View File

@@ -26,8 +26,8 @@
* bjoern@cs.stanford.edu 12/30/2008
*/
#include "w5100.h"
#include "socket.h"
#include "utility/w5100.h"
#include "utility/socket.h"
#include "Ethernet.h"
#include "Udp.h"
#include "Dns.h"
@@ -41,7 +41,7 @@ uint8_t EthernetUDP::begin(uint16_t port) {
return 0;
for (int i = 0; i < MAX_SOCK_NUM; i++) {
uint8_t s = W5100.readSnSR(i);
uint8_t s = socketStatus(i);
if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT) {
_sock = i;
break;
@@ -120,7 +120,7 @@ int EthernetUDP::parsePacket()
// discard any remaining bytes in the last packet
flush();
if (W5100.getRXReceivedSize(_sock) > 0)
if (recvAvailable(_sock) > 0)
{
//HACK - hand-parse the UDP packet using TCP recv method
uint8_t tmpBuf[8];