/** * @author ETSI / STF405 * @version $URL$ * $Id$ * @desc Module containing common functions for ITS * */ module LibItsCam_Functions { // LibIts import from LibIts_TestSystem all; import from LibIts_Interface all; import from LibItsCam_Templates all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; // LibCommon import from LibCommon_VerdictControl all; group defaults { /** * @desc basic default behaviour handling * @remark none * @param none */ altstep a_basicDefault() runs on ItsFa { [] camPort.receive(mw_camInd ( mw_camMsg_any )){ setverdict(fail, "*** a_basicDefault: FAIL: CAM message received in default ***"); stop; } [] camPort.receive { setverdict(fail, "*** a_basicDefault: FAIL: event received on CAM port in default ***"); stop; } [] any timer.timeout { setverdict(fail, "*** a_basicDefault: FAIL: a timer expired in default ***"); stop; } }//end altstep a_basicDefault } // end of defaults group preambles { /** * @desc Initialize the IUT * @remark No specific actions specified in the base standard * @param none */ function f_initialState() runs on ItsFa { // basic default altstep activate(a_basicDefault()); } // end f_ptcCamUp } // end of preambles group postambles { /** * @desc Global postamble - stops the MTC * @remark No specific actions required so far * @param none */ function f_postamble() runs on ItsFa { log("*** f_postamble: INFO: postamble ***"); } // end of function } // end of upperTester group upperTester { function f_upperTester () { // crash signal activated // crash signal deactivated } // end of function } // end of upperTester group configuration { /** * @desc Create Facility component and map CAM port * @remark Only used when ItsFa is a PTC * @param p_camPtc returned Facility component variable */ function f_ptcCamUp(out ItsFa p_ptcCam) { // Create Facility component p_ptcCam := ItsFa.create("CAM Tester"); // map ports map(p_ptcCam:camPort, system:camPort); } // end f_ptcCamUp /** * @desc Wait for component to finish and unmap CAM ports * @remark Only used when ItsFa is a PTC * @param p_camPtc Facility component variable */ function f_ptcCamDown(in ItsFa p_ptcCam) runs on ItsMtc { tc_guard.start; alt { [] p_ptcCam.done { tc_guard.stop; } [] tc_guard.timeout { log("*** f_ptcCamDown: ERROR: Timeout while waiting for component ***"); setverdict(inconc); } } unmap(p_ptcCam:camPort); } // end f_ptcCamDown } // end of configuration group externalFunctions { /** * @desc Generate a timestamp of the cureent time to be used in a generationTime field * @return TimeStamp
*/ external function fx_generateTime() return TimeStamp; /* @desc Wrapper function for fx_generateTime * If external function returns FncRetCode "e_error" Test execution stops * * @see xf_generateTime * @see FncRetCode * */ function f_generateTime() return TimeStamp { //Variables var TimeStamp v_generationTime:=0; v_generationTime := fx_generateTime(); if (v_generationTime!=0) { return v_generationTime ; log("**** f_generateTime: INFO: OK - generationTime = " & int2str(v_generationTime) & " ****"); } else { log("**** f_generateTime: ERROR: timestamp could not be generated ****"); setverdict( inconc ) ; stop; f_postamble(); } } // end function f_triggerMsDsaReq_sf } // end of externalFunctions } // end LibItsCam_Functions