Newer
Older
/**
* @author ETSI / STF405
* @version $URL$
* $Id$
* @desc Module containing functions for basic Transport Protocol
*
*/
// LibCommon
import from LibCommon_Sync all;
// LibIts
import from LibIts_Interface all;
import from LibItsBtp_TypesAndValues all;
group configurationFunctions {
/**
* @desc Setups default configuration
*/
function f_cfUp() runs on ItsNt {
map(self:utPort, system:utPort);
map(self:btpPort, system:btpPort);
f_connect4SelfOrClientSync();
} // end f_cfUp
/**
* @desc Deletes default configuration
*/
function f_cfDown() runs on ItsNt {
unmap(self:utPort, system:utPort);
unmap(self:btpPort, system:btpPort);
f_disconnect4SelfOrClientSync();
} // end f_cfDown
} // end configurationFunctions
group preambles {
/**
* @desc Brings the IUT into an initial state.
*/
}
} // end of group preambles
group upperTester {
/**
* @desc Requests to bring the IUT in an initial state
*/
utPort.send(UtBtpInitialize:{});
tc_ac.start;
alt {
[] utPort.receive(UtBtpResult:true) {
log("*** f_utInitializeIut: INFO: IUT initialized ***");
f_selfOrClientSyncAndVerdict("error", e_error, "*** IUT could not be initialized ***");
f_selfOrClientSyncAndVerdict("error", e_timeout, "*** IUT could not be initialized in time ***");
/**
* @desc Triggers event from the application layer
* @param p_event The event to trigger.
* @return
*/
function f_utTriggerEvent(template (value) UtBtpEvent p_event) runs on ItsNt return FncRetCode {
var FncRetCode v_ret := e_success;
var template (value) UtBtpTrigger v_utMsg := { p_event };
}
/**
* @desc Checks that the event was indicated at the application layer
* @param p_event The event to check.
* @return
*/
function f_utCheckEvent(template (value) UtBtpEvent p_event) runs on ItsNt return FncRetCode {
var FncRetCode v_ret := e_success;
var template (value) UtBtpCheck v_utMsg := { p_event };
utPort.send(v_utMsg);
tc_ac.start;
alt {
[] utPort.receive(UtBtpResult:true) {
v_ret := e_success;
}
[] utPort.receive {
v_ret := e_error;
}
[] tc_ac.timeout {
v_ret := e_timeout;
f_selfOrClientSyncAndVerdict("error", e_timeout, "*** Timeout while waiting for event check result ***");
}
}
return v_ret;
}