No more update~~ please use W5500Interface.
Fork of EthernetInterfaceW5500 by
wrote:
NO more update for this library.
Please move to this page W5500Interface for newer version.
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.
This Library for W5500 users. no need to use lwIP(or S/W TCP/IP) Some update & code clean for W5500 only refer from WIZ550ioInterface, WIZnetLibrary and WiflyInterface.
Thanks for ban4jp. This library forks of WIZ550ioInterface.
Diff: Socket/Endpoint.cpp
- Revision:
- 10:cadac6bcd169
- Parent:
- 5:fb15c35d1e28
--- a/Socket/Endpoint.cpp Mon Dec 23 13:51:35 2013 +0000 +++ b/Socket/Endpoint.cpp Thu Jul 17 07:10:36 2014 +0000 @@ -17,21 +17,28 @@ */ #include "Socket/Socket.h" #include "Socket/Endpoint.h" +//#include <cstring> +//#include <cstdio> -Endpoint::Endpoint() { +Endpoint::Endpoint() +{ reset_address(); } Endpoint::~Endpoint() {} -void Endpoint::reset_address(void) { +void Endpoint::reset_address(void) +{ _ipAddress[0] = '\0'; _port = 0; } -int Endpoint::set_address(const char* host, const int port) { +int Endpoint::set_address(const char* host, const int port) +{ //Resolve DNS address or populate hard-coded IP address - WIZ820io* eth = WIZ820io::getInstance(); + // added code for searching instance of WIZnet chip. refer from Wifly Library. + WIZnet_Chip* eth = WIZnet_Chip::getInstance(); if (eth == NULL) { + error("Endpoint constructor error: no WIZnet chip instance available!\r\n"); return -1; } uint32_t addr; @@ -43,10 +50,12 @@ return 0; } -char* Endpoint::get_address() { +char* Endpoint::get_address() +{ return _ipAddress; } -int Endpoint::get_port() { +int Endpoint::get_port() +{ return _port; }