IPerf API#

IPerf_ConfigureCfg()#

Description#

Configure the IPerf module parameters.

Files#

iperf.h/iperf.c

Prototype#

void  IPerf_ConfigureCfg (const  IPERF_CFG  *p_cfg)

Arguments#

p_cfg

Pointer to the structure containing the IPerf module parameters.

Returned Value#

None.

Notes / Warnings#

  1. This function is optional. If it is called, it must be called before IPerf_Init(). If it is not called, default values will be used to initialize the module.

IPerf_ConfigureMemSeg()#

Description#

Configure the memory segment that will be used to allocate internal data needed by the IPerf module instead of the default memory segment.

Files#

iperf.h/iperf.c

Prototype#

void  IPerf_ConfigureMemSeg (MEM_SEG  *p_mem_seg)

Arguments#

p_mem_seg

Pointer to the memory segment from which the internal data will be allocated. If DEF_NULL, the internal data will be allocated from the global Heap.

Returned Value#

None.

Notes / Warnings#

  1. This function is optional. If it is called, it must be called before IPerf_Init(). If it is not called, default values will be used to initialize the module.

IPerf_ConfigureTaskStk()#

Description#

Configure IPerf's task stack size.

Files#

iperf.h/iperf.c

Prototype#

void IPerf_ConfigureTaskStk (CPU_STK_SIZE   stk_size_elements,
                             void          *p_stk_base)

Arguments#

stk_size_elements

Size of the stack, in CPU_STK elements.

p_stk_base

Pointer to base of the stack.

Returned Value#

None.

Notes / Warnings#

  1. This function is optional. If it is called, it must be called before IPerf_Init(). If it is not called, default values will be used to initialize the module.

IPerf_TaskPrioSet()#

Description#

Sets the priority of the IPerf task.

Files#

iperf.h/iperf.c

Prototype#

void IPerf_TaskPrioSet (RTOS_TASK_PRIO   prio,
                        RTOS_ERR        *p_err)

Arguments#

prio

New priority for the IPerf task.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function.

Returned Value#

None.

Notes / Warnings#

None.

IPerf_Init()#

Description#

Initializes and starts the IPerf application.

Files#

iperf.h/iperf.c

Prototype#

void  IPerf_Init (IPERF_CFG     *p_cfg,
                  RTOS_TASK_CFG *p_task_cfg,
                  MEM_SEG       *p_mem_seg,
                  RTOS_ERR      *p_err)

Arguments#

p_cfg

Pointer to the IPerf configuration.

p_task_cfg

Pointer to the IPerf task configuration.

p_mem_seg

Memory segment from which internal data will be allocated. If DEF_NULL, it will be allocated from the global heap.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_BLK_ALLOC_CALLBACK

  • RTOS_ERR_SEG_OVF

  • RTOS_ERR_INVALID_CFG

  • RTOS_ERR_NOT_AVAIL

  • RTOS_ERR_OS_ILLEGAL_RUN_TIME

Returned Value#

None.

Notes / Warnings#

None.

IPerf_TestStart()#

Description#

Validates and schedules a new IPerf test.

Files#

iperf.h/iperf.c

Prototype#

IPERF_TEST_ID  IPerf_TestStart (CPU_CHAR         *argv,
                                IPERF_OUT_FNCT    p_out_fnct,
                                IPERF_OUT_PARAM  *p_out_param,
                                RTOS_ERR         *p_err)

Arguments#

argv

Pointer to the string arguments values.

p_out_fnct

Pointer to the string output function.

p_out_param

Pointer to the output function parameters.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_NOT_AVAIL

  • RTOS_ERR_POOL_EMPTY

  • RTOS_ERR_WOULD_OVF

  • RTOS_ERR_INVALID_ARG

  • RTOS_ERR_NO_MORE_RSRC

  • RTOS_ERR_BLK_ALLOC_CALLBACK

  • RTOS_ERR_SEG_OVF

Returned Value#

  • Test ID, if no error(s).

  • IPERF_TEST_ID_NONE, otherwise.

Notes / Warnings#

None.

IPerf_TestRelease()#

Description#

Removes the test in ring array holding.

Files#

iperf.h/iperf.c

Prototype#

void  IPerf_TestRelease (IPERF_TEST_ID   test_id,
                         RTOS_ERR       *p_err)

Arguments#

test_id

Test ID of the test to release.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_NOT_FOUND

  • RTOS_ERR_NET_OP_IN_PROGRESS

Returned Value#

None.

Notes / Warnings#

None.

IPerf_TestGetStatus()#

Description#

Gets the test status.

Files#

iperf.h/iperf.c

Prototype#

IPERF_TEST_STATUS  IPerf_TestGetStatus (IPERF_TEST_ID   test_id,
                                        RTOS_ERR       *p_err)

Arguments#

test_id

Test ID of the test to get status.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_NOT_FOUND

Returned Value#

Status of specified test.

Notes / Warnings#

None.

IPerf_TestGetResults()#

Description#

Gets the test result.

Files#

iperf.h/iperf.c

Prototype#

void  IPerf_TestGetResults (IPERF_TEST_ID   test_id,
                            IPERF_TEST     *p_test_result,
                            RTOS_ERR       *p_err)

Arguments#

test_id

Test ID of the test to Get result.

p_test_result

Pointer to structure that will receive the result of specified test.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_NOT_FOUND

  • RTOS_ERR_INVALID_STATE

Returned Value#

None.

Notes / Warnings#

  1. Test results can be obtained before, after, or even during a test run.

IPerf_Reporter()#

Description#

Prints (in a terminal) the IPerf test results before, during, and after the performance test.

Files#

iperf_rep.h/iperf_rep.c

Prototype#

void  IPerf_Reporter (IPERF_TEST_ID     test_id,
                      IPERF_OUT_FNCT    p_out_fnct,
                      IPERF_OUT_PARAM  *p_out_param)

Arguments#

test_id

Test ID of the test to print.

p_out_fnct

Pointer to the string output function.

p_out_param

Pointer to the output function parameters.

Returned Value#

None.

Notes / Warnings#

None.