Skip to content
This repository was archived by the owner on May 24, 2019. It is now read-only.

Updated cellular connection #76

Merged
merged 2 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions easy-connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ ThreadInterface mesh;
#include "OnboardCellularInterface.h"
OnboardCellularInterface cellular;

#elif MBED_CONF_APP_NETWORK_INTERFACE == CELLULAR
#include "EasyCellularConnection.h"
EasyCellularConnection cellular;

#elif MBED_CONF_APP_NETWORK_INTERFACE == WIFI_WIZFI310
#include "WizFi310Interface.h"
#define EASY_CONNECT_WIFI_TYPE "WizFi310"
Expand Down Expand Up @@ -142,7 +146,7 @@ char* _password = NULL;
*
*/
void print_MAC(NetworkInterface* network_interface, bool log_messages) {
#if MBED_CONF_APP_NETWORK_INTERFACE != CELLULAR_ONBOARD
#if MBED_CONF_APP_NETWORK_INTERFACE != CELLULAR_ONBOARD && MBED_CONF_APP_NETWORK_INTERFACE != CELLULAR
const char *mac_addr = network_interface->get_mac_address();
if (mac_addr == NULL) {
if (log_messages) {
Expand Down Expand Up @@ -211,7 +215,7 @@ NetworkInterface* easy_connect(bool log_messages) {
else {
connect_success = wifi.connect(_ssid, _password, (strlen(_password) > 1) ? NSAPI_SECURITY_WPA_WPA2 : NSAPI_SECURITY_NONE);
}
#elif MBED_CONF_APP_NETWORK_INTERFACE == CELLULAR_ONBOARD
#elif MBED_CONF_APP_NETWORK_INTERFACE == CELLULAR_ONBOARD || MBED_CONF_APP_NETWORK_INTERFACE == CELLULAR
# ifdef MBED_CONF_APP_CELLULAR_SIM_PIN
cellular.set_sim_pin(MBED_CONF_APP_CELLULAR_SIM_PIN);
# endif
Expand Down Expand Up @@ -337,7 +341,7 @@ NetworkInterface* easy_get_netif(bool log_messages) {
}
return &mesh;

#elif MBED_CONF_APP_NETWORK_INTERFACE == CELLULAR_ONBOARD
#elif MBED_CONF_APP_NETWORK_INTERFACE == CELLULAR_ONBOARD || MBED_CONF_APP_NETWORK_INTERFACE == CELLULAR
if (log_messages) {
printf("[EasyConnect] Cellular\n");
}
Expand Down
2 changes: 1 addition & 1 deletion easy-connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define MESH_LOWPAN_ND 101
#define MESH_THREAD 102
#define CELLULAR_ONBOARD 201

#define CELLULAR 202

/* Define supersets for WiFi and Mesh */

Expand Down