summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Weiwei <liweiwei@yeweitech.com>2017-09-27 22:04:42 +0800
committerDamien George <damien.p.george@gmail.com>2017-10-05 11:09:07 +1100
commit8c7db42ee3d6e47e4a58e4cb573dc1a30c96fa32 (patch)
tree0ea59435c7fb56221ebef3d60e8521ed3c370ebe
parentff93fd4f50321c6190e1659b19e64fef3045a484 (diff)
stm32/modnwwiznet5k: Get the IP address of an established socket.
When wiznet5k_socket_accept is called, if a socket is established, get the IP address of the socket.
-rw-r--r--ports/stm32/modnwwiznet5k.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ports/stm32/modnwwiznet5k.c b/ports/stm32/modnwwiznet5k.c
index 21e4dbbbf..78249816d 100644
--- a/ports/stm32/modnwwiznet5k.c
+++ b/ports/stm32/modnwwiznet5k.c
@@ -173,11 +173,7 @@ STATIC int wiznet5k_socket_accept(mod_network_socket_obj_t *socket, mod_network_
int sr = getSn_SR((uint8_t)socket->u_param.fileno);
if (sr == SOCK_ESTABLISHED) {
socket2->u_param = socket->u_param;
- // TODO need to populate this with the correct values
- ip[0] = 0;
- ip[1] = 0;
- ip[2] = 0;
- ip[3] = 0;
+ getSn_DIPR((uint8_t)socket2->u_param.fileno, ip);
*port = getSn_PORT(socket2->u_param.fileno);
// WIZnet turns the listening socket into the client socket, so we