The declarations in this header file correspond to the definitions in test_control.c.
More...
#include <stdbool.h>
#include <stdint.h>
#include "fifo_api.h"
#include "cdi_pool_api.h"
#include "cdi_raw_api.h"
#include "test_args.h"
Go to the source code of this file.
|
struct | TestTxUserData |
| A structure for storing data to be sent with a payload as user_cb_data. More...
|
|
struct | TestConnectionStreamInfo |
| A structure for storing all connection info related to a specific stream, such as data buffer pointers and file handles. 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...
|
|
|
#define | MAX_LOG_FILENAME_LENGTH (1024) |
| The maximum length for a file name string (includes additional name characters added automatically by the test app.
|
|
#define | MAX_SGL_ENTRIES_PER_PAYLOAD (7) |
| The fixed number of SGL entries we will try to use when in SGL mode. If payload is too small to be broken into this number of SGL entries, then we will use a smaller number of entries that can accommodate the given payload. Must be greater than 0.
|
|
#define | TEST_LOG_CONNECTION(log_level, ...) |
| Send the log message to application's log for the connection specified by "connection_info_ptr->app_file_log_handle".
|
|
#define | BYTES_PER_PATTERN_WORD (sizeof(uint64_t)) |
| The number of bytes in a test pattern word.
|
|
#define | MAX_TEST_PAYLOAD_COUNT (0x00FFFFFF) |
| The maximum payload count in the test application, the upper byte is reserved.
|
|
#define | CDI_BYTES_PER_AUDIO_SAMPLE (3) |
| Number of bytes in CDI audio sample. CDI requests 24-bit int for audio, so needs three bytes.
|
|
|
typedef struct TestConnectionInfo | TestConnectionInfo |
| Forward reference.
|
|
typedef struct TestDynamicState * | TestDynamicHandle |
| Forward reference.
|
|
|
bool | TestWaitForConnection (TestConnectionInfo *connection_info_ptr, int timeout_seconds) |
|
void | TestConnectionCallback (const CdiCoreConnectionCbData *cb_data_ptr) |
|
void | TestStatisticsCallback (const CdiCoreStatsCbData *cb_data_ptr) |
|
void | TestIncPayloadCount (TestConnectionInfo *connection_info_ptr, int stream_index) |
|
bool | PreparePayloadData (StreamSettings *stream_settings_ptr, int payload_buffer_size, CdiFileID *read_file_handle_ptr, void *buffer_ptr) |
|
bool | GetNextPayloadDataSgl (const TestConnectionInfo *connection_info_ptr, const StreamSettings *stream_settings_ptr, int payload_id, CdiFileID read_file_handle, CdiSgList *sgl_ptr) |
|
bool | GetNextPayloadDataLinear (const TestConnectionInfo *connection_info_ptr, const StreamSettings *stream_settings_ptr, TestConnectionStreamInfo *stream_info_ptr) |
|
bool | TestCreateConnectionLogFiles (TestConnectionInfo *connection_info_ptr, CdiLogMethodData *log_method_data_ptr, char *sdk_log_filename_buffer_str) |
|
bool | IsPayloadNumLessThanTotal (int current_payload_num, int total_payloads) |
|
CdiPtpTimestamp | GetVideoPtpTimestamp (const TestConnectionInfo *connection_info_ptr, const TestConnectionStreamInfo *stream_info_ptr, int ptp_rate_count) |
| Get the next video PTP timestamp to use in the payload origination_ptp_timestamp.
|
|
CdiPtpTimestamp | GetAudioPtpTimestamp (const StreamSettings *stream_settings_ptr, TestConnectionStreamInfo *stream_info_ptr, int audio_data_size) |
| Get the next audio PTP timestamp to use in the payload origination_ptp_timestamp.
|
|
void | LogTimestamps (const StreamSettings *stream_settings_ptr, TestConnectionStreamInfo *stream_info_ptr, CdiPtpTimestamp current_ptp_timestamp) |
| Log timestamp, if enabled.
|
|
The declarations in this header file correspond to the definitions in test_control.c.
◆ TEST_LOG_CONNECTION
#define TEST_LOG_CONNECTION |
( |
| log_level, |
|
|
| ... ) |
Value:
__VA_ARGS__)
@ kLogComponentGeneric
Generic component.
Definition cdi_log_enums.h:36
CDI_INTERFACE void CdiLogger(CdiLogHandle handle, CdiLogComponent component, CdiLogLevel log_level, const char *function_name_str, int line_number, const char *format_str,...)
Definition logger.c:862
Send the log message to application's log for the connection specified by "connection_info_ptr->app_file_log_handle".
◆ GetAudioPtpTimestamp()
Get the next audio PTP timestamp to use in the payload origination_ptp_timestamp.
- Parameters
-
stream_settings_ptr | Pointer to stream settings info. |
stream_info_ptr | Pointer to stream info. |
audio_data_size | Size of audio data in bytes. |
- Returns
- A PTP timestamp for the next payload to send.
◆ GetNextPayloadDataLinear()
Prepare next set of payload data. This is either reading the next payload from the file or incrementing the payload identifier value when using patterns.
- Parameters
-
connection_info_ptr | Pointer to test connection information. |
stream_settings_ptr | Pointer to stream settings. |
stream_info_ptr | Pointer to stream state. |
- Returns
- if successful return true, otherwise returns false.
◆ GetNextPayloadDataSgl()
Prepare next set of payload data. This is either reading the next payload from the file or incrementing the payload identifier value when using patterns.
- Parameters
-
connection_info_ptr | Pointer to test connection information. |
stream_settings_ptr | Pointer to stream settings. |
payload_id | Payload identifier. |
read_file_handle | The file handle for reading the next pattern from, if the pattern type is from file. |
sgl_ptr | Pointer to an SGL describing the buffer to be filled with payload data. |
- Returns
- if successful return true, otherwise returns false.
◆ GetVideoPtpTimestamp()
Get the next video PTP timestamp to use in the payload origination_ptp_timestamp.
- Parameters
-
connection_info_ptr | Pointer to test connection information. |
stream_info_ptr | Pointer to stream info. |
ptp_rate_count | Current PTP rate counter value. |
- Returns
- A PTP timestamp for the next payload to send.
◆ IsPayloadNumLessThanTotal()
bool IsPayloadNumLessThanTotal |
( |
int | current_payload_num, |
|
|
int | total_payloads ) |
Check whether the current payload number is less that the total payloads allowed.
- Parameters
-
current_payload_num | Number that represents the current payload number. |
total_payloads | Number that represents the total number of payloads for this connection (0 is infinite). |
- Returns
- bool Indicates if the current payload number is less than the total number of payloads. This is always true if infinite payloads.
◆ LogTimestamps()
Log timestamp, if enabled.
- Parameters
-
stream_settings_ptr | Pointer to stream settings. |
stream_info_ptr | Pointer to stream info. |
current_ptp_timestamp | Current PTP timestamp value to log. |
◆ PreparePayloadData()
bool PreparePayloadData |
( |
StreamSettings * | stream_settings_ptr, |
|
|
int | payload_buffer_size, |
|
|
CdiFileID * | read_file_handle_ptr, |
|
|
void * | buffer_ptr ) |
Prepare next set of payload data. This is either reading the next payload from the file or incrementing the payload identifier value when using patterns. This function is shared for managing both Tx and Rx buffer patterns.
- Parameters
-
stream_settings_ptr | Pointer to stream settings. |
payload_buffer_size | Payload buffer size, rounded up to multiple of 8 bytes. |
read_file_handle_ptr | Pointer to the user read data file handle which this function will set. |
buffer_ptr | Pointer to buffer of payload size to be filled with initial pattern words if using patterns. |
- Returns
- if successful return true, otherwise returns false.
◆ TestConnectionCallback()
Handle the connection callback.
- Parameters
-
cb_data_ptr | Pointer to core connection callback data. |
◆ TestCreateConnectionLogFiles()
Create a unique log file name for this application's connection and associate it with the current thread. This allows use of the CDI_LOG_THREAD() macro to direct log messages to the logger.
- Parameters
-
connection_info_ptr | Pointer to test connection information. |
log_method_data_ptr | Pointer to log method data. |
sdk_log_filename_buffer_str | Pointer to buffer for return SDK log filename. |
- Returns
- bool Returns true if successful, otherwise false is returned.
◆ TestIncPayloadCount()
Increment the connection's payload counter and mark done if we hit the user-specified total_payloads.
- Parameters
-
connection_info_ptr | Pointer to connection info data for which we want to increment the payload count. |
stream_index | Stream index. |
◆ TestStatisticsCallback()
Handle the statistics callback.
- Parameters
-
cb_data_ptr | Pointer to statistics callback data. |
◆ TestWaitForConnection()
bool TestWaitForConnection |
( |
TestConnectionInfo * | connection_info_ptr, |
|
|
int | timeout_seconds ) |
Wait until the connection has been established.
- Parameters
-
connection_info_ptr | Pointer to connection info data for which to wait for a connection. |
timeout_seconds | Timeout in seconds. |
- Returns
- Returns true if successful, false if the timeout occurred while waiting.