Newer
Older
/**
* @author ETSI / STF405
* @version $URL$
* $Id$
* @desc Module containing functions for basic Transport Protocol
*
*/
module LibItsBtp_Functions {
import from LibIts_Interface all;
import from LibItsBtp_TypesAndValues all;
import from LibCommon_VerdictControl all;
group preambles {
/**
* @desc Brings the IUT into an initial state.
*/
setverdict(pass);
}
} // 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) {
setverdict (pass, "*** f_utInitializeIut: PASS: IUT initialized ***");
setverdict (inconc, "*** f_utInitializeIut: INCONC: IUT could not be initialized ***");
setverdict (inconc, "*** f_utInitializeIut: INCONC: 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) {
setverdict (pass, "*** f_utCheckEvent: PASS: Event correctly indicated at application layer ***");
v_ret := e_success;
}
[] utPort.receive {
setverdict (fail, "*** f_utCheckEvent: FAIL: Event not correctly indicated at application layer ***");
v_ret := e_error;
}
[] tc_ac.timeout {
setverdict (inconc, "*** f_utCheckEvent: INCONC: Timeout while waiting for event check result ***");
v_ret := e_timeout;
}
}
return v_ret;
}