Actions

CTBCAFComm: Difference between revisions

No edit summary
mNo edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:CTBCAFComm}}
This library is mandatory for enabling communication with other applications, such as ''toolpack_engine'', or the Toolpack OAM system. All Toolpack applications must initialize this module.
This library is mandatory for enabling communication with other applications, such as ''toolpack_engine'', or the Toolpack OAM system. All Toolpack applications must initialize this module.



Latest revision as of 09:50, 8 September 2022

This library is mandatory for enabling communication with other applications, such as toolpack_engine, or the Toolpack OAM system. All Toolpack applications must initialize this module.

This module should be initialized through the GlobalSetParams function. Parameters for this module are contained in class CTBCAFCommParams.

Please refer to documentation in the C++ header files for class CTBCAFCommParams to know more about available parameters.

Example usage

TBX_RESULT MyApplication::Init()
{
	TBX_RESULT			Result = TBX_RESULT_OK;
	CTBCAFGlobalsParams	CafGlobalParams;
	CTBCAFCommParams	CafCommParams;

	// Set the parameters you want
	CafCommParams.mstrApplicationName	= "MyApplication";
	// (other parameters are generally left to default values)

	CafGlobalParams.mpCommParams		= &CafCommParams;
	CafGlobalParams.mfDetectHosts		= TBX_TRUE;		// Allow communicating with toolpack_engine
	CafGlobalParams.mfDetectAdapters	= TBX_FALSE;	// This application does not need to directly communicate with TMedia units
	// CafGlobalParams.mpLogParams		= [your paramters...]
	// CafGlobalParams.mpCliParams		= [your paramters...]
	// etc...

	Result = TBCAF::GlobalSetParam( &CafGlobalParams );

	return Result;
}

TBX_RESULT MyApplication::UnInit()
{
	TBX_RESULT			Result = TBX_RESULT_OK;
	CTBCAFGlobalsParams		EmptyGlobalParams;

	// Terminate all CAF modules
	Result = TBCAF::GlobalSetParam( &EmptyGlobalParams );

	return Result;
}