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.
Dependents: HelloWizFi250Interface
Fork of NetworkSocketAPI by
Diff: NetworkInterface.cpp
- Revision:
- 52:52a6c4ea7128
- Parent:
- 43:09ea32f2eb54
- Child:
- 56:19c9e332c0f1
diff -r f2a088d58051 -r 52a6c4ea7128 NetworkInterface.cpp
--- a/NetworkInterface.cpp Thu Feb 25 04:11:11 2016 -0600
+++ b/NetworkInterface.cpp Thu Feb 25 06:42:40 2016 -0600
@@ -20,17 +20,16 @@
#include <string.h>
NetworkInterface::NetworkInterface()
+ : _dhcp_enabled(true)
{
memset(_ip_address, 0, NS_IP_SIZE);
memset(_network_mask, 0, NS_IP_SIZE);
memset(_gateway, 0, NS_IP_SIZE);
}
-void NetworkInterface::useDHCP()
+void NetworkInterface::setDHCP(bool enabled)
{
- memset(_ip_address, 0, NS_IP_SIZE);
- memset(_network_mask, 0, NS_IP_SIZE);
- memset(_gateway, 0, NS_IP_SIZE);
+ _dhcp_enabled = enabled;
}
void NetworkInterface::setIPAddress(const char *ip)
@@ -48,6 +47,11 @@
strcpy(_gateway, gateway);
}
+bool NetworkInterface::getDHCP()
+{
+ return _dhcp_enabled;
+}
+
const char *NetworkInterface::getIPAddress()
{
if (_ip_address[0]) {
