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 »

IPerf Tools

Terminal Reporter on the target

If your target board has a serial interface, you should use the Terminal Reporter. You must create a function which will transmit a string buffer via the serial interface. The NDIT module must be able to use this function to send back the menu or any command errors. Listing 8-1 shows an example.

 

 

Listing 8-1 Terminal reporter output function

L8-1(1) Prevent “variable unused” compiler warning.

L8-1(2) Validate that the pointer to the string is not null.

L8-1(3) Display the string on the serial port of the board. BSP_Ser_WrStr() is a BSP-specific function that outputs each character of the string passed in the parameter until it reaches the NULL character (“\0”). It terminates the string with the Carriage Return symbol (“\r”) followed by the Line Feed symbol (“\n”). The null is not transmitted.

You will also need to implement the task NDIT_TaskTerminal() which performs Terminal I/O. It must be able to:

  • 1 Receive a string from the serial interface.
  • 2 Launch IPerf or other NDIT commands with the string received on the serial interface.
  • Listing 8-2 shows a Terminal I/O task example.

     

     

     

    Listing 8-2 Terminal I/O task

    L8-2(1) Read string command from serial port.

    L8-2(2) The command read from the serial port is processed and executed by the NDIT_ProcessCommand() function.

    L8-2(3) Verify test executed correctly based on the return error from the NDIT_ProcessCommand() function.

    L8-2(4) An error occurred during an IPerf test.

    L8-2(5) An error occurred during a Multicast test.

    L8-2(6) An error occurred during an Interface Start/Stop test.

    L8-2(7) The provided command was neither recognized by the IPerf, Multicast or Interface Start/Stop test modules.

    Note that you must initialize µC/IPerf before using the “Terminal Reporter.”

    Server Reporter on the target

    You can also use the network interface of your device to send commands to the NDIT. This way, if you don't have a Serial Port on your device, you can still send commands and receive results through the NDIT_TaskServer() task and NDIT_NetOutputFnct() display function.

    The source of NDIT_NetOutputFnct() is displayed in Listing 8-3:

     

     

     

    Listing 8-3 NDIT_NetOutputFnct display function

    L8-3(1) Prevent “variable unused” compiler warning.

    L8-3(2) Verify that the pointer is not null.

    L8-3(3) Calculate buffer length.

    L8-3(4) Send the buffer to the test station host using the test station host information found in the DIS_TS_SockInfo global variable.

    Listing 8-4 shows the NDIT_TaskServer() function, which reads the commands from the test station host, processes them, and gives back the results to the test station host.

     

     

     

    Listing 8-4 NDIT_TaskServer() task

    L8-4(1) Structure that contains the test station host socket id, socket address and socket address length.

    L8-4(2) The global variable that hold the necessary information for the NDIT display function to return the test results and information messages to the test station host.

    L8-4(3) Prevent the “variable unused” warning from the compiler.

    L8-4(4) Initialize NDIT Server Address and Port.

    L8-4(5) Open socket for receiving host commands and publish results.

    L8-4(6) An error has occurred during the opening of the socket.

    L8-4(7) Bind the socket to a local port.

    L8-4(8) If binding fails, close the socket.

    L8-4(9) Server reading and command processing loop.

    L8-4(10) Read the incoming command from the test station host.

    L8-4(11) If socket is closed, then exit the while loop and restart connection process.

    L8-4(12) Update remote host socket information for displaying test results and messages to the test station host.

    L8-4(13) Reply to test station for acknowledgement.

    L8-4(14) The command read from the serial port is processed and executed by the NDIT_ProcessCommand() function.

    L8-4(15) Verify test executed correctly based on the return error from the NDIT_ProcessCommand() function.

    L8-4(16) An error occurred during an IPerf test.

    L8-4(17) An error occurred during a Multicast test.

    L8-4(18) An error occurred during an Interface Start/Stop test.

    L8-4(19) The provided command was neither recognized by the IPerf, Multicast or Interface Start/Stop test modules.

    • No labels