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.
Dependencies: MbedJSONValue mbed-http HTS221
Diff: source/network-helper.h
- Branch:
- mbed-os-5.10
- Revision:
- 31:66704f6f17c5
- Parent:
- 30:4825e4f38844
- Child:
- 35:4b847971db1b
--- a/source/network-helper.h	Mon Oct 29 14:34:43 2018 +0800
+++ b/source/network-helper.h	Tue Oct 30 11:07:10 2018 +0800
@@ -2,6 +2,9 @@
 #define _MBED_HTTP_EXAMPLE_H_
 
 #include "mbed.h"
+#ifdef TARGET_SIMULATOR
+#include "EthernetInterface.h"
+#endif
 
 /**
  * Connect to the network using the default networking interface,
@@ -11,7 +14,11 @@
 NetworkInterface *connect_to_default_network_interface() {
     printf("[NWKH] Connecting to network...\n");
 
+#ifdef TARGET_SIMULATOR
+    NetworkInterface* network = new EthernetInterface();
+#else
     NetworkInterface* network = NetworkInterface::get_default_instance();
+#endif
 
     nsapi_error_t connect_status = network->connect();