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/Endpoint.cpp
- Revision:
- 5:fb15c35d1e28
- Parent:
- 1:fb4494783863
--- a/Socket/Endpoint.cpp Thu Dec 20 15:08:58 2012 +0000 +++ b/Socket/Endpoint.cpp Tue Aug 27 12:50:11 2013 +0000 @@ -17,14 +17,8 @@ */ #include "Socket/Socket.h" #include "Socket/Endpoint.h" -#include <cstring> - -using std::memset; Endpoint::Endpoint() { - wifly = Wifly::getInstance(); - if (wifly == NULL) - error("Endpoint constructor error: no wifly instance available!\r\n"); reset_address(); } Endpoint::~Endpoint() {} @@ -36,7 +30,15 @@ int Endpoint::set_address(const char* host, const int port) { //Resolve DNS address or populate hard-coded IP address - wifly->gethostbyname(host, _ipAddress); + WIZ820io* eth = WIZ820io::getInstance(); + if (eth == NULL) { + return -1; + } + uint32_t addr; + if (!eth->gethostbyname(host, &addr)) { + return -1; + } + snprintf(_ipAddress, sizeof(_ipAddress), "%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8)&0xff, addr&0xff); _port = port; return 0; }