Skip to content

Commit b0460c2

Browse files
authored
Merge pull request #177 from paul-szczepanek-arm/development
Fix default interface on DISCO
2 parents 0452ccd + 3a9bf54 commit b0460c2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

mbed_app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"DISCO_L475VG_IOT01A": {
2626
"target.components_add": ["ism43362"],
2727
"ism43362.provide-default": true,
28+
"target.network-default-interface-type": "WIFI",
2829
"target.macros_add" : ["MBEDTLS_SHA1_C"]
2930
},
3031
"K64F": {

source/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "mbed.h"
1818
#include "wifi_helper.h"
19+
#include "mbed-trace/mbed_trace.h"
1920

2021
#if MBED_CONF_APP_USE_TLS_SOCKET
2122
#include "root_ca_cert.h"
@@ -89,7 +90,7 @@ class SocketDemo {
8990
printf("Error: _socket.set_root_ca_cert() returned %d\n", result);
9091
return;
9192
}
92-
_socket.set_hostname("ifconfig.io");
93+
_socket.set_hostname(MBED_CONF_APP_HOSTNAME);
9394
#endif // MBED_CONF_APP_USE_TLS_SOCKET
9495

9596
/* now we have to find where to connect */
@@ -251,7 +252,11 @@ class SocketDemo {
251252
int main() {
252253
printf("\r\nStarting socket demo\r\n\r\n");
253254

254-
SocketDemo *example = new SocketDemo;
255+
#ifdef MBED_CONF_MBED_TRACE_ENABLE
256+
mbed_trace_init();
257+
#endif
258+
259+
SocketDemo *example = new SocketDemo();
255260
MBED_ASSERT(example);
256261
example->run();
257262

0 commit comments

Comments
 (0)