Commit 92054074 authored by garciay's avatar garciay
Browse files

add changes lost during SVN re-organization :(

parent 5da396bc
Loading
Loading
Loading
Loading
+201 −0
Original line number Diff line number Diff line
@@ -15,7 +15,208 @@ module LibItsCommon_Functions {
    // LibIts
    import from DENM_PDU_Descriptions language "ASN.1:1997" all; // TODO LibCommon shall be protocol independant?
    import from LibItsCommon_Pixits all;
    import from LibIts_Interface all;
    import from LibItsCommon_TypesAndValues all;

    group upperTester {
        
        /**
         * @desc Upper tester functions
         */
        group utFuntions { 
            
            /**
             * @desc    Requests to bring the IUT in an initial state
             * @param   p_init The initialisation to trigger.
             */
            function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsAdapterComponent {
                
                utPort.send(p_init);
                tc_wait.start;
                alt {
                    [] utPort.receive(UtResult:true) {
                        tc_wait.stop;
                        log("*** f_utInitializeIut: INFO: IUT initialized ***");
                    }
                    [] utPort.receive {
                        tc_wait.stop;
                        log("*** f_utInitializeIut: INFO: IUT could not be initialized ***");
                        f_selfOrClientSyncAndVerdict("error", e_error);
                    }
                    [] tc_wait.timeout {
                        log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***");
                        f_selfOrClientSyncAndVerdict("error", e_timeout);
                    }
                    [else] { // Shortcut defaults
                        repeat;	
                    }
                }
                
            }
            
            /**
             * @desc    Triggers event from the application layer
             * @param   p_event The event to trigger.
             */
            function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsAdapterComponent {
                var template (value) UtTrigger v_utMsg := { p_event };
                
                utPort.send(v_utMsg);
                alt {
                    [] utPort.receive(UtResult:true) {
                        tc_wait.stop;
                    }
                    [] utPort.receive {
                        tc_wait.stop;
                    }
                    [] tc_wait.timeout {
                    }
                    [else] { // Shortcut defaults
                        repeat; 
                    }
                }
            }
            
            /**
             * @desc Checks that the event was indicated at the application layer
             * @param p_event The event to check.
             * @param   p_discard The event should not appear. Default value: FALSE.
             */
            function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsAdapterComponent {
                var template (value) UtCheck v_utMsg := { p_event };
                
                utPort.send(v_utMsg);
                tc_wait.start;
                alt {
                    [] utPort.receive(UtResult:true) {
                        tc_wait.stop;
                        if (p_discard == false) {
                            log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***");
                        }
                        else {
                            log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***");
                            f_selfOrClientSyncAndVerdict("error", e_error);
                        }
                    }
                    [] utPort.receive(UtResult:false) {
                        tc_wait.stop;
                        if (p_discard == false) {
                            log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***");
                            f_selfOrClientSyncAndVerdict("error", e_error);
                        }
                        else {
                            log("*** f_utCheckEvent: INFO: Event not indicated at application layer***");
                        }
                    }
                    [] tc_wait.timeout {
                        log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***");
                        f_selfOrClientSyncAndVerdict("error", e_timeout);                    
                    }
                    [else] { // Shortcut defaults
                        repeat; 
                    }
                }
            }
            
            /**
             * @desc    Send a command request primitive and wait for the command confirm response
             * @param   p_commandReq    The command request
             * @param   p_commandConf   The command confirm response
             * @param   p_discard       Set to true if command confirm responses shall be discard, otherwise the function failed 
             * @param   p_result        The command/request confirm response
             * @verdict Unchanged on success, fail otherwise
             */
            function f_utCommandRequestConfirm(
                in template (value) UtCommandRequest p_commandReq, 
                in template (present) UtCommandConfirm p_commandConf, 
                in boolean p_discard, 
                out UtCommandConfirm p_result) 
            runs on ItsAdapterComponent {
                
                utPort.send(p_commandReq);
                tc_wait.start;
                alt {
                    [] utPort.receive(p_commandConf) -> value p_result{
                        tc_wait.stop;
                    }
                    [] utPort.receive {
                        tc_wait.stop;
                        if (p_discard == false) {
                            log("*** f_utCommandRequestConfirm: ERROR: Event not correctly indicated at application layer ***");
                            f_selfOrClientSyncAndVerdict("error", e_error);
                        }
                        else {
                            log("*** f_utCommandRequestConfirm: INFO: Another event indicated at application layer, repeating check ***");
                            repeat;
                        }
                    }
                    [] tc_wait.timeout {
                        if (p_discard == false) {
                            log("*** f_utCommandRequestConfirm: ERROR: Timeout while waiting for event check result ***");
                            f_selfOrClientSyncAndVerdict("error", e_timeout);
                        }
                        else {
                            log("*** f_utCommandRequestConfirm: INFO: Event not indicated at application layer ***");
                        }
                    }
                } // end of 'alt' statement
                
            } // End of function f_utCommandRequestConfirm
            
                /**
                 * @desc    Send a command request primitive and do not wait for the command confirm response
                 * @param   p_commandReq    The command request
                 * @verdict Unchanged on success, fail otherwise
                 */
                function f_utCommandRequestWithoutConfirm(
                    in template (value) UtCommandRequest p_commandReq 
                ) runs on ItsAdapterComponent {
                    utPort.send(p_commandReq);
                } // End of function f_utCommandRequestWithoutConfirm
                
            /**
             * @desc Capture the next event sent to the Upper Tester
             * @param   p_event     Receive template of the expected event
             * @param   p_result    Return the value of the received event if template matchs
             */
            function f_utCommandIndication( 
                in template UtCommandIndication p_event,
                out UtCommandIndication p_result
            ) runs on ItsAdapterComponent {
                
                tc_wait.start;
                alt {
                    [] utPort.receive(p_event) -> value p_result {
                        tc_wait.stop;
                    }
                    [] utPort.receive {
                        tc_wait.stop;
                        log("*** f_utCommandIndication: INFO: Another event indicated at application layer, repeating check ***");
                    }
                    [] tc_wait.timeout {
                        log("*** f_utCommandIndication: ERROR: Timeout while waiting for event check result ***");
                    }
                } // end of 'alt' statement
                
            } // End of function f_utCommandIndication
            
        } // End of group utFunctions
        
//        /**
//         * @desc Upper tester altsteps
//         */
//        group utAltstep {
//            
//            
//            altstep a_utCommandRequest(in template UtCommandRequest p_commandReq) runs on ItsAdapterComponent { 
//                [] utPort.receive(p_commandReq) {
//                    log("*** a_utCommandRequest: INFO: Receive Command Request message ***");
//                }
//            } // End of altsetp a_utCommandRequest
//            
//        } // End of group utAltstep
        
    } // End of group upper tester
    
    group generalFunctions {
        
+75 −0
Original line number Diff line number Diff line
@@ -7,6 +7,11 @@
 */
module LibItsCommon_TypesAndValues {
    
    // LibIts - IP Protocols
    import from LibItsBtp_TypesAndValues all;
    import from LibItsCam_TypesAndValues all;
    import from LibItsDenm_TypesAndValues all;
    import from LibItsGeoNetworking_TypesAndValues all;
    // LibIts - Non IP Protocols
    import from LibItsFntp_TypesAndValues {
        type 
@@ -25,7 +30,77 @@ module LibItsCommon_TypesAndValues {
            UtIicpInitialize 
    };
    
    /**
     * @desc Upper Tester message to initialize IUT 
     */
    type union UtInitialize {
        // IP Protocols
        UtBtpInitialize utBtpInitialize,
        UtCamInitialize utCamInitialize,
        UtDenmInitialize utDenmInitialize,
        UtGNInitialize utGNInitialize,
        // Non IP Protocols
        UtFntpInitialize utFntpInitialize,
        UtFsapInitialize utFsapInitialize,
        UtIicpInitialize utIicpInitialize
    }
    
    /**
     * @desc Upper Tester message to trigger an action on IUT 
     */
    type record UtTrigger {
        UtEvent utEvent
    }
    
    /**
     * @desc Upper Tester message to check event/status on IUT 
     */    
    type record UtCheck {
        UtEvent utEvent
    }
    
    /**
     * @desc Upper Tester message describing an action/event 
     */
    type union UtEvent {
        // IP Protocols
        UtBtpEvent utBtpEvent,
        UtCamEvent utCamEvent,
        UtDenmEvent utDenmEvent,
        UtGNEvent utGnEvent,
        // Non IP Protocols
        UtFntpEvent utFntpEvent,
        UtFsapEvent utFsapEvent
    }
    
    /**
     * @desc Upper Tester message describing an action/event 
     */
    type union UtCommandRequest {
        UtFntpCommandRequest utFntpCommandRequest,
        UtFsapCommandRequest utFsapCommandRequest
    }
    
    /**
     * @desc Upper Tester message describing an action/event 
     */
    type union UtCommandConfirm {
        UtFntpCommandConfirm utFntpCommandConfirm
// FIXME To be removed       UtFsapCommandConfirm utFsapCommandConfirm
    }
    
    /**
     * @desc Upper Tester message describing an action/event 
     */
    type union UtCommandIndication {
        UtFntpCommandIndication utFntpCommandIndication
        //UtFsapCommandIndication utFsapCommandIndication
    }
    
    /**
     * @desc Upper Tester response message  
     */    
    type boolean UtResult;
    
}
with {
+0 −24
Original line number Diff line number Diff line
/**
 *    @author      ETSI / STF405
 *    @version     $URL$
 *                 $Id$
 *    @desc        Module containing types and values for External protocols
 *
 */
module LibItsExternal_TypesAndValues {

    // LibCommon
    import from LibCommon_DataStrings all;

    group linkLayerConstants {

        /**
         * @desc Ethernet MAC address
         */
        type Oct6 MacAddress;
                
        const MacAddress c_llBroadcast := 'FFFFFFFFFFFF'O;
        
    } // end linkLayerConstants
        
} // end LibItsIpv6OverGeoNetworking_TypesAndValues
 No newline at end of file