Skip to content

Commit 9e415df

Browse files
gekyc1728p9
authored andcommitted
Match changes to NSAPI in LWIPInterface
mirrored from: https://developer.mbed.org/teams/NetworkSocketAPI/code/LWIPInterface/
1 parent 4684173 commit 9e415df

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

net/LWIPInterface/LWIPInterface.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ int LWIPInterface::socket_open(void **handle, nsapi_protocol_t proto)
169169

170170
udp_recv(s->udp, udp_recv_irq, s);
171171
*handle = s;
172+
return 0;
172173

173174
case NSAPI_TCP:
174175
s->proto = proto;
@@ -180,6 +181,7 @@ int LWIPInterface::socket_open(void **handle, nsapi_protocol_t proto)
180181
tcp_arg(s->tcp, s);
181182
//tcp_err(s->tcp, tcp_error_irq);
182183
*handle = s;
184+
return 0;
183185
}
184186

185187
return NSAPI_ERROR_DEVICE_ERROR;
@@ -193,6 +195,7 @@ int LWIPInterface::socket_close(void *handle)
193195
switch (s->proto) {
194196
case NSAPI_UDP:
195197
udp_disconnect(s->udp);
198+
udp_remove(s->udp);
196199
break;
197200

198201
case NSAPI_TCP:
@@ -273,11 +276,6 @@ int LWIPInterface::socket_connect(void *handle, const SocketAddress &addr)
273276

274277
return 0;
275278
}
276-
277-
bool LWIPInterface::socket_is_connected(void *handle)
278-
{
279-
return true;
280-
}
281279

282280
int LWIPInterface::socket_accept(void **handle, void *server)
283281
{

net/LWIPInterface/LWIPInterface.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ class LWIPInterface : public NetworkStack, public EthernetInterface
8585
* @return 0 on success, negative on failure
8686
*/
8787
virtual int socket_connect(void *handle, const SocketAddress &address);
88-
89-
/** Check if the socket is connected
90-
* @param handle Socket handle
91-
* @return true if connected, false otherwise
92-
*/
93-
virtual bool socket_is_connected(void *handle);
9488

9589
/** Accept a new connection.
9690
* @param handle Handle in which to store new socket

net/LWIPInterface/eth_arch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* EthernetStack.h */
1+
/* EthernetInterface.h */
22
/* Copyright (C) 2012 mbed.org, MIT License
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software

0 commit comments

Comments
 (0)