no upgrade or change at this. move to new Library for WIZ550io, W5500 -> http://mbed.org/teams/EthernetInterfaceW5500-makers/code/W5500Interface/
Dependents: LPC11U68_NTPClient_HelloWorld_WIZ550io
Fork of WIZ550ioInterface by
please get the new Library for WIZ550io, W5500 (WIZnet) http://mbed.org/teams/EthernetInterfaceW5500-makers/code/W5500Interface/
Import libraryW5500Interface
This is the Interface library for WIZnet W5500 chip which forked of EthernetInterfaceW5500, WIZnetInterface and WIZ550ioInterface. This library has simple name as "W5500Interface". and can be used for Wiz550io users also.
Diff: Socket/UDPSocket.cpp
- Revision:
- 9:615198a7b82b
- Parent:
- 5:fb15c35d1e28
- Child:
- 11:5a5a3f373a6b
--- a/Socket/UDPSocket.cpp Sun Dec 15 12:29:47 2013 +0000 +++ b/Socket/UDPSocket.cpp Mon Dec 23 13:51:35 2013 +0000 @@ -18,6 +18,8 @@ #include "UDPSocket.h" +static int udp_local_port; + UDPSocket::UDPSocket() { } @@ -41,7 +43,12 @@ } } // set local port - eth->sreg<uint16_t>(_sock_fd, Sn_PORT, port); + if (port != 0) { + eth->sreg<uint16_t>(_sock_fd, Sn_PORT, port); + } else { + udp_local_port++; + eth->sreg<uint16_t>(_sock_fd, Sn_PORT, udp_local_port); + } // set udp protocol eth->setProtocol(_sock_fd, UDP); eth->scmd(_sock_fd, OPEN);