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

This file contains definitions and functions for the receive-side CDI minimal test application. More...

#include <assert.h>
#include <stdbool.h>
#include "cdi_avm_api.h"
#include "cdi_core_api.h"
#include "cdi_raw_api.h"
#include "test_common.h"

Data Structures

struct  TestSettings
 A structure that holds all the test settings for a connection as set from the command line. More...
 
struct  TestConnectionInfo
 A structure for storing all info related to a specific connection, including test settings, connection configuration data from the SDK, and state information for the test connection. More...
 

Macros

#define TestConsoleLog   SimpleConsoleLog
 Define TestConsoleLog.
 

Functions

void PrintHelp (void)
 
static bool ParseCommandLine (int argc, const char **argv, TestSettings *test_settings_ptr)
 
static void TestConnectionCallback (const CdiCoreConnectionCbData *cb_data_ptr)
 
static void TestAvmRxCallback (const CdiAvmRxCbData *cb_data_ptr)
 
static void TestRawRxCallback (const CdiRawRxCbData *cb_data_ptr)
 
int main (int argc, const char **argv)
 

Detailed Description

This file contains definitions and functions for the receive-side CDI minimal test application.

Function Documentation

◆ main()

int main ( int argc,
const char ** argv )

C main entry function.

Parameters
argcNumber of command line arguments.
argvPointer to array of pointers to command line arguments.
Returns
0 on success, otherwise 1 indicating a failure occurred.

◆ ParseCommandLine()

static bool ParseCommandLine ( int argc,
const char ** argv,
TestSettings * test_settings_ptr )
static

Parse command line and write to the specified TestSettings structure.

Parameters
argcNumber of command line arguments.
argvPointer to array of pointers to command line arguments.
test_settings_ptrAddress where to write returned settings.
Returns
true if successful, otherwise false.

◆ PrintHelp()

void PrintHelp ( void )

Output command line help message.

◆ TestAvmRxCallback()

static void TestAvmRxCallback ( const CdiAvmRxCbData * cb_data_ptr)
static

Handle the Rx AVM callback.

Parameters
cb_data_ptrPointer to Tx RAW callback data.

◆ TestConnectionCallback()

static void TestConnectionCallback ( const CdiCoreConnectionCbData * cb_data_ptr)
static

Handle the connection callback.

Parameters
cb_data_ptrPointer to CdiCoreConnectionCbData callback data.

◆ TestRawRxCallback()

static void TestRawRxCallback ( const CdiRawRxCbData * cb_data_ptr)
static

Handle the Rx RAW callback.

Parameters
cb_data_ptrPointer to Tx RAW callback data.