File tree Expand file tree Collapse file tree 4 files changed +44
-4
lines changed Expand file tree Collapse file tree 4 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 3232#include " nsapi_dns.h"
3333#include " events/EventQueue.h"
3434#include " dns_tests.h"
35+ #include " ip6string.h"
3536
3637using namespace utest ::v1;
3738
@@ -165,7 +166,16 @@ static void net_bringup()
165166 net = NetworkInterface::get_default_instance ();
166167 nsapi_error_t err = net->connect ();
167168 TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
168- tr_info (" MBED: IP address is '%s'" , net->get_ip_address () ? net->get_ip_address () : " null" );
169+ const char *address = net->get_ip_address ();
170+
171+ #define MESH 3
172+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
173+ printf (" Waiting for GLOBAL_UP\n " );
174+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
175+ ThisThread::sleep_for (500 );
176+ }
177+ #endif
178+ printf (" MBED: IP address is '%s'\n " , address ? address : " null" );
169179}
170180
171181static void net_bringdown ()
Original file line number Diff line number Diff line change 3131#include " utest.h"
3232#include " utest/utest_stack_trace.h"
3333#include " tcp_tests.h"
34+ #include " ip6string.h"
3435
3536#ifndef ECHO_SERVER_ADDR
3637#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -76,7 +77,16 @@ static void _ifup()
7677 NetworkInterface *net = NetworkInterface::get_default_instance ();
7778 nsapi_error_t err = net->connect ();
7879 TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
79- tr_info (" MBED: TCPClient IP address is '%s'" , net->get_ip_address () ? net->get_ip_address () : " null" );
80+ const char *address = net->get_ip_address ();
81+
82+ #define MESH 3
83+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
84+ printf (" Waiting for GLOBAL_UP\n " );
85+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
86+ ThisThread::sleep_for (500 );
87+ }
88+ #endif
89+ printf (" MBED: TCPClient IP address is '%s'\n " , address ? address : " null" );
8090}
8191
8292static void _ifdown ()
Original file line number Diff line number Diff line change 3232#include " tls_tests.h"
3333#include " cert.h"
3434#include " CellularDevice.h"
35+ #include " ip6string.h"
3536
3637#ifndef ECHO_SERVER_ADDR
3738#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -70,7 +71,16 @@ static void _ifup()
7071 NetworkInterface *net = NetworkInterface::get_default_instance ();
7172 nsapi_error_t err = net->connect ();
7273 TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
73- tr_info (" MBED: TLSClient IP address is '%s'\n " , net->get_ip_address () ? net->get_ip_address () : " null" );
74+ const char *address = net->get_ip_address ();
75+
76+ #define MESH 3
77+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
78+ printf (" Waiting for GLOBAL_UP\n " );
79+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
80+ ThisThread::sleep_for (500 );
81+ }
82+ #endif
83+ printf (" MBED: TLSClient address is '%s'\n " , address ? address : " null" );
7484}
7585
7686static void _ifdown ()
Original file line number Diff line number Diff line change 3131#include " utest.h"
3232#include " utest/utest_stack_trace.h"
3333#include " udp_tests.h"
34+ #include " ip6string.h"
3435
3536#ifndef ECHO_SERVER_ADDR
3637#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -63,7 +64,16 @@ static void _ifup()
6364 NetworkInterface *net = NetworkInterface::get_default_instance ();
6465 nsapi_error_t err = net->connect ();
6566 TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
66- tr_info (" MBED: UDPClient IP address is '%s'" , net->get_ip_address () ? net->get_ip_address () : " null" );
67+ const char *address = net->get_ip_address ();
68+
69+ #define MESH 3
70+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
71+ printf (" Waiting for GLOBAL_UP\n " );
72+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
73+ ThisThread::sleep_for (500 );
74+ }
75+ #endif
76+ printf (" MBED: UDPClient IP address is '%s'\n " , address ? address : " null" );
6777}
6878
6979static void _ifdown ()
You can’t perform that action at this time.
0 commit comments