Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

μC/IPerf is designed to get the best throughput and no results are displayed in main test task. So, you have to create your own application to query and display test results. However, μC/IPerf comes with a basic reporter application as an example to display standard result before, during and after a run test. This reporter is based on a terminal used, so if you implement a terminal application you can use this reporter directly.

The following example was written to illustrate the capabilities of the μC/IPerf module with the basic reporter. That code is a task which simply initializes μC/IPerf and creates a terminal I/O to queued test and start the basic reporter.

static void App_TaskTerminal (void *p_arg)
{
	CPU_CHAR 		cmd_str[TASK_TERMINAL_CMD_STR_MAX_LEN];
	CPU_INT16S 		cmp_str;
	CPU_SIZE_T 		cmd_len;
	IPERF_TEST_ID 	test_id_iperf;
	IPERF_ERR 		err_iperf;
	
 
	IPerf_Init(&err_iperf); 														(1)
	APP_TEST_FAULT(err_iperf, IPERF_ERR_NONE); 										(2)
	printf("\n\rTerminal I/O\n\r\n\r");
	
	while (DEF_ON) {
		printf("\n\r> ");
		BSP_Ser_RdStr(&cmd_str[0],TASK_TERMINAL_CMD_STR_MAX_LEN);    				(3)
				       
		cmp_str = Str_Cmp_N(&cmd_str[0], "iperf", 5);								(4)					
							 
		cmd_len = Str_Len(&cmd_str[0]);
		if (cmp_str == 0) {
			printf("\n\r\n\r");
			test_id_iperf = IPerf_TestStart( &cmd_str[0], 							(5)
											 &App_OutputFnct,
										      0,
											 &err_iperf);
			if ((err_iperf     == IPERF_ERR_NONE    ) &&
				(test_id_iperf != IPERF_TEST_ID_NONE)) {
				 IPerf_Reporter((IPERF_TEST_ID    ) test_id_iperf, 					(6)
								(IPERF_OUT_FNCT   )&App_OutputFnct,
							    (IPERF_OUT_PARAM *) 0);
				 printf("\n\r");
			}
		} else if (cmd_len > 1u) {
				printf("Command is not recognized.");
		}
	}
}
  • No labels