Skip to content

Fix default interface on DISCO #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 19, 2021
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
1 change: 1 addition & 0 deletions mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"DISCO_L475VG_IOT01A": {
"target.components_add": ["ism43362"],
"ism43362.provide-default": true,
"target.network-default-interface-type": "WIFI",
"target.macros_add" : ["MBEDTLS_SHA1_C"]
},
"K64F": {
Expand Down
9 changes: 7 additions & 2 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "mbed.h"
#include "wifi_helper.h"
#include "mbed-trace/mbed_trace.h"

#if MBED_CONF_APP_USE_TLS_SOCKET
#include "root_ca_cert.h"
Expand Down Expand Up @@ -89,7 +90,7 @@ class SocketDemo {
printf("Error: _socket.set_root_ca_cert() returned %d\n", result);
return;
}
_socket.set_hostname("ifconfig.io");
_socket.set_hostname(MBED_CONF_APP_HOSTNAME);
#endif // MBED_CONF_APP_USE_TLS_SOCKET

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

SocketDemo *example = new SocketDemo;
#ifdef MBED_CONF_MBED_TRACE_ENABLE
mbed_trace_init();
#endif

SocketDemo *example = new SocketDemo();
MBED_ASSERT(example);
example->run();

Expand Down