Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor10038011003801 IPerf Tools

1003802
Anchor
1003802
Table of Contents

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 The listing below shows an example.anchor

Code Block

...

language

...

cpp

...

table /* *

*                                           NDIT_OutputFnct()
* * Description : Output a string on the display. * *

*
* Description : Output a string on the display.
*
* Argument(s) : p_buf       Pointer to buffer to output.
* * p_param Pointer to IPerf output parameters. (unused) * * Return(s) : none. * * Caller(s) : various. * * Note(s) : (1) The string pointed to by p_buf has to be NUL

*
*               p_param     Pointer to IPerf output parameters. (unused)
*
* Return(s)   : none.
*
* Caller(s)   : various.
*
* Note(s)     : (1) The string pointed to by p_buf has to be NUL ('\0') terminated.

***********************************************************************************************

*/
#if

#if (NDIT_COM == NDIT_SERIAL_COM)
void

void  NDIT_OutputFnct (CPU_CHAR         *p_buf,

                       IPERF_OUT_PARAM  *p_param)
{

{
   (void)&p_param;
(1) if
                                                                         (1)
  
    if (p_buf == (CPU_CHAR *)0) {
(2) return; }
                                                          (2)
        return;
    }
    APP_TRACE_INFO((p_buf));
(3) } #endif
firstline
1005998
Anchor
10060001006000
1
summarytitle
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan30
Anchor
1005998
Listing - Terminal reporter output function
linenumberstrue
/*
***********************************************************************************************
*
Anchor
10060021006002
Anchor
10060041006004
Anchor
10060061006006
Anchor
10060081006008
Anchor
10060101006010
Anchor
10060121006012
Anchor
10060141006014
Anchor
10060161006016
Anchor
10060181006018
Anchor
10060201006020
Anchor
10060221006022
Anchor
10060241006024
Anchor
10060261006026
Anchor
10060281006028
Anchor
10060301006030
Anchor
10060321006032
Anchor
10060341006034
Anchor
10060361006036
Anchor
10060381006038
Anchor
10060401006040
Anchor
10060991006099
Anchor
10061001006100
Anchor
10061011006101
Anchor
10060481006048
Anchor
10060941006094
Anchor
10060951006095
Anchor
10060561006056
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)

...

                                                               (3)
}
#endif



Panel
bgColor#f0f0f0

(1)  Prevent “variable unused” compiler warning.

...

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

...

(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. Anchor10038441003844Receive a string from the serial interface.anchor
  2. 10038451003845Launch IPerf or other NDIT commands with the string received on the serial interface.

Anchor10038461003846 Listing 8-2 The listing below shows a Terminal I/O task example.anchor

Code Block

...

language

...

cpp

...

table /* *

*                                           NDIT_TaskTerminal()
* * Description : Task that reads the serial port input, processes the commands and verifies * that the cmd has been correctly executed. * * Argument(s) : p_arg Pointer to task input parameter (unused). * * Return(s) : none. * * Caller(s) : AppTaskCreateTerminal(). * * Note(s) : none.

*
* Description : Task that reads the serial port input, processes the commands and verifies 
*               that the cmd has been correctly executed.
*
* Argument(s) : p_arg           Pointer to task input parameter (unused). 
*
* Return(s)   : none.
*
* Caller(s)   : AppTaskCreateTerminal().
*
* Note(s)     : none.
**********************************************************************************************

*/
#if

#if (NDIT_COM == NDIT_SERIAL_COM)
void

void  NDIT_TaskTerminal (void  *p_arg)
{

{
    CPU_CHAR       cmd_str[TASK_TERMINAL_CMD_STR_MAX_LEN];

    CPU_SIZE_T     cmd_len;

    NDIT_ERR
err; #if
       err;
    
#if (IPERF_REPORTER == DEF_ENABLED)

    APP_TRACE_INFO(("\r\nTerminal I/O\r\n\r\n"));
while

    while (DEF_ON)
{
 {
        APP_TRACE(("\r\n>  "));

        BSP_Ser_RdStr((CPU_CHAR *)&cmd_str[0],
(1)
                                                (1)
                      (CPU_INT16U) TASK_TERMINAL_CMD_STR_MAX_LEN);

        cmd_len = Str_Len(&cmd_str[0]);

        
        NDIT_ProcessCommand((CPU_CHAR
*)
     *)&cmd_str[0],
(2)
                                      (2)
                            (CPU_INT16U    ) cmd_len,

                            (NDIT_OUT_FNCT )&NDIT_Output,

                            (IPERF_OUT_FNCT)&NDIT_OutputFnct,
(NDIT_ERR

                            (NDIT_ERR     *)&err);
 

        switch(err)
{ (3) case NDIT_NO_ERR: case NDIT_ERR_NO_CMD: break; case NDIT_ERR_IPERF: (4) NDIT_Output(("Error in IPerf
 {                                                                         (3)
            case NDIT_NO_ERR:
            case NDIT_ERR_NO_CMD:  
                break;
            case NDIT_ERR_IPERF:                                                              (4)
                NDIT_Output(("Error in IPerf Test\r\n\r\n"));
break; case NDIT_ERR_MCAST: (5) NDIT_Output(("Error in Mcast Test\r\n\r\n")); break; case NDIT_ERR_IFSS: (6)

                break;
            case NDIT_ERR_MCAST:                                                              (5)
                NDIT_Output(("Error in
IFSS
 Mcast Test\r\n\r\n"));
break; case

                break;
            case NDIT_ERR_
NO_MATCH: (7) NDIT_Output(("Command not recognized\r\
IFSS:                                                               (6)
                NDIT_Output(("Error in IFSS Test\r\n\r\n"));
break; } } #endif } #endif
firstline
1006335
Anchor
10063361006336
1
summarytitle
classCode_Listing
Table Row (tr)
Table Cell (td)
Anchor
1006335
Listing - Terminal I/O task
linenumberstrue
/*
**********************************************************************************************
*
Anchor
10063371006337
Anchor
10063381006338
Anchor
10063391006339
Anchor
10063401006340
Anchor
10063411006341
Anchor
10063421006342
Anchor
10063431006343
Anchor
10063441006344
Anchor
10063451006345
Anchor
10063461006346
Anchor
10063471006347
Anchor
10063481006348
Anchor
10063491006349
Anchor
10063501006350
Anchor
10063511006351
Anchor
10063521006352
Anchor
10063531006353
Anchor
10063541006354
Anchor
10063551006355
Anchor
10063561006356
Anchor
10063571006357
Anchor
10063581006358
Anchor
10063591006359
Anchor
10063601006360
Anchor
10063611006361
Anchor
10063621006362
Anchor
10063631006363
Table Row (tr)
Table Cell (td)
rowspan62
Anchor
10292401029240
Anchor
10292411029241
Anchor
10292421029242
Anchor
10292431029243
Anchor
10292441029244
Anchor
10292451029245
Anchor
10292461029246
Anchor
10064241006424
Anchor
10292571029257
Anchor
10062121006212
Anchor
10062141006214
Anchor
10062161006216
Anchor
10062181006218
Anchor
10062201006220
Anchor
10062221006222
Anchor
10062241006224
Anchor
10062261006226
Anchor
10062281006228
Anchor
10062301006230
Anchor
10062321006232
Anchor
10062341006234
Anchor
10062361006236
Anchor
10062381006238
Anchor
10062401006240
Anchor
10062421006242
Anchor
10062441006244
Anchor
10062461006246
Anchor
10062481006248
Anchor
10062501006250
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)

...

/*

                break;
            case NDIT_ERR_NO_MATCH:                                                           (7)
                NDIT_Output(("Command not recognized\r\n\r\n"));
                break;    
        }
    }
#endif 
}
#endif
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
Anchor
10065931006593
Anchor
10065941006594


Panel
bgColor#f0f0f0

(1) Read string command from serial port.

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

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

(4) An error occurred during an IPerf test.

(5) An error occurred during a Multicast test.

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

(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 the listing below:

*

*/
#if (NDIT_COM == NDIT_NETWORK_COM)
void  NDIT_NetOutputFnct
() * * Description : Outputs a string to the test host application. * * Argument(s) : p_buf Pointer to buffer to output. * * p_param Pointer to IPERF_OUT_PARAM object. * * Return(s) : none. * * Caller(s) : various. * * Note(s) : (1) The string pointed to by p_buf has to be NUL ('\0') terminated. ********************************************************************************************** */ #if (NDIT_COM == NDIT_NETWORK_COM) void NDIT_NetOutputFnct (CPU_CHAR *p_buf, IPERF_OUT_PARAM *p_param) { CPU_INT16U tx_len; NET_ERR net_err; (void)&p_param; (1) if (p_buf == (CPU_CHAR *)0) { (2) return; }   if (NDIT_TS_SockInfo.NetSockID != NET_SOCK_BSD_ERR_OPEN) { tx_len = (CPU_INT16U)Str_Len(p_buf); (3) (void)NetApp_SockTx ((NET_SOCK_ID ) NDIT_TS_SockInfo.NetSockID, (4) (void *) p_buf, (CPU_INT16U ) tx_len, (CPU_INT16S ) NET_SOCK_FLAG_NONE, (NET_SOCK_ADDR *)&NDIT_TS_SockInfo.NetSockAddr,
 (CPU_CHAR         *p_buf,
                          IPERF_OUT_PARAM  *p_param)
{
    CPU_INT16U  tx_len;
    NET_ERR     net_err;
  
   (void)&p_param;                                                                        (1)
   
    if (p_buf == (CPU_CHAR *)0) {                                                         (2)
        return;
    }
    if (NDIT_TS_SockInfo.NetSockID != NET_SOCK_BSD_ERR_OPEN) {
        
        tx_len = (CPU_INT16U)Str_Len(p_buf);                                              (3)
        
        (void)NetApp_SockTx ((NET_SOCK_ID      ) NDIT_TS_SockInfo.NetSockID,              (4)
                             (void            *) p_buf,
                             (CPU_INT16U       ) tx_len,
                             (CPU_INT16S       ) NET_SOCK_FLAG_NONE,
                             (NET_SOCK_ADDR   *)&NDIT_TS_SockInfo.NetSockAddr,
                             (NET_SOCK_ADDR_LEN) NDIT_TS_SockInfo.NetSockAddrLen,
(CPU_INT16U ) NDIT_SERVER_RETRY_MAX, (CPU_INT32U ) NDIT_SERVER_DELAY_MS, (CPU_INT32U )

                             (CPU_INT16U       ) NDIT_SERVER_RETRY_MAX,
                             (CPU_INT32U       ) NDIT_SERVER_DELAY_MS,
(NET_ERR *)&net_err); } } } #endif
Code Block
languagecpp
firstline1
titleListing - NDIT_NetOutputFnct display function
linenumberstrue
/*
**********************************************************************************************
*                                           NDIT_NetOutputFnct()
*
* Description : Outputs a string to the test host application.
*
* Argument(s) : p_buf       Pointer to buffer to output.
*
*               p_param     Pointer to IPERF_OUT_PARAM object.
*
* Return(s)   : none.
*
* Caller(s)   : various.
*
* Note(s)     : (1) The string pointed to by p_buf has to be NUL ('\0') terminated.
**********************************************************************************************
******
Anchor
10065951006595
Anchor
10065961006596
Anchor
10065971006597
Anchor
10065981006598
Anchor
10065991006599
Anchor
10066001006600
Anchor
10066011006601
Anchor
10066021006602
Anchor
10066031006603
Anchor
10066041006604
Anchor
10066051006605
Anchor
10066061006606
Anchor
10066071006607
Anchor
10066081006608
Anchor
10066091006609
Anchor
10066101006610
Anchor
10066111006611
Anchor
10066121006612
Anchor
10066131006613
Anchor
10066141006614
Anchor
10066151006615
Anchor
10066161006616
Anchor
10066171006617
Table Row (tr)
Table Cell (td)
rowspan48
Anchor
10292681029268
Anchor
10292691029269
Anchor
10292701029270
Anchor
10292711029271
Anchor
10064961006496
Anchor
10292821029282
Anchor
10064981006498
Anchor
10065001006500
Anchor
10065021006502
Anchor
10065041006504
Anchor
10065061006506
Anchor
10065081006508
Anchor
10065101006510
Anchor
10065121006512
Anchor
10065141006514
Anchor
10065161006516
Anchor
10065181006518
Anchor
10065201006520
Anchor
10065221006522
Anchor
10065241006524
Anchor
10065261006526
Anchor
10065281006528
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)

...

typedef struct host_sock_info { (1) NET_SOCK_ID NetSockID; NET_SOCK_ADDR NetSockAddr; NET_SOCK_ADDR_LEN NetSockAddrLen; } HOST_SOCK_INFO; static HOST_SOCK_INFO NDIT_TS_SockInfo; (2) /*

                             (CPU_INT32U       ) NDIT_SERVER_DELAY_MS,
                             (NET_ERR         *)&net_err);    }
    }
}
#endif
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
Anchor
10071191007119
Anchor
10071201007120
Anchor
10071211007121
Anchor
10071221007122
Anchor
10071231007123
Anchor
10071241007124
Anchor
10116481011648
Anchor
10116491011649


Panel
bgColor#f0f0f0

(1)  Prevent “variable unused” compiler warning.

(2) Verify that the pointer is not null.

(3) Calculate buffer length.

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


The listing below 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.

*

*                                              NDIT_TaskServer()
* * Description: This function creates a input/output ethernet communication link to use iPerf. * * Argument(s) : p_arg Pointer to arg. (unused) * * Return(s) : none. * * Caller(s) : NDIT_TaskCreateServer(). * * Note(s) : (1) NDIT_COM must be defined to NDIT_NETWORK_COM in app_cfg.h for this function to be used. *

*
* Description:  This function creates a input/output ethernet communication link to use iPerf.
*
* Argument(s) : p_arg       Pointer to arg. (unused)
*
* Return(s)   : none.
*
* Caller(s)   : NDIT_TaskCreateServer().
*
* Note(s)     : (1) NDIT_COM must be defined to NDIT_NETWORK_COM in app_cfg.h for this function to be used.
*
**********************************************************************************************

*/
#if

#if (NDIT_COM == NDIT_NETWORK_COM)
void

void  NDIT_TaskServer (void  *p_arg)
{

{
    NET_SOCK_ID        net_sock_id;

    NET_SOCK_ADDR_IP   server_addr_port;

    NET_SOCK_ADDR      client_addr_port;

    NET_SOCK_ADDR_LEN  client_addr_port_len;

    CPU_CHAR           buf[TASK_TERMINAL_CMD_STR_MAX_LEN];

    CPU_INT16S         rx_len;

    CPU_BOOLEAN        socket_connected;

    NET_ERR            net_err;

    NDIT_ERR           test_err;

    
    (void)&p_arg;
(3)  
                                                                           (3)
    Mem_Clr((void     *)&server_addr_port,
(4) (
                                                  (4)
            (CPU_SIZE_T) sizeof(server_addr_port));

    
    server_addr_port.AddrFamily = NET_SOCK_ADDR_FAMILY_IP_V4;

    server_addr_port.Port       = NET_UTIL_HOST_TO_NET_16(NDIT_PORT);

    server_addr_port.Addr       = NET_SOCK_ADDR_IP_WILDCARD;
while

    while (DEF_TRUE){

        socket_connected = DEF_YES;

        
        net_sock_id = NetApp_SockOpen((NET_SOCK_PROTOCOL_FAMILY) NET_SOCK_FAMILY_IP_V4,
(5) (NET_SOCK_TYPE ) NET_SOCK_TYPE_DATAGRAM, (NET_SOCK_PROTOCOL ) NET_SOCK_PROTOCOL_UDP, (CPU_INT16U ) NDIT_SERVER_RETRY_MAX, (CPU_INT32U ) NDIT_SERVER_DELAY_MS, (NET_ERR *)&net_err); if (net_err != NET_APP_ERR_NONE) { APP_TRACE_INFO(("\r\nFail to open socket.\r\n\r\n")); (6) socket_connected = DEF_NO; } else { (void)NetApp_SockBind((NET_SOCK_ID ) net_sock_id, (7) (NET_SOCK_ADDR *)&server_addr_port, (NET_SOCK_ADDR_LEN) NET_SOCK_ADDR_SIZE, (CPU_INT16U ) NDIT_SERVER_RETRY_MAX, (CPU_INT32U ) NDIT_SERVER_DELAY_MS, (NET_ERR *)&net_err); if (net_err != NET_APP_ERR_NONE) { (void)NetApp_SockClose((NET_SOCK_ID) net_sock_id, (8) (CPU_INT32U ) 0u, (NET_ERR *)&net_err); socket_connected = DEF_NO; } }   while(socket_connected == DEF_YES) { (9) rx_len = NetApp_SockRx ((NET_SOCK_ID ) net_sock_id, (10) (void *)&buf[0], (CPU_INT16U ) TASK_TERMINAL_CMD_STR_MAX_LEN, (CPU_INT16U ) 0, (CPU_INT16S ) NET_SOCK_FLAG_NONE, (NET_SOCK_ADDR *)&client_addr_port, (NET_SOCK_ADDR_LEN *)&client_addr_port_len, (CPU_INT16U ) 1, (CPU_INT32U ) 0, (CPU_INT32U ) 0, (NET_ERR *)&net_err); switch (net_err) { case NET_APP_ERR_CONN_CLOSED: (11) socket_connected = DEF_NO; break; case NET_APP_ERR_NONE: default: break; } NDIT_TS_SockInfo.NetSockID = net_sock_id; (12) NDIT_TS_SockInfo.NetSockAddr = client_addr_port; NDIT_TS_SockInfo.NetSockAddrLen = client_addr_port_len; buf[rx_len] = '\0'; NDIT_NetOutput(&buf[0]); (13) NDIT_NetOutput(NEW_LINE); NDIT_ProcessCommand((CPU_CHAR *)&buf[0], (14) (CPU_INT16U ) rx_len, (NDIT_OUT_FNCT )&NDIT_NetOutput, (IPERF_OUT_FNCT)&NDIT_NetOutputFnct, (NDIT_ERR *)&test_err); switch(test_err) { (15) case NDIT_NO_ERR: case NDIT_ERR_NO_CMD: break; case NDIT_ERR_IPERF: NDIT_NetOutput("\r\nError in IPerf Test\r\n\r\n"); (16) break; case NDIT_ERR_MCAST: NDIT_NetOutput("\r\nError in Mcast Test\r\n\r\n"); (17) break; case NDIT_ERR_IFSS: NDIT_NetOutput("\r\nError in IFSS Test\r\n\r\n"); (18) break; case NDIT_ERR_NO_MATCH: default: NDIT_NetOutput("\r\nCommand not recognized\r\n\r\n"); (19) break; } NDIT_Delay (0, 0, 0, 100); } } } #endif
Code Block
languagecpp
firstline1
titleListing - NDIT_TaskServer() task
linenumberstrue
typedef  struct  host_sock_info {                                                           (1)
    NET_SOCK_ID        NetSockID;
    NET_SOCK_ADDR      NetSockAddr;
    NET_SOCK_ADDR_LEN  NetSockAddrLen;
} HOST_SOCK_INFO;
static  HOST_SOCK_INFO    NDIT_TS_SockInfo;                                                 (2)
/*
**********************************************************************************************
Anchor
10116501011650
Anchor
10071281007128
Anchor
10071291007129
Anchor
10071301007130
Anchor
10071311007131
Anchor
10071321007132
Anchor
10071331007133
Anchor
10071341007134
Anchor
10071351007135
Anchor
10071361007136
Anchor
10071371007137
Anchor
10071381007138
Anchor
10071391007139
Anchor
10071401007140
Anchor
10071411007141
Anchor
10071421007142
Anchor
10071431007143
Anchor
10071441007144
Anchor
10071451007145
Anchor
10071461007146
Anchor
10071471007147
Anchor
10071481007148
Anchor
10071491007149
Anchor
10071501007150
Anchor
10071511007151
Anchor
10071521007152
Anchor
10071531007153
Anchor
10071541007154
Anchor
10116661011666
Anchor
10116721011672
Anchor
10116731011673
Anchor
10116741011674
Anchor
10116751011675
Anchor
10116761011676
Anchor
10116771011677
Table Row (tr)
Table Cell (td)
Anchor
10071801007180
Anchor
10071811007181
Anchor
10071821007182
Anchor
10071831007183
Anchor
10071841007184
Anchor
10071851007185
Anchor
10071861007186
Anchor
10071871007187
Anchor
10071881007188
Anchor
10071891007189
Anchor
10071901007190
Anchor
10071911007191
Anchor
10071921007192
Anchor
10071931007193
Anchor
10071941007194
Anchor
10071951007195
Anchor
10071961007196
Anchor
10071971007197
Anchor
10071981007198
Anchor
10071991007199
Anchor
10072001007200
Anchor
10072011007201
Anchor
10072021007202
Anchor
10072031007203
Anchor
10072041007204
Anchor
10072051007205
Anchor
10072061007206
Anchor
10072071007207
Anchor
10072081007208
Anchor
10072091007209
Anchor
10072101007210
Anchor
10116951011695
Anchor
10117011011701
Anchor
10117021011702
Anchor
10117031011703
Anchor
10117041011704
Anchor
10117051011705
Anchor
10117061011706
Anchor
10117071011707
Anchor
10117081011708
Anchor
10117091011709
Anchor
10117101011710
Anchor
10117111011711
Anchor
10117121011712
Anchor
10117131011713
Table Row (tr)
Table Cell (td)
rowspan142
Anchor
10072411007241
Anchor
10072421007242
Anchor
10072431007243
Anchor
10072441007244
Anchor
10072451007245
Anchor
10072461007246
Anchor
10072471007247
Anchor
10072481007248
Anchor
10072491007249
Anchor
10072501007250
Anchor
10072511007251
Anchor
10072521007252
Anchor
10072531007253
Anchor
10072541007254
Anchor
10072551007255
Anchor
10072561007256
Anchor
10072571007257
Anchor
10072581007258
Anchor
10072591007259
Anchor
10072601007260
Anchor
10072611007261
Anchor
10072621007262
Anchor
10069151006915
Anchor
10069171006917
Anchor
10069191006919
Anchor
10069211006921
Anchor
10069231006923
Anchor
10115241011524
Anchor
10115251011525
Anchor
10115201011520
Anchor
10115211011521
Anchor
10069331006933
Anchor
10069351006935
Anchor
10069371006937
Anchor
10069391006939
Anchor
10069411006941
Anchor
10069431006943
Anchor
10069451006945
Anchor
10069471006947
Anchor
10069491006949
Anchor
10069511006951
Anchor
10069531006953
Anchor
10069551006955
Anchor
10069571006957
Anchor
10069591006959
Anchor
10069611006961
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)

...

     (5)
                                      (NET_SOCK_TYPE           ) NET_SOCK_TYPE_DATAGRAM,
                                      (NET_SOCK_PROTOCOL       ) NET_SOCK_PROTOCOL_UDP,
                                      (CPU_INT16U              ) NDIT_SERVER_RETRY_MAX,
                                      (CPU_INT32U              ) NDIT_SERVER_DELAY_MS,
                                      (NET_ERR                *)&net_err);
        
        if (net_err != NET_APP_ERR_NONE) {
            APP_TRACE_INFO(("\r\nFail to open socket.\r\n\r\n"));                           (6)
            socket_connected = DEF_NO;
        } else {
            
            (void)NetApp_SockBind((NET_SOCK_ID      ) net_sock_id,                          (7)
                                  (NET_SOCK_ADDR   *)&server_addr_port,
                                  (NET_SOCK_ADDR_LEN) NET_SOCK_ADDR_SIZE,
                                  (CPU_INT16U       ) NDIT_SERVER_RETRY_MAX,
                                  (CPU_INT32U       ) NDIT_SERVER_DELAY_MS,
                                  (NET_ERR         *)&net_err);
            
            if (net_err != NET_APP_ERR_NONE) {
                                                                
                (void)NetApp_SockClose((NET_SOCK_ID) net_sock_id,                           (8)
                                       (CPU_INT32U ) 0u,
                                       (NET_ERR   *)&net_err);
                 
                 socket_connected = DEF_NO; 
            }
        }
        while(socket_connected == DEF_YES) {                                                (9)
            
            rx_len = NetApp_SockRx ((NET_SOCK_ID        ) net_sock_id,                     (10)
                                    (void              *)&buf[0],
                                    (CPU_INT16U         ) TASK_TERMINAL_CMD_STR_MAX_LEN,
                                    (CPU_INT16U         ) 0,
                                    (CPU_INT16S         ) NET_SOCK_FLAG_NONE,
                                    (NET_SOCK_ADDR     *)&client_addr_port,
                                    (NET_SOCK_ADDR_LEN *)&client_addr_port_len,
                                    (CPU_INT16U         ) 1,
                                    (CPU_INT32U         ) 0,
                                    (CPU_INT32U         ) 0,
                                    (NET_ERR           *)&net_err);
            switch (net_err) {
                case NET_APP_ERR_CONN_CLOSED:                                              (11)
                    socket_connected = DEF_NO; 
                    break;
                case NET_APP_ERR_NONE: 
                default:
                    break;
            }
            
            NDIT_TS_SockInfo.NetSockID      = net_sock_id;                                 (12)
            NDIT_TS_SockInfo.NetSockAddr    = client_addr_port; 
            NDIT_TS_SockInfo.NetSockAddrLen = client_addr_port_len;
            
            buf[rx_len] = '\0'; 
            NDIT_NetOutput(&buf[0]);                                                       (13)
            NDIT_NetOutput(NEW_LINE);
            
            NDIT_ProcessCommand((CPU_CHAR     *)&buf[0],                                   (14)
                                (CPU_INT16U    ) rx_len,
                                (NDIT_OUT_FNCT  )&NDIT_NetOutput,
                                (IPERF_OUT_FNCT)&NDIT_NetOutputFnct,
                                (NDIT_ERR      *)&test_err);
            switch(test_err) {                                                             (15)
                case NDIT_NO_ERR:
                case NDIT_ERR_NO_CMD:  
                    break;
                case NDIT_ERR_IPERF:
                    NDIT_NetOutput("\r\nError in IPerf Test\r\n\r\n");                     (16)
                    break;
                case NDIT_ERR_MCAST:
                    NDIT_NetOutput("\r\nError in Mcast Test\r\n\r\n");                     (17)
                    break;
                case NDIT_ERR_IFSS:
                    NDIT_NetOutput("\r\nError in IFSS Test\r\n\r\n");                      (18)
                    break;
                case NDIT_ERR_NO_MATCH:
                default:    
                    NDIT_NetOutput("\r\nCommand not recognized\r\n\r\n");                  (19)
                    break; 
            }
             
            NDIT_Delay (0, 0, 0, 100); 
        }
    }
}
#endif


Panel
bgColor#f0f0f0

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

...

(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.

...

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

...

(4) Initialize NDIT Server Address and Port.

...

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

...

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

...

(7) Bind the socket to a local port.

...

(8) If binding fails, close the socket.

...

(9) Server reading and command processing loop.

...

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

...

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

...

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

...

(13) Reply to test station for acknowledgement.

...

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

...

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

...

(16) An error occurred during an IPerf test.

...

(17) An error occurred during a Multicast test.

...

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

...

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