void net_test(test_param_t param) { // int i; if (param == 0) { test_printf("Start Network Characterization - SLAVE\n"); #ifdef __ECOS init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); #if 0 // I can see what this is trying to do, but I get "bind: Address already in // use" errors from the 2nd interface - and the parameter is not used // anyway, so one thread does quite well enough (but only tests one i/f at // once). // Comment in the 'int i' above too. for (i = 1; i < CYGHWR_NET_DRIVERS; i++) { cyg_thread_resume(main_thread_handle[i]); // Start other threads } #endif #endif } nc_slave(param); #ifdef CYGDBG_NET_TIMING_STATS show_net_times(); #endif cyg_test_exit(); }
void net_test(cyg_addrword_t param) { cyg_serial_baud_rate_t old; cyg_ppp_options_t options; cyg_ppp_handle_t ppp_handle; CYG_TEST_INIT(); diag_printf("Start TCP test - ECHO mode\n"); init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); #ifdef CYGPKG_SNMPAGENT { extern void cyg_net_snmp_init(void); cyg_net_snmp_init(); } #endif old = ppp_test_set_baud( CYGNUM_SERIAL_BAUD_115200 ); ppp_test_announce( "TCP_ECHO" ); cyg_ppp_options_init( &options ); // options.debug = 1; // options.kdebugflag = 1; // options.flowctl = CYG_PPP_FLOWCTL_SOFTWARE; ppp_handle = cyg_ppp_up( CYGPKG_PPP_TEST_DEVICE, &options ); CYG_TEST_INFO( "Waiting for PPP to come up"); cyg_ppp_wait_up( ppp_handle ); echo_test(param); CYG_TEST_INFO( "Bringing PPP down"); cyg_ppp_down( ppp_handle ); CYG_TEST_INFO( "Waiting for PPP to go down"); cyg_ppp_wait_down( ppp_handle ); cyg_thread_delay( 200 ); ppp_test_set_baud( old ); ppp_test_finish(); CYG_TEST_PASS_FINISH("TCP ECHO test OK"); }
void net_test(cyg_addrword_t param) { diag_printf("Start TCP test - ECHO mode\n"); init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); TNR_INIT(); #ifdef CYGPKG_SNMPAGENT { extern void cyg_net_snmp_init(void); cyg_net_snmp_init(); } #endif echo_test(param); TNR_PRINT_ACTIVITY(); cyg_test_exit(); }
void net_test(void *arg) { test_param_t param = (test_param_t)arg; // int i; if (param == 0) { test_printf("Start Network Characterization - SLAVE\n"); calibrate_load(DESIRED_BACKGROUND_LOAD); } nc_slave(param); #ifdef CYGDBG_NET_TIMING_STATS show_net_times(); #endif #if LWIP_STATS_DISPLAY stats_display(); #endif cyg_test_exit(); }
void net_test(test_param_t param) { #ifdef __ECOS cyg_serial_baud_rate_t old; cyg_ppp_options_t options; cyg_ppp_handle_t ppp_handle; CYG_TEST_INIT(); #endif // int i; if (param == 0) { test_printf("Start Network Characterization - SLAVE\n"); #ifdef __ECOS init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); #if 0 // I can see what this is trying to do, but I get "bind: Address already in // use" errors from the 2nd interface - and the parameter is not used // anyway, so one thread does quite well enough (but only tests one i/f at // once). // Comment in the 'int i' above too. for (i = 1; i < CYGHWR_NET_DRIVERS; i++) { cyg_thread_resume(main_thread_handle[i]); // Start other threads } #endif #endif } #ifdef __ECOS old = ppp_test_set_baud( CYGNUM_SERIAL_BAUD_115200 ); ppp_test_announce( "NC_TEST_SLAVE" ); cyg_ppp_options_init( &options ); // options.debug = 1; // options.kdebugflag = 1; // options.script = script; // options.flowctl = CYG_PPP_FLOWCTL_SOFTWARE; ppp_handle = cyg_ppp_up( CYGPKG_PPP_TEST_DEVICE, &options ); CYG_TEST_INFO( "Waiting for PPP to come up"); cyg_ppp_wait_up( ppp_handle ); #endif nc_slave(param); #ifdef CYGDBG_NET_TIMING_STATS show_net_times(); #endif #ifdef __ECOS CYG_TEST_INFO( "Bringing PPP down"); cyg_ppp_down( ppp_handle ); CYG_TEST_INFO( "Waiting for PPP to go down"); cyg_ppp_wait_down( ppp_handle ); cyg_thread_delay( 200 ); ppp_test_set_baud( old ); ppp_test_finish(); CYG_TEST_PASS_FINISH( "Network Characterization - SLAVE" ); #endif cyg_test_exit(); }