File tree Expand file tree Collapse file tree 4 files changed +49
-4
lines changed Expand file tree Collapse file tree 4 files changed +49
-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,18 @@ 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
+ printf (" MBED: IP address is '%s'\n " , address ? address : " null" );
168
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
169
+ uint8_t addr_hex[16 ];
170
+ stoip6 (address, strlen (address), addr_hex);
171
+ if ((addr_hex[0 ] & 0xe0 ) != 0x20 ) {
172
+ printf (" Adress is not globlal Please check Border Router TEST SKIP \n " );
173
+ GREENTEA_TESTSUITE_RESULT (false );
174
+ }
175
+ #endif
176
+
165
177
}
166
178
167
179
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,17 @@ 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
+ printf (" MBED: TCPClient IP address is '%s'\n " , address ? address : " null" );
79
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
80
+ uint8_t addr_hex[16 ];
81
+ stoip6 (address, strlen (address), addr_hex);
82
+ if ((addr_hex[0 ] & 0xe0 ) != 0x20 ) {
83
+ printf (" Adress is not globlal Please check Border Router TEST SKIP \n " );
84
+ GREENTEA_TESTSUITE_RESULT (false );
85
+ }
86
+ #endif
76
87
}
77
88
78
89
static void _ifdown ()
Original file line number Diff line number Diff line change 28
28
#include " utest/utest_stack_trace.h"
29
29
#include " tls_tests.h"
30
30
#include " cert.h"
31
+ #include " ip6string.h"
31
32
32
33
#ifndef ECHO_SERVER_ADDR
33
34
#error [NOT_SUPPORTED] Requires parameters for echo server
@@ -66,7 +67,17 @@ static void _ifup()
66
67
NetworkInterface *net = NetworkInterface::get_default_instance ();
67
68
nsapi_error_t err = net->connect ();
68
69
TEST_ASSERT_EQUAL (NSAPI_ERROR_OK, err);
69
- printf (" MBED: TLSClient IP address is '%s'\n " , net->get_ip_address () ? net->get_ip_address () : " null" );
70
+ const char *address = net->get_ip_address ();
71
+
72
+ printf (" MBED: TLSClient IP address is '%s'\n " , address ? address : " null" );
73
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
74
+ uint8_t addr_hex[16 ];
75
+ stoip6 (address, strlen (address), addr_hex);
76
+ if ((addr_hex[0 ] & 0xe0 ) != 0x20 ) {
77
+ printf (" Adress is not globlal Please check Border Router TEST SKIP \n " );
78
+ GREENTEA_TESTSUITE_RESULT (false );
79
+ }
80
+ #endif
70
81
}
71
82
72
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,17 @@ 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
+ printf (" MBED: UDPClient IP address is '%s'\n " , address ? address : " null" );
66
+ #if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == MESH
67
+ uint8_t addr_hex[16 ];
68
+ stoip6 (address, strlen (address), addr_hex);
69
+ if ((addr_hex[0 ] & 0xe0 ) != 0x20 ) {
70
+ printf (" Adress is not globlal Please check Border Router TEST SKIP \n " );
71
+ GREENTEA_TESTSUITE_RESULT (false );
72
+ }
73
+ #endif
63
74
}
64
75
65
76
static void _ifdown ()
You can’t perform that action at this time.
0 commit comments