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:
parent
597da2e45d
commit
7c90d9d8b5
@ -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.
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user