#if !FEATURE_LWIP #error [NOT_SUPPORTED] LWIP not supported for this target #endif #if DEVICE_EMAC #error [NOT_SUPPORTED] Not supported for WiFi targets #endif #include "mbed.h" #include "EthernetInterface.h" #include "TCPSocket.h" #include "greentea-client/test_env.h" #include "unity/unity.h" #include "utest.h" using namespace utest::v1; #ifndef MBED_CFG_TCP_CLIENT_ECHO_BUFFER_SIZE #define MBED_CFG_TCP_CLIENT_ECHO_BUFFER_SIZE 64 #endif #ifndef MBED_CFG_TCP_CLIENT_ECHO_THREADS #define MBED_CFG_TCP_CLIENT_ECHO_THREADS 3 #endif EthernetInterface net; SocketAddress tcp_addr; Mutex iomutex; void prep_buffer(char *tx_buffer, size_t tx_size) { for (size_t i=0; istart(); } for (int i = 0; i < MBED_CFG_TCP_CLIENT_ECHO_THREADS; i++) { echoers[i]->join(); delete echoers[i]; } net.disconnect(); } // Test setup utest::v1::status_t test_setup(const size_t number_of_cases) { GREENTEA_SETUP(120, "tcp_echo"); return verbose_test_setup_handler(number_of_cases); } Case cases[] = { Case("TCP echo parallel", test_tcp_echo_parallel), }; Specification specification(test_setup, cases); int main() { return !Harness::run(specification); }