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 32
32
#include " nsapi_dns.h"
33
33
#include " events/EventQueue.h"
34
34
#include " dns_tests.h"
35
+ #include " ip6string.h"
35
36
36
37
using namespace utest ::v1;
37
38
@@ -165,7 +166,16 @@ static void net_bringup()
165
166
net = NetworkInterface::get_default_instance ();
166
167
nsapi_error_t err = net->connect ();
167
168
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" );
169
179
}
170
180
171
181
static void net_bringdown ()
Original file line number Diff line number Diff line change 31
31
#include " utest.h"
32
32
#include " utest/utest_stack_trace.h"
33
33
#include " tcp_tests.h"
34
+ #include " ip6string.h"
34
35
35
36
#ifndef ECHO_SERVER_ADDR
36
37
#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -76,7 +77,16 @@ static void _ifup()
76
77
NetworkInterface *net = NetworkInterface::get_default_instance ();
77
78
nsapi_error_t err = net->connect ();
78
79
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" );
80
90
}
81
91
82
92
static void _ifdown ()
Original file line number Diff line number Diff line change 32
32
#include " tls_tests.h"
33
33
#include " cert.h"
34
34
#include " CellularDevice.h"
35
+ #include " ip6string.h"
35
36
36
37
#ifndef ECHO_SERVER_ADDR
37
38
#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -70,7 +71,16 @@ static void _ifup()
70
71
NetworkInterface *net = NetworkInterface::get_default_instance ();
71
72
nsapi_error_t err = net->connect ();
72
73
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" );
74
84
}
75
85
76
86
static void _ifdown ()
Original file line number Diff line number Diff line change 31
31
#include " utest.h"
32
32
#include " utest/utest_stack_trace.h"
33
33
#include " udp_tests.h"
34
+ #include " ip6string.h"
34
35
35
36
#ifndef ECHO_SERVER_ADDR
36
37
#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -63,7 +64,16 @@ static void _ifup()
63
64
NetworkInterface *net = NetworkInterface::get_default_instance ();
64
65
nsapi_error_t err = net->connect ();
65
66
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" );
67
77
}
68
78
69
79
static void _ifdown ()
You can’t perform that action at this time.
0 commit comments