Open-AVB AVTP Pipeline SDK  1.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
openavb_tl_pub.h File Reference

Talker Listener Public Interface. More...

#include "openavb_types_pub.h"
#include "openavb_mediaq_pub.h"
#include "openavb_map_pub.h"
#include "openavb_intf_pub.h"
#include "openavb_avtp_time_pub.h"

Go to the source code of this file.

Data Structures

struct  openavb_tl_cfg_t
 Structure containing configuration of the host. More...
 
struct  openavb_tl_cfg_name_value_t
 Structure holding configuration of mapping and interface modules. More...
 

Macros

#define MAX_LIB_CFG_ITEMS   64
 Maximum number of configuration parameters inside INI file a host can have.
 
#define IFNAMSIZE   16
 Maximum size of interface name.
 

Typedefs

typedef void * tl_handle_t
 Handle to a single talker or listener.
 

Enumerations

enum  tl_stat_t {
  TL_STAT_TX_CALLS, TL_STAT_TX_FRAMES, TL_STAT_TX_LATE, TL_STAT_TX_BYTES,
  TL_STAT_RX_CALLS, TL_STAT_RX_FRAMES, TL_STAT_RX_LOST, TL_STAT_RX_BYTES
}
 Types of statistics gathered. More...
 

Functions

bool openavbTLInitialize (U32 maxTL)
 Initialize the talker listener library. More...
 
bool openavbTLCleanup (void)
 Final cleanup of the talker listener library. More...
 
bool openavbGetVersion (U8 *major, U8 *minor, U8 *revision)
 Get the version of the AVB stack. More...
 
tl_handle_t openavbTLOpen (void)
 Open a talker or listener. More...
 
void openavbTLInitCfg (openavb_tl_cfg_t *pCfg)
 Initialize the configuration to default values. More...
 
bool openavbTLConfigure (tl_handle_t handle, openavb_tl_cfg_t *pCfg, openavb_tl_cfg_name_value_t *pNVCfg)
 Configure the talker / listener. More...
 
bool openavbTLRun (tl_handle_t handle)
 Run the talker or listener. More...
 
bool openavbTLStop (tl_handle_t handle)
 Stop a single talker or listener. More...
 
void openavbTLPauseStream (tl_handle_t handle, bool bPause)
 Pause or resume as stream. More...
 
bool openavbTLClose (tl_handle_t handle)
 Close the talker or listener. More...
 
void * openavbTLGetIntfHostCBList (tl_handle_t handle)
 Get a pointer to a list of interfaces module callbacks. More...
 
void * openavbTLGetIntfHandle (tl_handle_t handle)
 Get a handle to the interface module data from this talker or listener. More...
 
bool openavbTLIsRunning (tl_handle_t handle)
 Check if a talker or listener is running. More...
 
bool openavbTLIsConnected (tl_handle_t handle)
 Checks if a talker or listener is connected to the endpoint. More...
 
bool openavbTLIsStreaming (tl_handle_t handle)
 Checks if a talker or listener has an open stream. More...
 
avb_role_t openavbTLGetRole (tl_handle_t handle)
 Return the role of the current stream handle. More...
 
U64 openavbTLStat (tl_handle_t handle, tl_stat_t stat)
 Allows pulling current stat counters for a running stream. More...
 
bool openavbTLReadIniFileOsal (tl_handle_t TLhandle, const char *fileName, openavb_tl_cfg_t *pCfg, openavb_tl_cfg_name_value_t *pNVCfg)
 Read an ini file. More...
 

Detailed Description

Talker Listener Public Interface.

Enumeration Type Documentation

enum tl_stat_t

Types of statistics gathered.

Enumerator
TL_STAT_TX_CALLS 

Number of TX calls.

TL_STAT_TX_FRAMES 

Number of TX frames.

TL_STAT_TX_LATE 

NUmber of late TX frames.

TL_STAT_TX_BYTES 

Number of bytes send.

TL_STAT_RX_CALLS 

Number of RX calls.

TL_STAT_RX_FRAMES 

Number of RX frames.

TL_STAT_RX_LOST 

Number of RX frames lost.

TL_STAT_RX_BYTES 

Number of bytes received.

Function Documentation

bool openavbTLInitialize ( U32  maxTL)

Initialize the talker listener library.

This function must be called first before any other in the openavb_tl API. Any AVTP wide initialization occurs at this point

Parameters
maxTLThe maximum number of talkers and listeners that will be started
Returns
TRUE on success or FALSE on failure
Warning
Must be called prior to using any other TL APIs
Examples:
openavb_host.c.
bool openavbTLCleanup ( void  )

Final cleanup of the talker listener library.

This function must be called last after all talkers and listeners have been closed

Returns
TRUE on success or FALSE on failure
Warning
Should be called after all Talker and Listeners are closed
Examples:
openavb_host.c.
bool openavbGetVersion ( U8 major,
U8 minor,
U8 revision 
)

Get the version of the AVB stack.

Fills the major, minor and revision parameters with the values version information of the AVB stack

Parameters
majorThe major part of the version number
minorThe minor part of the version number
revisionThe revision part of the version number
Returns
TRUE on success or FALSE on failure
tl_handle_t openavbTLOpen ( void  )

Open a talker or listener.

This will create a talker / listener

Returns
handle of the talker/listener. NULL if the talker or listener could not be loaded
Examples:
openavb_host.c.
void openavbTLInitCfg ( openavb_tl_cfg_t pCfg)

Initialize the configuration to default values.

Initializes configuration file to default values

Parameters
pCfgPointer to configuration structure
Examples:
openavb_host.c.
bool openavbTLConfigure ( tl_handle_t  handle,
openavb_tl_cfg_t pCfg,
openavb_tl_cfg_name_value_t pNVCfg 
)

Configure the talker / listener.

Configures talker/listener with configuration values from configuration structure and name value pairs

Parameters
handleHandle of talker/listener
pCfgPointer to configuration structure
pNVCfgPointer to name value pair configuration structure
Returns
TRUE on success or FALSE on failure
Examples:
openavb_host.c.
bool openavbTLRun ( tl_handle_t  handle)

Run the talker or listener.

The talker or listener indicated by handle that was previously loaded with the openavbTLOpen() function will be run. The stream will be opened at this time. Two threads created, one for endpoint IPC and one for stream handling.

Parameters
handleThe handle return from openavbTLOpen()
Returns
TRUE on success or FALSE on failure
Examples:
openavb_host.c.
bool openavbTLStop ( tl_handle_t  handle)

Stop a single talker or listener.

Stop a single talker or listener. At this point data will not be sent or recieved

Parameters
handleThe handle return from openavbTLOpen()
Returns
TRUE on success or FALSE on failure
Examples:
openavb_host.c.
void openavbTLPauseStream ( tl_handle_t  handle,
bool  bPause 
)

Pause or resume as stream.

A paused stream will do everything except will toss both tx and rx packets

Parameters
handleThe handle return from openavbTLOpen()
bPauseTRUE to pause, FALSE to resume
Returns
TRUE on success or FALSE on failure
bool openavbTLClose ( tl_handle_t  handle)

Close the talker or listener.

The talker or listener indicated by handle that was previously loaded with the openavbTLOpen() function will be closed. The stream will be shutdown at this time and the threads created for this talker or listener will be killed

Parameters
handleThe handle return from openavbTLOpen()
Returns
TRUE on success or FALSE on failure
Examples:
openavb_host.c.
void* openavbTLGetIntfHostCBList ( tl_handle_t  handle)

Get a pointer to a list of interfaces module callbacks.

In cases where a host application needs to call directly into an interface module it is preferable to do so with the APIs supplied in this SDK. This will allow passing back into the interface module a handle to its data. This handle is the value returned from openavbTLGetIntfHandle()

Parameters
handleThe handle return from openavbTLOpen()
Returns
A void * is returned. This is a pointer that can be resolved when combined with a public API defined by the specific interface module
void* openavbTLGetIntfHandle ( tl_handle_t  handle)

Get a handle to the interface module data from this talker or listener.

Returns a handle to the interface module data. This handle will be used in call backs into the interface module from the host application and allows the interface module to associate the call back with the correct talker / listener (stream)

Parameters
handleThe handle return from openavbTLOpen()
Returns
Handle as a void * to the interface module data. This returned value is only intended to be passed back to the interface module in call backs from the host application.
bool openavbTLIsRunning ( tl_handle_t  handle)

Check if a talker or listener is running.

Checks if the talker or listener indicated by handle is running. The running status will be true after calling openavbTLRun()

Parameters
handleThe handle return from openavbTLOpen()
Returns
TRUE if running FALSE if not running
bool openavbTLIsConnected ( tl_handle_t  handle)

Checks if a talker or listener is connected to the endpoint.

Checks if the talker or listener indicated by handle is connected to the endpoint process

Parameters
handleThe handle return from openavbTLOpen()
Returns
TRUE if connected FALSE if not connected
bool openavbTLIsStreaming ( tl_handle_t  handle)

Checks if a talker or listener has an open stream.

Checks if the talker or listener indicated by handle has an open stream

Parameters
handleThe handle return from openavbTLOpen()
Returns
TRUE if streaming FALSE if not streaming
avb_role_t openavbTLGetRole ( tl_handle_t  handle)

Return the role of the current stream handle.

Returns if the current open stream is a talker or listener

Parameters
handleThe handle return from openavbTLOpen()
Returns
The current role
U64 openavbTLStat ( tl_handle_t  handle,
tl_stat_t  stat 
)

Allows pulling current stat counters for a running stream.

The various stat counters for a stream can be retrieved with this function

Parameters
handleThe handle return from openavbTLOpen()
statWhich stat to retrieve
Returns
the requested counter
bool openavbTLReadIniFileOsal ( tl_handle_t  TLhandle,
const char *  fileName,
openavb_tl_cfg_t pCfg,
openavb_tl_cfg_name_value_t pNVCfg 
)

Read an ini file.

Parses an input configuration file tp populate configuration structures, and name value pairs. Only used in Operating Systems that have a file system

Parameters
TLhandlePointer to handle of talker/listener
fileNamePointer to configuration file name
pCfgPointer to configuration structure
pNVCfgPointer to name value pair configuration structure
Returns
TRUE on success or FALSE on failure
Warning
Not available on all platforms
Examples:
openavb_host.c.