CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
test_args.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------------------------
2// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3// This file is part of the AWS CDI-SDK, licensed under the BSD 2-Clause "Simplified" License.
4// License details at: https://github.com/aws/aws-cdi-sdk/blob/mainline/LICENSE
5// -------------------------------------------------------------------------------------------
6
13#ifndef TEST_ARGS_H__
14#define TEST_ARGS_H__
15
16#include <stdbool.h>
17
20#include "cdi_core_api.h"
21#include "cdi_logger_api.h"
22#include "cdi_os_api.h"
23#include "cdi_utility_api.h"
24
25//*********************************************************************************************************************
26//***************************************** START OF DEFINITIONS AND TYPES ********************************************
27//*********************************************************************************************************************
28
30#define OPTARG_INVALID_CORE (-1)
31
33#define DEFAULT_NUM_LOOPS (1)
34
36#define RUN_FOREVER_VALUE (0)
37
39#define MAX_CHARACTERS_LOG_COMPONENTS (256)
40
42#define MAX_CHARACTERS_CONNECTION_INFO (20)
43
45#define PCR_VIDEO_SAMPLE_RATE (90000)
46
50typedef enum {
51 kTestPatternSame,
52 kTestPatternInc,
53 kTestPatternSHR,
54 kTestPatternSHL,
55 kTestPatternNone,
56 kTestPatternIgnore,
58
63typedef enum {
64 kTestOptionLogSingleFile,
65 kTestOptionLogMultipleFiles,
66 kTestOptionUseStderr,
67 kTestOptionMultiWindowConsole,
68 kTestOptionConnectionName,
69 kTestOptionTransmit,
70 kTestOptionReceive,
71 kTestOptionAVMAutoRx,
72 kTestOptionAVMVideo,
73 kTestOptionAVMAudio,
74 kTestOptionAVMAncillary,
75 kTestOptionStreamID,
76 kTestOptionConfigSkip,
77 kTestOptionKeepAlive,
78 kTestOptionAdapter,
79 kTestOptionBufferType,
80 kTestOptionLocalIP,
81 kTestOptionDestPort,
82 kTestOptionRemoteIP,
83 kTestOptionBindIP,
84 kTestOptionShareThread,
85 kTestOptionCore,
86 kTestOptionPayloadSize,
87 kTestOptionNumTransactions,
88 kTestOptionRate,
89 kTestOptionTxTimeout,
90 kTestOptionRxBufferDelay,
91 kTestOptionPattern,
92 kTestOptionPatternStart,
93 kTestOptionUseRiffFile,
94 kTestOptionFileRead,
95 kTestOptionFileWrite,
96 kTestOptionNewConnection,
97 kTestOptionNewConnectionMultipleEndpoints,
98 kTestOptionNewStream,
99 kTestOptionConnectionTimeout,
100 kTestOptionLogLevel,
101 kTestOptionLogComponent,
102 kTestOptionLogTimestamps,
103 kTestOptionNumLoops,
104 kTestOptionStatsConfigPeriod,
105#ifndef CDI_NO_MONITORING
106 kTestOptionStatsConfigCloudWatch,
107#endif
108 kTestOptionNoPayloadUserData,
109 kTestOptionHelp,
110 kTestOptionHelpVideo,
111 kTestOptionHelpAudio,
112 kTestOptionHelpRiff,
113 kTestOptionHelpStats,
114 kTestOptionVersion,
115 // NOTE: Must keep in sync with OptDef my_options[] table in test_args.c.
117
162
166typedef struct {
168 bool tx;
170 bool rx;
172 char connection_name_str[CDI_MAX_CONNECTION_NAME_STRING_LENGTH];
180 const char* local_adapter_ip_str;
182 int dest_port;
184 const char* remote_adapter_ip_str;
186 const char* bind_ip_addr_str;
188 int num_transactions;
194 int tx_timeout;
216
219
284
294
295//*********************************************************************************************************************
296//******************************************* START OF PUBLIC FUNCTIONS ***********************************************
297//*********************************************************************************************************************
298
305void PrintTestSettings(const TestSettings* const test_settings_ptr, const int num_connections);
306
307
316void LogComponentToString(const CdiEnumStringKey* key_array, char* log_component_str, CdiLogComponent* log_component_ptr);
317
328ProgramExecutionStatus GetArgs(int argc, const char** argv_ptr, TestSettings* test_settings_ptr,
329 int* num_connections_found);
330
331#endif // TEST_ARGS_H__
This file contains declarations and definitions for the CDI AVM baseline profile API functions.
This file contains declarations and definitions for the CDI AVM baseline profile 02....
CdiBaselineAvmPayloadType
Payload types used in CdiAvmRxData. NOTE: Any changes made here MUST also be made to "payload_type_ke...
Definition cdi_baseline_profile_api.h:34
This file declares the public API data types, structures and functions that comprise the CDI low-leve...
#define CDI_MAX_CONNECTION_NAME_STRING_LENGTH
Maximum connection name string length.
Definition cdi_core_api.h:129
CdiBufferType
Values used to determine type of receive buffer to configure for a receiver connection....
Definition cdi_core_api.h:748
#define CDI_MAX_LOG_FILENAME_LENGTH
Maximum log filename string length.
Definition cdi_core_api.h:135
#define CDI_MAX_SIMULTANEOUS_TX_PAYLOADS_PER_CONNECTION
Define to limit the max number of allowable payloads that can be simultaneously sent on a single conn...
Definition cdi_core_api.h:105
CdiLogComponent
This selector determines the SDK component type for logging. Logging for it can be enabled/disabled u...
Definition cdi_log_enums.h:35
@ kLogComponentLast
Must be last entry. Used for range checking. Do not remove.
Definition cdi_log_enums.h:42
CdiLogMethod
This selector determines the log method to use for generating log messages within the SDK....
Definition cdi_log_enums.h:24
CdiLogLevel
This selector determines the log level of messages generated using the CdiLogMessageCallback()....
Definition cdi_log_enums.h:50
The declarations in this header file correspond to the definitions in logger.c.
This file contains the declarations for OS functions for creating/managing/freeing threads,...
struct CdiSignalType_t * CdiSignalType
Define portable signal type. Don't use void* here, which prevents the compiler from type checking.
Definition cdi_os_api.h:189
The declarations in this header file correspond to the definitions in cdi_utility_api....
CdiConnectionProtocolType
This enumeration is used in the CdiConnectionState structure to indicate what connection layer is bei...
Definition cdi_utility_api.h:71
struct TestSettings TestSettings
A structure that holds all the test settings as set from the command line.
Definition ndi_test.h:43
Configuration data used by the CdiCoreNetworkAdapterInitialize() API function.
Definition cdi_core_api.h:480
Ancillary Data payload configuration data. Used to define the format of the ancillary data payload co...
Definition cdi_baseline_profile_01_00_api.h:183
Audio payload configuration data. Used to define the format of the audio payload conforming to the CD...
Definition cdi_baseline_profile_01_00_api.h:171
This is the generic AVM configuration structure which describes the format of each stream.
Definition cdi_avm_api.h:113
Video payload configuration data. Used to define the format of the video payload conforming to the CD...
Definition cdi_baseline_profile_01_00_api.h:96
A structure that is used to hold statistics gathering configuration data that is specific to CloudWat...
Definition cdi_core_api.h:852
Type used for holding arrays of enums and related string representations.
Definition cdi_utility_api.h:46
Structure used to hold state data for a single log of any type (stdout, callback or file).
Definition logger.c:79
A structure that holds all of the global test settings set from the command-line.
Definition test_args.h:223
int num_connections_established
Number of connections that have been established.
Definition test_args.h:276
bool use_single_connection_log_file
Flag for whether we are using multiple log files for each connection, or just a unified log file.
Definition test_args.h:234
bool no_payload_user_data
Flag to disable checks using payload_user_data when sender is not another cdi_test instance.
Definition test_args.h:267
bool log_timestamps
Log origination_ptp_timestamp values.
Definition test_args.h:282
int connection_timeout_seconds
The timeout in seconds to probe for a connection between EFA devices before abandoning the connection...
Definition test_args.h:231
int num_loops
The number of loops to run the tests in main.
Definition test_args.h:228
bool use_multiwindow_console
Flag for whether we are using the multi-window console mode or just the standard console.
Definition test_args.h:252
TestConnectionInfo * connection_info_array
Pointer to array of connection info structures.
Definition test_args.h:273
CdiAdapterData adapter_data
Structure used to hold the information about the adapter used by the test.
Definition test_args.h:258
CdiSignalType all_connected_signal
signal used when all connections have been established.
Definition test_args.h:279
CdiLogLevel log_level
The global log level.
Definition test_args.h:225
CdiLogMethod base_log_method
The logging method chosen by command line options.
Definition test_args.h:237
bool use_stderr
Output error messages to stderr in addition to log files (if log files are enabled).
Definition test_args.h:255
CdiCloudWatchConfigData cloudwatch_config
Statistics gathering CloudWatch configuration data.
Definition test_args.h:264
bool use_cloudwatch
Enable CloudWatch. Data in cloudwatch_config is valid.
Definition test_args.h:261
CdiLogHandle test_app_global_log_handle
Handle to global file log for the test application.
Definition test_args.h:246
int total_num_connections
Total number of connections.
Definition test_args.h:270
A structure that holds all the settings for a stream as set from the command line.
Definition test_args.h:121
const char * remote_adapter_ip_str
The remote network adapter IP address.
Definition test_args.h:160
uint64_t pattern_start
64-bit start value for the test pattern.
Definition test_args.h:146
CdiAvmVideoConfig video_params
Video parameters set by user with –avm_video option. Unused if not –avm_video payload type.
Definition test_args.h:131
CdiAvmAudioConfig audio_params
Audio parameters set by user with –avm_audio option. Unused if not –avm_audio payload type.
Definition test_args.h:133
const char * file_read_str
Definition test_args.h:152
int stream_id
Unique stream ID.
Definition test_args.h:123
CdiBaselineAvmPayloadType avm_data_type
If connection protocol is AVM, then this field holds the data type.
Definition test_args.h:129
CdiAvmConfig avm_config
The configuration structure to send with AVM payloads.
Definition test_args.h:141
TestPatternType pattern_type
Enum representing the data pattern type.
Definition test_args.h:139
CdiAvmAncillaryDataConfig ancillary_data_params
Ancillary parameters set by user with –avm_anc option. Unused if not –avm_anc payload type.
Definition test_args.h:135
int payload_size
The payload size in bytes of the test payload.
Definition test_args.h:125
const char * file_write_str
String defining the output file name for test data from the receiver.
Definition test_args.h:154
bool riff_file
Definition test_args.h:149
int config_skip
The number of payloads to skip before sending the video or audio parameters again.
Definition test_args.h:137
bool avm_auto_rx
For receiver, auto-detect incoming AVM data and output to log.
Definition test_args.h:127
int unit_size
Definition test_args.h:144
int dest_port
The destination port number. Only used if stream.
Definition test_args.h:157
A structure for storing all info related to a specific connection, including test settings,...
Definition ndi_test.h:73
A structure that holds all the test settings for a connection as set from the command line.
Definition ndi_test.h:44
uint32_t rate_period_microseconds
The number of microseconds in the selected frame rate.
Definition test_args.h:201
bool tx
When true, Tx mode is enabled.
Definition test_args.h:168
CdiBufferType buffer_type
Enum representing the buffer type.
Definition test_args.h:178
int stats_period_seconds
Statistics gathering period in seconds.
Definition test_args.h:212
bool multiple_endpoints
Connection contains multiple endpoints.
Definition test_args.h:214
CdiConnectionProtocolType connection_protocol
Enum representing the connection protocol type.
Definition test_args.h:174
bool arg_error
Definition test_args.h:199
int rate_denominator
The denominator for the number of payloads per second to send during the test.
Definition test_args.h:192
int thread_core_num
The 0-based packet poll thread's CPU core number; -1 disables pinning to a specific core.
Definition test_args.h:206
int rx_buffer_delay_ms
The receive buffer delay in milliseconds for a rx payload.
Definition test_args.h:196
int number_of_streams
The number of streams in this connection.
Definition test_args.h:208
bool rx
When true, Rx mode is enabled.
Definition test_args.h:170
int shared_thread_id
Definition test_args.h:204
int rate_numerator
The numerator for the number of payloads per second to send during the test.
Definition test_args.h:190
bool keep_alive
When true, receiver stays alive even after the first test finishes.
Definition test_args.h:176
void LogComponentToString(const CdiEnumStringKey *key_array, char *log_component_str, CdiLogComponent *log_component_ptr)
A function that turns selected log components into a string of log components delimited by the '|' ch...
Definition test_args.c:1318
void PrintTestSettings(const TestSettings *const test_settings_ptr, const int num_connections)
Definition test_args.c:1370
TestPatternType
Definition test_args.h:50
ProgramExecutionStatus
Definition test_args.h:289
@ kProgramExecutionStatusExitOk
The program should exit successfully (exit code of 0).
Definition test_args.h:291
@ kProgramExecutionStatusContinue
The program should continue to run.
Definition test_args.h:290
@ kProgramExecutionStatusExitError
The program should exit and indicate a failure (exit code of 1).
Definition test_args.h:292
TestOptionNames
Definition test_args.h:63
ProgramExecutionStatus GetArgs(int argc, const char **argv_ptr, TestSettings *test_settings_ptr, int *num_connections_found)
Definition test_args.c:1538