Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of WIZnet_Library by
Diff: WIZnetInterface/WIZnetInterface.cpp
- Revision:
- 1:8138a268fbd2
- Parent:
- 0:b72d22e10709
- Child:
- 6:ca8405b9564d
--- 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)
