1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Changing recv() to return signed int16 (in Ethernet socket.cpp). S. Wallace

http://code.google.com/p/arduino/issues/detail?id=516
This commit is contained in:
David A. Mellis 2011-12-08 17:29:28 -05:00
parent 597da2e45d
commit 7c90d9d8b5
2 changed files with 3 additions and 3 deletions

View File

@ -143,10 +143,10 @@ uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len)
*
* @return received data size for success else -1.
*/
uint16_t recv(SOCKET s, uint8_t *buf, uint16_t len)
int16_t recv(SOCKET s, uint8_t *buf, int16_t len)
{
// Check how much data is available
uint16_t ret = W5100.getRXReceivedSize(s);
int16_t ret = W5100.getRXReceivedSize(s);
if ( ret == 0 )
{
// No data available.

View File

@ -9,7 +9,7 @@ extern uint8_t connect(SOCKET s, uint8_t * addr, uint16_t port); // Establish TC
extern void disconnect(SOCKET s); // disconnect the connection
extern uint8_t listen(SOCKET s); // Establish TCP connection (Passive connection)
extern uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len); // Send data (TCP)
extern uint16_t recv(SOCKET s, uint8_t * buf, uint16_t len); // Receive data (TCP)
extern int16_t recv(SOCKET s, uint8_t * buf, int16_t len); // Receive data (TCP)
extern uint16_t peek(SOCKET s, uint8_t *buf);
extern uint16_t sendto(SOCKET s, const uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port); // Send data (UDP/IP RAW)
extern uint16_t recvfrom(SOCKET s, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port); // Receive data (UDP/IP RAW)