Skip to content

Commit 52754a2

Browse files
author
Ari Parkkila
committed
Changed CellularBase to NetworkInterface
1 parent 2547b86 commit 52754a2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// Number of retries /
2626
#define RETRY_COUNT 3
2727

28-
CellularBase *iface;
28+
NetworkInterface *iface;
2929

3030
// Echo server hostname
3131
const char *host_name = MBED_CONF_APP_ECHO_SERVER_HOSTNAME;
@@ -91,7 +91,7 @@ void dot_event()
9191
{
9292
while (true) {
9393
ThisThread::sleep_for(4000);
94-
if (iface && iface->is_connected()) {
94+
if (iface && iface->get_connection_status() == NSAPI_STATUS_GLOBAL_UP) {
9595
break;
9696
} else {
9797
trace_mutex.lock();
@@ -110,7 +110,7 @@ nsapi_error_t do_connect()
110110
nsapi_error_t retcode = NSAPI_ERROR_OK;
111111
uint8_t retry_counter = 0;
112112

113-
while (!iface->is_connected()) {
113+
while (iface->get_connection_status() != NSAPI_STATUS_GLOBAL_UP) {
114114
retcode = iface->connect();
115115
if (retcode == NSAPI_ERROR_AUTH_FAILURE) {
116116
print_function("\n\nAuthentication Failure. Exiting application\n");
@@ -215,7 +215,7 @@ int main()
215215
#endif // #if MBED_CONF_MBED_TRACE_ENABLE
216216

217217
// sim pin, apn, credentials and possible plmn are taken atuomtically from json when using get_default_instance()
218-
iface = CellularBase::get_default_instance();
218+
iface = NetworkInterface::get_default_instance();
219219
MBED_ASSERT(iface);
220220

221221
nsapi_error_t retcode = NSAPI_ERROR_NO_CONNECTION;

mbed_app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"target_overrides": {
1919
"*": {
20+
"target.network-default-interface-type": "CELLULAR",
2021
"mbed-trace.enable": false,
2122
"lwip.ipv4-enabled": true,
2223
"lwip.ethernet-enabled": false,

0 commit comments

Comments
 (0)