LibItsGeoNetworking_Functions.ttcn 1.55 KB
Newer Older
berge's avatar
berge committed
/**
 *	@author 	ETSI / STF405
 *  @version 	$URL$
 *				$Id$
 *	@desc		Module containing functions for GeoNetworking
 *
 */
module LibItsGeoNetworking_Functions {
    
    // LibIts
    import from LibIts_TestSystem all;
    import from LibIts_Interface all; 
    
    /**
     * @desc 	Create Facility component and connects GeoNetworking port
berge's avatar
berge committed
     * @remark	Only used when ItsFa is a PTC
berge's avatar
berge committed
     * @param	p_ptcDenm returned Facility component variable
     */    
berge's avatar
berge committed
    function f_ptcGeoNetworkingUp(out ItsNt p_ptcGeoNetworking) {
berge's avatar
berge committed
        
        // Create Facility component
        p_ptcGeoNetworking := ItsNt.create("GeoNetworking Tester");
berge's avatar
berge committed
        
        // map ports
        map(p_ptcGeoNetworking:geoNetworkingPort, system:geoNetworkingPort);
        
berge's avatar
berge committed
    } // end f_ptcGeoNetworkingUp       
berge's avatar
berge committed
    
    /**
     * @desc 	Wait for component to finish and unmap GeoNetworking 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_ptcGeoNetworkingDown(in ItsNt p_ptcGeoNetworking) runs on ItsMtc {    
berge's avatar
berge committed
    	tc_guard.start;
        alt {
        	[] p_ptcGeoNetworking.done {
            	tc_guard.stop;
            }
            
            [] tc_guard.timeout {
berge's avatar
berge committed
             	log("*** f_ptcGeoNetworkingDown: ERROR: Timeout while waiting for component ***");
berge's avatar
berge committed
             	setverdict(inconc);   
            }
        }
        unmap(p_ptcGeoNetworking:geoNetworkingPort);
        
berge's avatar
berge committed
    } // end f_ptcGeoNetworkingDown
berge's avatar
berge committed
    
} // end LibItsGeoNetworking_Functions