Skip to content

Don't use easy-connect, use NetworkInterface::get_default_instance() #198

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 1 commit into from
Sep 27, 2018
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
21 changes: 8 additions & 13 deletions tls-client/HelloHttpsClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

#include "HelloHttpsClient.h"

#include "easy-connect.h"

#include "mbedtls/platform.h"
#include "mbedtls/config.h"
#include "mbedtls/ssl.h"
Expand All @@ -33,6 +31,7 @@

#include <stdint.h>
#include <string.h>
#include "mbed.h"

const char *HelloHttpsClient::DRBG_PERSONALIZED_STR =
"Mbed TLS helloword client";
Expand Down Expand Up @@ -232,20 +231,16 @@ int HelloHttpsClient::configureTCPSocket()
{
int ret;

/*
* Use easy-connect lib to support multiple network bearers. See
* https://github.com/ARMmbed/easy-connect README.md for more information.
*/
#if HELLO_HTTPS_CLIENT_DEBUG_LEVEL > 0
NetworkInterface *network = easy_connect(true);
#else
NetworkInterface *network = easy_connect(false);
#endif /* HELLO_HTTPS_CLIENT_DEBUG_LEVEL > 0 */
NetworkInterface *network = NetworkInterface::get_default_instance();
if(network == NULL) {
mbedtls_printf("easy_connect() returned NULL\n"
"Failed to connect to the network\n");
mbedtls_printf("ERROR: No network interface found!\n");
return -1;
}
ret = network->connect();
if (ret != 0) {
mbedtls_printf("Error! network->connect() returned: %d\n", ret);
return ret;
}

if ((ret = socket.open(network)) != NSAPI_ERROR_OK) {
mbedtls_printf("socket.open() returned %d\n", ret);
Expand Down
1 change: 0 additions & 1 deletion tls-client/easy-connect.lib

This file was deleted.