Skip to content

Commit cf5adea

Browse files
author
Seppo Takalo
committed
Don't use easy-connet, use NetworkInterface::get_default_instance()
1 parent 714adc8 commit cf5adea

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

tls-client/HelloHttpsClient.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
#include "HelloHttpsClient.h"
2323

24-
#include "easy-connect.h"
25-
2624
#include "mbedtls/platform.h"
2725
#include "mbedtls/config.h"
2826
#include "mbedtls/ssl.h"
@@ -33,6 +31,7 @@
3331

3432
#include <stdint.h>
3533
#include <string.h>
34+
#include "mbed.h"
3635

3736
const char *HelloHttpsClient::DRBG_PERSONALIZED_STR =
3837
"Mbed TLS helloword client";
@@ -232,20 +231,16 @@ int HelloHttpsClient::configureTCPSocket()
232231
{
233232
int ret;
234233

235-
/*
236-
* Use easy-connect lib to support multiple network bearers. See
237-
* https://github.com/ARMmbed/easy-connect README.md for more information.
238-
*/
239-
#if HELLO_HTTPS_CLIENT_DEBUG_LEVEL > 0
240-
NetworkInterface *network = easy_connect(true);
241-
#else
242-
NetworkInterface *network = easy_connect(false);
243-
#endif /* HELLO_HTTPS_CLIENT_DEBUG_LEVEL > 0 */
234+
NetworkInterface *network = NetworkInterface::get_default_instance();
244235
if(network == NULL) {
245-
mbedtls_printf("easy_connect() returned NULL\n"
246-
"Failed to connect to the network\n");
236+
mbedtls_printf("ERROR: No network interface found!\n");
247237
return -1;
248238
}
239+
ret = network->connect();
240+
if (ret != 0) {
241+
printf("Error! network->connect() returned: %d\n", r);
242+
return ret;
243+
}
249244

250245
if ((ret = socket.open(network)) != NSAPI_ERROR_OK) {
251246
mbedtls_printf("socket.open() returned %d\n", ret);

tls-client/easy-connect.lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)