This is WIZnet Ethernet Interface using Hardware TCP/IP chip, W5500, W5200 and W5100. One of them can be selected by enabling it in wiznet.h.
Fork of WIZnet_Library by
Diff: WIZnetInterface/WIZnetInterface.cpp
- Revision:
- 1:8138a268fbd2
- Parent:
- 0:b72d22e10709
- Child:
- 6:ca8405b9564d
diff -r b72d22e10709 -r 8138a268fbd2 WIZnetInterface/WIZnetInterface.cpp --- a/WIZnetInterface/WIZnetInterface.cpp Thu May 08 03:57:58 2014 +0000 +++ b/WIZnetInterface/WIZnetInterface.cpp Fri May 09 01:17:51 2014 +0000 @@ -31,16 +31,22 @@ ip_set = false; } -int WIZnetInterface::init() +int WIZnetInterface::init(uint8_t * mac) { dhcp = true; + // + for (int i =0; i < 6; i++) this->mac[i] = mac[i]; + // reset(); return 0; } -int WIZnetInterface::init(const char* ip, const char* mask, const char* gateway) +int WIZnetInterface::init(uint8_t * mac, const char* ip, const char* mask, const char* gateway) { dhcp = false; + // + for (int i =0; i < 6; i++) this->mac[i] = mac[i]; + // this->ip = str_to_ip(ip); strcpy(ip_string, ip); ip_set = true; @@ -97,7 +103,8 @@ uint8_t mac[6]; reg_rd_mac(SHAR, mac); snprintf(mac_string, sizeof(mac_string), "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - return mac_string; + return mac_string; + } int WIZnetInterface::IPrenew(int timeout_ms)