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.
Diff: DHCPClient.cpp
- Revision:
- 1:22b9052d864d
- Parent:
- 0:bdeec5f86894
--- a/DHCPClient.cpp Fri Mar 22 11:51:24 2013 +0000
+++ b/DHCPClient.cpp Sun Mar 24 11:25:31 2013 +0000
@@ -1,8 +1,8 @@
// DHCPClient.cpp 2012/4/21
// DHCP Client for WIZ820io(W5200)
#include "mbed.h"
-#include "w5100.h"
-#include "UDPSocket.h"
+#include "w5200.h"
+//#include "UDPSocket.h"
#include "DHCPClient.h"
//#define __DEBUG
#include "dbg/dbg.h"
@@ -33,13 +33,13 @@
xid[2] = t<<8;
xid[3] = t;
memcpy(buf+DHCP_OFFSET_XID, xid, 4);
- W5100.getMACAddress(buf+DHCP_OFFSET_CHADDR);
+ W5200.getMACAddress(buf+DHCP_OFFSET_CHADDR);
const uint8_t options[] = {0x63,0x82,0x53,0x63, // magic cookie
0x35,0x01,0x01, // DHCP DISCOVER
0xff};
memcpy(buf+DHCP_OFFSET_MAGIC_COOKIE, options, sizeof(options));
uint8_t ip[4] = {0,0,0,0};
- W5100.setIPAddress(ip);
+ W5200.setIPAddress(ip);
return DHCP_OFFSET_MAGIC_COOKIE + sizeof(options);
}
@@ -50,7 +50,7 @@
memcpy(buf, headers, sizeof(headers));
memcpy(buf+DHCP_OFFSET_XID, xid, 4);
memcpy(buf+DHCP_OFFSET_YIADDR, yiaddr, 4);
- W5100.getMACAddress(buf+DHCP_OFFSET_CHADDR);
+ W5200.getMACAddress(buf+DHCP_OFFSET_CHADDR);
const uint8_t options[] = {0x63,0x82,0x53,0x63, // magic cookie
0x35,0x01,0x03, // DHCP REQUEST
0x32,0x04,0x00,0x00,0x00,0x00, // request IP