1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-10-18 09:50:40 +03:00

Move Ethernet socket level stuff to utility/socket.cpp

This commit is contained in:
PaulStoffregen
2014-08-01 06:03:38 -07:00
parent abb37e202f
commit 53924e9d58
4 changed files with 19 additions and 5 deletions

View File

@@ -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];