mirror of https://github.com/ARMmbed/mbed-os.git
Rely on ARM's and U-Blox's echo servers
Make the server as default. Use the hostnames instead of plain IP addresses.pull/6665/head
parent
2eac96eb04
commit
2f410b0ce2
|
@ -64,7 +64,9 @@ void test_tcp_echo()
|
|||
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
printf("TCP: Connect to %s:%d\r\n", MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
SocketAddress tcp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
SocketAddress tcp_addr;
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
|
||||
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
char ipbuf[60] = {0};
|
||||
|
|
|
@ -132,7 +132,7 @@ void test_tcp_echo_parallel()
|
|||
printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address());
|
||||
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
tcp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR);
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
|
||||
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
|
|
|
@ -149,7 +149,9 @@ void test_tcp_packet_pressure()
|
|||
|
||||
TCPSocket sock;
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
SocketAddress tcp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
SocketAddress tcp_addr;
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
|
||||
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
char ipbuf[60] = {0};
|
||||
|
|
|
@ -282,7 +282,7 @@ void test_tcp_packet_pressure_parallel()
|
|||
printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address());
|
||||
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
tcp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR);
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
|
||||
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
|
|
|
@ -91,7 +91,6 @@ void test_udp_dtls_handshake() {
|
|||
printf("]\r\n");
|
||||
|
||||
UDPSocket sock;
|
||||
SocketAddress udp_addr(ipbuf, port);
|
||||
sock.set_timeout(MBED_CFG_UDP_DTLS_HANDSHAKE_TIMEOUT);
|
||||
|
||||
for (int attempt = 0; attempt < MBED_CFG_UDP_DTLS_HANDSHAKE_RETRIES; attempt++) {
|
||||
|
@ -102,7 +101,8 @@ void test_udp_dtls_handshake() {
|
|||
buffer[i] = udp_dtls_handshake_pattern[i] >> 4;
|
||||
}
|
||||
|
||||
err = sock.sendto(udp_addr, buffer, udp_dtls_handshake_count);
|
||||
err = sock.sendto(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT,
|
||||
buffer, udp_dtls_handshake_count);
|
||||
printf("UDP: tx -> %d\r\n", err);
|
||||
TEST_ASSERT_EQUAL(udp_dtls_handshake_count, err);
|
||||
|
||||
|
|
|
@ -70,7 +70,9 @@ void test_udp_echo() {
|
|||
sock.set_timeout(MBED_CFG_UDP_CLIENT_ECHO_TIMEOUT);
|
||||
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
SocketAddress udp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
SocketAddress udp_addr;
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr);
|
||||
udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
char ipbuf[60] = {0};
|
||||
|
|
|
@ -194,7 +194,7 @@ void test_udp_echo_parallel()
|
|||
printf("UDP client IP Address is %s\n", net->get_ip_address());
|
||||
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
udp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR);
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr);
|
||||
udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
|
|
|
@ -152,7 +152,9 @@ void test_udp_packet_pressure()
|
|||
|
||||
UDPSocket sock;
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
SocketAddress udp_addr(MBED_CONF_APP_ECHO_SERVER_ADDR, MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
SocketAddress udp_addr;
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr);
|
||||
udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
char ipbuf[60] = {0};
|
||||
|
|
|
@ -302,7 +302,7 @@ void test_udp_packet_pressure_parallel()
|
|||
printf("MBED: UDPClient IP address is '%s'\n", net->get_ip_address());
|
||||
|
||||
#if defined(MBED_CONF_APP_ECHO_SERVER_ADDR) && defined(MBED_CONF_APP_ECHO_SERVER_PORT)
|
||||
udp_addr.set_ip_address(MBED_CONF_APP_ECHO_SERVER_ADDR);
|
||||
net->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &udp_addr);
|
||||
udp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
|
||||
#else /* MBED_CONF_APP_ECHO_SERVER_ADDR && MBED_CONF_APP_ECHO_SERVER_PORT */
|
||||
char recv_key[] = "host_port";
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"echo-server-addr" : {
|
||||
"help" : "IP address of echo server",
|
||||
"value" : "\"195.34.89.241\""
|
||||
"value" : "\"echo.mbedcloudtesting.com\""
|
||||
},
|
||||
"echo-server-port" : {
|
||||
"help" : "Port of echo server",
|
||||
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"tcp-echo-prefix" : {
|
||||
"help" : "Some servers send a prefix before echoed message",
|
||||
"value" : "\"u-blox AG TCP/UDP test service\\n\""
|
||||
"value" : null
|
||||
},
|
||||
"tcp-client-echo-buffer-size" : {
|
||||
"help" : "Number of bytes to be send to echo server",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"echo-server-addr" : {
|
||||
"help" : "IP address of echo server",
|
||||
"value" : "\"195.34.89.241\""
|
||||
"value" : "\"echo.mbedcloudtesting.com\""
|
||||
},
|
||||
"echo-server-port" : {
|
||||
"help" : "Port of echo server",
|
||||
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"tcp-echo-prefix" : {
|
||||
"help" : "Some servers send a prefix before echoed message",
|
||||
"value" : "\"u-blox AG TCP/UDP test service\\n\""
|
||||
"value" : null
|
||||
}
|
||||
},
|
||||
"target_overrides": {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"echo-server-addr" : {
|
||||
"help" : "IP address of echo server",
|
||||
"value" : "\"195.34.89.241\""
|
||||
"value" : "\"echo.mbedcloudtesting.com\""
|
||||
},
|
||||
"echo-server-port" : {
|
||||
"help" : "Port of echo server",
|
||||
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"tcp-echo-prefix" : {
|
||||
"help" : "Some servers send a prefix before echoed message",
|
||||
"value" : "\"u-blox AG TCP/UDP test service\\n\""
|
||||
"value" : null
|
||||
},
|
||||
"sim-blockdevice": {
|
||||
"help": "Simulated block device, requires sufficient heap",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"echo-server-addr" : {
|
||||
"help" : "IP address of echo server",
|
||||
"value" : "\"195.34.89.241\""
|
||||
"value" : "\"dragon.u-blox.com\""
|
||||
},
|
||||
"echo-server-port" : {
|
||||
"help" : "Port of echo server",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"echo-server-addr" : {
|
||||
"help" : "IP address of echo server",
|
||||
"value" : "\"195.34.89.241\""
|
||||
"value" : "\"dragon.u-blox.com\""
|
||||
},
|
||||
"echo-server-port" : {
|
||||
"help" : "Port of echo server",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"echo-server-addr" : {
|
||||
"help" : "IP address of echo server",
|
||||
"value" : "\"195.34.89.241\""
|
||||
"value" : "\"echo.mbedcloudtesting.com\""
|
||||
},
|
||||
"echo-server-port" : {
|
||||
"help" : "Port of echo server",
|
||||
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"tcp-echo-prefix" : {
|
||||
"help" : "Some servers send a prefix before echoed message",
|
||||
"value" : "\"Realtek Ameba TCP/UDP test service\\n\""
|
||||
"value" : null
|
||||
},
|
||||
"sim-blockdevice": {
|
||||
"help": "Simulated block device, requires sufficient heap",
|
||||
|
|
Loading…
Reference in New Issue