Library for ethernet
Dependents: VC0706_FTP_Client_Ethernet_MQTT
Fork of WIZnetInterface by
Diff: EthernetInterface.cpp
- Revision:
- 3:f8c6efc8bf83
- Parent:
- 1:175e7f8374e1
- Child:
- 4:4930f81bbe98
--- a/EthernetInterface.cpp Mon Jun 15 13:33:39 2015 +0900 +++ b/EthernetInterface.cpp Mon Jun 15 12:55:19 2015 +0000 @@ -18,6 +18,18 @@ #include "EthernetInterface.h" #include "DHCPClient.h" +EthernetInterface::EthernetInterface(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset) : + WIZnet_Chip(mosi, miso, sclk, cs, reset) +{ + ip_set = false; +} + +EthernetInterface::EthernetInterface(SPI* spi, PinName cs, PinName reset) : + WIZnet_Chip(spi, cs, reset) +{ + ip_set = false; +} + int EthernetInterface::init(uint8_t * mac) { @@ -42,6 +54,8 @@ this->netmask = str_to_ip(mask); this->gateway = str_to_ip(gateway); reset(); + + if (WIZnet_Chip::setip() == false) return -1; return 0; }