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 28
28
#include " nsapi_dns.h"
29
29
#include " events/EventQueue.h"
30
30
#include " dns_tests.h"
31
+ #include " ip6string.h"
31
32
32
33
using namespace utest ::v1;
33
34
@@ -161,7 +162,16 @@ static void net_bringup()
161
162
net = NetworkInterface::get_default_instance ();
162
163
nsapi_error_t err = net->connect ();
163
164
TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
164
- printf (" MBED: IP address is '%s'\n " , net->get_ip_address () ? net->get_ip_address () : " null" );
165
+ const char *address = net->get_ip_address ();
166
+
167
+ #define MESH 3
168
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
169
+ printf (" Waiting for GLOBAL_UP\n " );
170
+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
171
+ ThisThread::sleep_for (500 );
172
+ }
173
+ #endif
174
+ printf (" MBED: IP address is '%s'\n " , address ? address : " null" );
165
175
}
166
176
167
177
static void net_bringdown ()
Original file line number Diff line number Diff line change 27
27
#include " utest.h"
28
28
#include " utest/utest_stack_trace.h"
29
29
#include " tcp_tests.h"
30
+ #include " ip6string.h"
30
31
31
32
#ifndef ECHO_SERVER_ADDR
32
33
#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -72,7 +73,16 @@ static void _ifup()
72
73
NetworkInterface *net = NetworkInterface::get_default_instance ();
73
74
nsapi_error_t err = net->connect ();
74
75
TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
75
- printf (" MBED: TCPClient IP address is '%s'\n " , net->get_ip_address () ? net->get_ip_address () : " null" );
76
+ const char *address = net->get_ip_address ();
77
+
78
+ #define MESH 3
79
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
80
+ printf (" Waiting for GLOBAL_UP\n " );
81
+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
82
+ ThisThread::sleep_for (500 );
83
+ }
84
+ #endif
85
+ printf (" MBED: TCPClient IP address is '%s'\n " , address ? address : " null" );
76
86
}
77
87
78
88
static void _ifdown ()
Original file line number Diff line number Diff line change 29
29
#include " tls_tests.h"
30
30
#include " cert.h"
31
31
#include " CellularDevice.h"
32
+ #include " ip6string.h"
32
33
33
34
#ifndef ECHO_SERVER_ADDR
34
35
#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -67,7 +68,16 @@ static void _ifup()
67
68
NetworkInterface *net = NetworkInterface::get_default_instance ();
68
69
nsapi_error_t err = net->connect ();
69
70
TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
70
- printf (" MBED: TLSClient IP address is '%s'\n " , net->get_ip_address () ? net->get_ip_address () : " null" );
71
+ const char *address = net->get_ip_address ();
72
+
73
+ #define MESH 3
74
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
75
+ printf (" Waiting for GLOBAL_UP\n " );
76
+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
77
+ ThisThread::sleep_for (500 );
78
+ }
79
+ #endif
80
+ printf (" MBED: TLSClient address is '%s'\n " , address ? address : " null" );
71
81
}
72
82
73
83
static void _ifdown ()
Original file line number Diff line number Diff line change 27
27
#include " utest.h"
28
28
#include " utest/utest_stack_trace.h"
29
29
#include " udp_tests.h"
30
+ #include " ip6string.h"
30
31
31
32
#ifndef ECHO_SERVER_ADDR
32
33
#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -59,7 +60,16 @@ static void _ifup()
59
60
NetworkInterface *net = NetworkInterface::get_default_instance ();
60
61
nsapi_error_t err = net->connect ();
61
62
TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
62
- printf (" MBED: UDPClient IP address is '%s'\n " , net->get_ip_address () ? net->get_ip_address () : " null" );
63
+ const char *address = net->get_ip_address ();
64
+
65
+ #define MESH 3
66
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
67
+ printf (" Waiting for GLOBAL_UP\n " );
68
+ while (net->get_connection_status () != NSAPI_STATUS_GLOBAL_UP) {
69
+ ThisThread::sleep_for (500 );
70
+ }
71
+ #endif
72
+ printf (" MBED: UDPClient IP address is '%s'\n " , address ? address : " null" );
63
73
}
64
74
65
75
static void _ifdown ()
You can’t perform that action at this time.
0 commit comments