mbed Connector Interface simplification API on top of mbed-client
Fork of mbedConnectorInterfaceV3 by
NOTE:
This repo has been replaced with https://github.com/ARMmbed/mbedConnectorInterface. No further updates will occur with this repo. Please use the github repo instead. Thanks!
Diff: source/mbedEndpointNetwork.cpp
- Revision:
- 61:d02cd5e2bb26
- Parent:
- 56:3f233795dddf
- Child:
- 63:fc30c31a4d75
diff -r 0d9e607dd678 -r d02cd5e2bb26 source/mbedEndpointNetwork.cpp --- a/source/mbedEndpointNetwork.cpp Tue Aug 09 23:46:16 2016 +0000 +++ b/source/mbedEndpointNetwork.cpp Wed Aug 10 00:13:44 2016 +0000 @@ -31,7 +31,7 @@ // Network Selection #if MBED_CONF_APP_NETWORK_INTERFACE == WIFI - #define NETWORK_TYPE "WIFI" + #define NETWORK_TYPE "WiFi" #include "ESP8266Interface.h" ESP8266Interface network(MBED_CONF_APP_WIFI_TX,MBED_CONF_APP_WIFI_RX); #elif MBED_CONF_APP_NETWORK_INTERFACE == ETHERNET @@ -40,12 +40,10 @@ EthernetInterface network; #elif MBED_CONF_APP_NETWORK_INTERFACE == MESH_LOWPAN_ND #define NETWORK_TYPE "6LowPAN" - #define MESH #include "NanostackInterface.h" LoWPANNDInterface network; #elif MBED_CONF_APP_NETWORK_INTERFACE == MESH_THREAD - #define NETWORK_TYPE "ThreadMesh" - #define MESH + #define NETWORK_TYPE "Thread" #include "NanostackInterface.h" ThreadInterface network; #endif @@ -57,7 +55,7 @@ static void *_endpoint_instance = NULL; // LWIP network instance forward reference -extern void *__network_interface; +extern NetworkInterface *__network_interface; // main loop cycle period static int _main_loop_iteration_wait_ms = MAIN_LOOP_WAIT_TIME_MS; @@ -189,13 +187,14 @@ // check the connection status.. if (connected == 0) { - __network_interface = (void *)&network; + // success + __network_interface = (NetworkInterface *)&network; if (ep != NULL) { ep->isConnected(true); - } - // Debug - logger.log("mbedEndpointNetwork(%s): IP Address: %s",NETWORK_TYPE,network.get_ip_address()); + // Debug + logger.log("mbedEndpointNetwork(%s): IP Address: %s",NETWORK_TYPE,network.get_ip_address()); + } } else { __network_interface = NULL;