LibItsCam_Functions.ttcn 2.47 KB
Newer Older
/**
 *	@author 	ETSI / STF405
berge's avatar
berge committed
 *  @version 	$URL$
 *				$Id$
berge's avatar
berge committed
 *	@desc		Module containing common functions for ITS
module LibItsCam_Functions {
    // LibIts
    import from LibIts_TestSystem all;
    import from LibIts_Interface all; 
fischer's avatar
fischer committed
	import from LibItsCam_Templates 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: CAM message received in default ****");
			stop;
		}
		[]camPort.receive {
			setverdict(fail, "**** a_basicDefault: event received on CAM port in default ****");
			stop;
		}
       [] any timer.timeout { 
			setverdict(fail, "**** a_basicDefault: atimer expired in default ****");
			stop;
		}
	}//end altstep a_basicDefault
     
     
     
 } // end of defaults  
 
 group preambles {
        
fischer's avatar
fischer committed
    /**
     * @desc 	Initialize the IUT
     * @remark	No specific actions specified in the base standard
     * @param	none
     */    
fischer's avatar
fischer committed
    function f_initialState() runs on ItsFa {
fischer's avatar
fischer committed
        
fischer's avatar
fischer committed
        // basic default altstep
        activate(a_basicDefault());
                  
fischer's avatar
fischer committed
    } // end f_ptcCamUp
fischer's avatar
fischer committed
 
 } // end of preambles
    
group configuration {
fischer's avatar
fischer committed
    
berge's avatar
berge committed
     * @desc 	Create Facility component and map CAM port
berge's avatar
berge committed
     * @remark	Only used when ItsFa is a PTC
     * @param	p_camPtc returned Facility component variable
     */    
berge's avatar
berge committed
    function f_ptcCamUp(out ItsFa p_ptcCam) {
        
        // Create Facility component
        p_ptcCam := ItsFa.create("CAM Tester");
berge's avatar
berge committed
        map(p_ptcCam:camPort, system:camPort);
        
berge's avatar
berge committed
    } // end f_ptcCamUp
berge's avatar
berge committed
    
    /**
     * @desc 	Wait for component to finish and unmap CAM ports
berge's avatar
berge committed
     * @remark	Only used when ItsFa is a PTC
berge's avatar
berge committed
     * @param	p_camPtc Facility component variable
     */    
berge's avatar
berge committed
    function f_ptcCamDown(in ItsFa p_ptcCam) runs on ItsMtc {
berge's avatar
berge committed
            
    	tc_guard.start;
        alt {
        	[] p_ptcCam.done {
            	tc_guard.stop;
            }
            
            [] tc_guard.timeout {
berge's avatar
berge committed
             	log("*** f_ptcCamDown: ERROR: Timeout while waiting for component ***");
berge's avatar
berge committed
             	setverdict(inconc);   
            }
        }
        unmap(p_ptcCam:camPort);
berge's avatar
berge committed
    } // end f_ptcCamDown
fischer's avatar
fischer committed
} // end of configuration
} // end LibItsCam_Functions