Skip to content

Commit d2b05ba

Browse files
author
Ari Parkkila
authored
Merge pull request #110 from AriParkkila/master
Change default network interface to NetworkInterface
2 parents 72f3fd0 + 52754a2 commit d2b05ba

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ If you like to add more traces or follow the current ones you can turn traces on
7373

7474
```"target_overrides": {
7575
"*": {
76-
"target.features_add": ["LWIP"],
7776
"mbed-trace.enable": true,
7877
```
7978

@@ -98,6 +97,19 @@ Currently supported boards with onboard modem chips are:
9897

9998
## Compiling the application
10099

100+
The master branch is for daily development and it uses the latest mbed-os/master.
101+
102+
To use the latest stable version update to a Mbed OS release tag, for example:
103+
104+
```
105+
mbed releases
106+
* mbed-os-5.10.4
107+
...
108+
mbed update mbed-os-5.10.4
109+
```
110+
111+
You may need to use `--clean` option to discard your local changes (use with caution).
112+
101113
Use Mbed CLI commands to generate a binary for the application. For example, in the case of GCC, use the following command:
102114

103115
```sh

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-os.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/mbed-os/#2fd0c5cfbd83fce62da6308f9d64c0ab64e1f0d6
1+
https://github.com/ARMmbed/mbed-os/

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)