mirror of https://github.com/ARMmbed/mbed-os.git
Modify multihoming tests to use get_ip_address_if
parent
d5d04ebb90
commit
92e237414e
|
@ -37,6 +37,7 @@
|
|||
#include "utest.h"
|
||||
#include "utest/utest_stack_trace.h"
|
||||
#include "multihoming_tests.h"
|
||||
#include "LWIPStack.h"
|
||||
|
||||
using namespace utest::v1;
|
||||
|
||||
|
@ -77,6 +78,10 @@ static void _ifup()
|
|||
SocketAddress eth_ip_address;
|
||||
eth->get_ip_address(ð_ip_address);
|
||||
printf("MBED: IP address is '%s' interface name %s\n", eth_ip_address.get_ip_address(), interface_name[interface_num]);
|
||||
SocketAddress eth_ip_address_if;
|
||||
LWIP::get_instance().get_ip_address_if(ð_ip_address_if, interface_name[interface_num]);
|
||||
printf("IP_if: %s\n", eth_ip_address.get_ip_address());
|
||||
TEST_ASSERT_EQUAL(eth_ip_address_if, eth_ip_address);
|
||||
interface_num++;
|
||||
|
||||
wifi = WiFiInterface::get_default_instance();
|
||||
|
@ -104,6 +109,10 @@ static void _ifup()
|
|||
SocketAddress wifi_ip_address;
|
||||
wifi->get_ip_address(&wifi_ip_address);
|
||||
printf("IP: %s\n", STRING_VERIFY(wifi_ip_address.get_ip_address()));
|
||||
SocketAddress wifi_ip_address_if;
|
||||
LWIP::get_instance().get_ip_address_if(&wifi_ip_address_if, interface_name[interface_num]);
|
||||
printf("IP_if: %s\n", STRING_VERIFY(wifi_ip_address_if.get_ip_address()));
|
||||
TEST_ASSERT_EQUAL(wifi_ip_address_if, wifi_ip_address);
|
||||
SocketAddress wifi_netmask;
|
||||
wifi->get_netmask(&wifi_netmask);
|
||||
printf("Netmask: %s\n", STRING_VERIFY(wifi_netmask.get_ip_address()));
|
||||
|
|
Loading…
Reference in New Issue