
Senses an earthquake with MPU6050 and gets time, coordenates and other details of the event with an Adafruit GPS. All the info is sent to an HTTP server
Dependencies: MPU6050 mbed-http MBed_Adafruit-GPS-Library
Diff: source/network-helper.h
- Revision:
- 35:4b847971db1b
- Parent:
- 31:66704f6f17c5
diff -r 7da6cfc032fc -r 4b847971db1b source/network-helper.h --- a/source/network-helper.h Wed Dec 05 17:16:00 2018 +0900 +++ b/source/network-helper.h Fri Jan 04 13:32:26 2019 +0100 @@ -2,9 +2,7 @@ #define _MBED_HTTP_EXAMPLE_H_ #include "mbed.h" -#ifdef TARGET_SIMULATOR -#include "EthernetInterface.h" -#endif +#include "NetworkInterface.h" /** * Connect to the network using the default networking interface, @@ -14,11 +12,12 @@ 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 + + if (!network) { + printf("[NWKH] No network interface found, select an interface in 'network-helper.h'\n"); + return NULL; + } nsapi_error_t connect_status = network->connect();