1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

updating UDP library and examples with M. Margolis' changes and examples.

This commit is contained in:
Tom Igoe
2010-09-17 14:17:01 +00:00
parent ae0c8770ac
commit addbdd7949
4 changed files with 238 additions and 0 deletions

View File

@ -122,6 +122,13 @@ int UdpClass::readPacket(uint8_t * buf, uint16_t len) {
return recvfrom(_sock,buf,len,ip,port);
}
int UdpClass::readPacket(char * buf, uint16_t bufLen, uint8_t *ip, uint16_t &port) {
uint16_t myPort;
uint16_t ret = readPacket( (byte*)buf, bufLen, ip, &myPort);
port = myPort;
return ret;
}