CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
test_common.h File Reference

The declarations in this header file correspond to the definitions in test_common.c. More...

#include <stdarg.h>
#include <stdbool.h>
#include "cdi_avm_api.h"
#include "cdi_avm_payloads_api.h"
#include "cdi_baseline_profile_api.h"
#include "cdi_logger_api.h"
#include "cdi_log_enums.h"

Go to the source code of this file.

Macros

#define PAYLOAD_PROGRESS_UPDATE_FREQUENCY   (60)
 How often to update stdout with payload progress.
 
#define DEFAULT_PROTOCOL_TYPE   (kProtocolTypeRaw)
 Default value for protocol type.
 
#define DEFAULT_NUM_TRANSACTIONS   (0)
 Default number of transactions. 0= Run forever.
 
#define DEFAULT_PAYLOAD_SIZE   (5184000)
 Default payload size.
 
#define DEFAULT_USE_EFA   (true)
 Default EFA usage.
 
#define ARRAY_ELEMENT_COUNT(thisarray)   ((int)(sizeof(thisarray)/sizeof(thisarray[0])))
 Number of elements in a static array.
 

Typedefs

typedef struct CommandLineState CommandLineState
 Forward reference of structure to create pointers later.
 
typedef struct CommandLineStateCommandLineHandle
 Forward reference of structure to create pointers later.
 

Functions

bool TestStringToInt (const char *str, int *num_ptr, char **ret_end_str)
 
bool TestCommandLineParserCreate (int *argc_ptr, const char ***argv_ptr, CommandLineHandle *ret_handle)
 
void TestCommandLineParserDestroy (CommandLineHandle handle)
 
void SimpleConsoleLog (CdiLogLevel log_level, const char *format_str,...)
 
void TestLogAVMChanges (uint16_t stream_identifier, int payload_size, CdiAvmConfig *config_ptr, const CdiAvmBaselineConfig *baseline_config_ptr, CdiAvmBaselineConfig *last_baseline_config_ptr)
 

Detailed Description

The declarations in this header file correspond to the definitions in test_common.c.

Function Documentation

◆ SimpleConsoleLog()

void SimpleConsoleLog ( CdiLogLevel log_level,
const char * format_str,
... )

Not using the console logger, so implement this API here so it can be used from within test_common.c and test applications that use this file.

Parameters
log_levelThe log level for this message.
format_strFormat string specifier.
...The remaining parameters contain a variable length list of arguments.

◆ TestCommandLineParserCreate()

bool TestCommandLineParserCreate ( int * argc_ptr,
const char *** argv_ptr,
CommandLineHandle * ret_handle )

Create an instance of a command line parser.

Parameters
argc_ptrPointer to number of command line arguments.
argv_ptrPointer pointer to array of pointers to command line arguments.
ret_handleAddress where to write returned handle of parser.
Returns
true if successful, otherwise false.

◆ TestCommandLineParserDestroy()

void TestCommandLineParserDestroy ( CommandLineHandle handle)

Destroy an instance of the command line parser.

Parameters
handleInstance handle returned from TestCommandLineParserCreate().

◆ TestLogAVMChanges()

void TestLogAVMChanges ( uint16_t stream_identifier,
int payload_size,
CdiAvmConfig * config_ptr,
const CdiAvmBaselineConfig * baseline_config_ptr,
CdiAvmBaselineConfig * last_baseline_config_ptr )
Parameters
stream_identifier
payload_size
config_ptr
baseline_config_ptr
last_baseline_config_ptr

◆ TestStringToInt()

bool TestStringToInt ( const char * str,
int * num_ptr,
char ** ret_end_str )

Convert a string to an integer.

Parameters
strPointer to string to convert.
num_ptrAddress where to write converted integer value.
ret_end_strOptional address where to write pointer to string after last character parsed.
Returns
true if successful, otherwise false.