Commit 291e627d authored by schmitting's avatar schmitting
Browse files

Changed file structure

parent 20650cc1
Loading
Loading
Loading
Loading
+133 −0
Original line number Original line Diff line number Diff line
module LibItsDccFunctions {
    
    // Libcommon
    import from LibCommon_Sync all;
    import from LibCommon_VerdictControl all;
    
    // LibIts
    import from LibItsDcc_Templates all;
    import from LibItsDcc_Pixits all;
    import from LibItsDcc_Pics all;
    import from LibItsDcc_TestSystem all; 

    group dccConfigurationFunctions {
        
        /**
         * @desc    Setups default configuration   
         */
        function f_cfUp() runs on ItsDcc {
            
            map(self:utPort, system:utPort);
            map(self:inPort, system:inPort);
            f_connect4SelfOrClientSync();
            
        } // end f_cfUp
        
        /**
         * @desc    Deletes default configuration 
         */
        function f_cfDown() runs on ItsDcc {
            
            unmap(self:utPort, system:utPort);
            unmap(self:inPort, system:inPort);
            f_disconnect4SelfOrClientSync();
            
        } // end f_cfDown
        
    } // end of dccConfigurationFunctions
    
    /**
     * @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 ItsDcc {
        
            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 on the radio interface
         * @param   p_trigger The event to trigger.
         */
        function f_utTriggerEvent(template (value) UtTrigger p_trigger) runs on ItsDcc {
            
            utPort.send(p_trigger);
            alt {
                [] utPort.receive(UtResult:true) {
                    tc_wait.stop;
                    log("*** f_utTriggerEvent: INFO: Event sccessfully triggered ***");
                }
                [] utPort.receive {
                    tc_wait.stop;
                    log("*** f_utTriggerEvent: INFO: Event could not be triggered ***");
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
                [] tc_wait.timeout {
                    log("*** f_utTriggerEvent: INFO: Event could not be triggered in time ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                }
                [else] { // Shortcut defaults
                    repeat; 
                }
            }
        
        }
        
        /**
         * @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 ItsDcc {
            
            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




    
} // End of module LibItsDcc_Functions
 No newline at end of file
+10 −0
Original line number Original line Diff line number Diff line
/**
 *  @author     ETSI / STF421
 *  @version    $URL:$
 *              $Id:$
 *  @desc       DCC (TS 102 724) Pics
 *  @see        ETSI TS 102 917-1
 */
module LibItsDcc_Pics {

} // End of module LibItsDcc_Pics
 No newline at end of file
+14 −0
Original line number Original line Diff line number Diff line
/**
 *  @author     ETSI / STF421
 *  @version    $URL:$
 *              $Id:$
 *  @desc       DCC (TS 102 724) Pixits
 *  @see        ETSI TS 102 917-3
 */
module LibItsDcc_Pixits {
    
    // LibCommon
    
    // LibIts
    
} // End of module LibItsDcc_Pixits
 No newline at end of file
+62 −0
Original line number Original line Diff line number Diff line
/**
 *  @author     ETSI / STF421
 *  @version    $URL:$
 *              $Id:$
 *  @desc       DCC (TS 102 724) Templates
 *  @see        ETSI TS 102 917-3
 */
module LibItsDcc_Templates {
    
    // LibCommon
    
    // LibIts
    import from LibItsDcc_TypesAndValues all;
    import from LibItsDcc_Pixits all;
    
    group accessPrimitives {
        
        /**
         * @desc    Primitive on IN-SAP interface
         */
        group inSapPrimitives {
            
            /**
             * @desc IN Request Primitive template
             */
            template InReq m_In_Request(integer     p_commandReference,
                                        octetstring p_referenceBurst,
                                        float       p_requestedSendPower,
                                        integer     p_dCCProfileIdentifier) :=
               {commandReference     := p_commandReference,
                referenceBurst       := p_referenceBurst,
                requestedSendPower   := p_requestedSendPower,
                dCCProfileIdentifier := p_dCCProfileIdentifier
                } // End m_In_Request
            
            /**
             * @desc IN Status Primitive template
             */
            template InSta mw_In_Status(template integer p_commandReference,
                                        template Channel p_channel,
                                        template boolean p_transmissionSuccessStatus,
                                        template float   p_achievedSendPower) :=
               {commandReference          := p_commandReference,
                channel                   := p_channel,
                transmissionSuccessStatus := p_transmissionSuccessStatus,
                achievedSendPower         := p_achievedSendPower
               } // End mw_In_Status
            
        } // End of group inSapPrimitives
        
        /**
         * @desc Templates used to 
         * <li>trigger message on Upper Tester</li>
         * <li>capture indication message sent by the IUT</li>
         */
        group utPrimitives {
        
        } // End of group utPrimitives
        
    } // End of group accessPrimitives
    
} // End of module LibItsDcc_Templates
 No newline at end of file
+8 −217
Original line number Original line Diff line number Diff line
@@ -15,7 +15,7 @@ module LibItsDcc_TestSystem {
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_TestSystem all;
    import from LibItsCommon_TestSystem all;
    
    
    import from LibItsAccess_TypesAndValues all;
    import from LibItsDcc_TypesAndValues all;
    
    
    group adapterInterface {
    group adapterInterface {
        
        
@@ -26,14 +26,14 @@ module LibItsDcc_TestSystem {
             */
             */
            type port UpperTesterPort message {
            type port UpperTesterPort message {
                out 
                out 
                    UtInitialize, UtTrigger, UtCheck, UtCommandRequest;
                    UtInitialize, UtTrigger;
                in 
                in 
                    UtResult, UtCommandConfirm, UtCommandIndication
                    UtResult, UtCommandIndication
            } // end UpperTesterPort
            } // end UpperTesterPort
            
            
        } // end portDefinitions    
        } // end portDefinitions    


    } // adapterInterface     
    } // end adapterInterface
    
    
    group interfaceComponents {
    group interfaceComponents {
        
        
@@ -64,7 +64,7 @@ module LibItsDcc_TestSystem {
    } // End of component ItsDccSystem
    } // End of component ItsDccSystem
    
    
    /**
    /**
     * @desc Test component for ITS Facility layer 
     * @desc Test component for ITS Access layer 
     */
     */
    type component ItsDcc extends ItsBaseComponent {
    type component ItsDcc extends ItsBaseComponent {


@@ -90,49 +90,21 @@ module LibItsDcc_TestSystem {
         * @desc Upper Tester message to initialize IUT 
         * @desc Upper Tester message to initialize IUT 
         */
         */
        type union UtInitialize {
        type union UtInitialize {
            UtAccessInitialize utAccessInitialize
            UtRadioInitialize utRadioInitialize
        }
        }


        /**
        /**
         * @desc Upper Tester message to trigger an action on IUT 
         * @desc Upper Tester message to trigger an action on IUT 
         */
         */
        type record UtTrigger {
        type record UtTrigger {
            UtEvent utEvent
            UtRadioEvent utRadioEvent
        }

        /**
         * @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 {
            UtAccessEvent utAccessEvent
        }

        /**
         * @desc Upper Tester message describing an action/event 
         */
        type union UtCommandRequest {
            UtAccessCommandRequest utAccessCommandRequest
        }

        /**
         * @desc Upper Tester message describing an action/event 
         */
        type union UtCommandConfirm {
            UtAccessCommandConfirm utAccessCommandConfirm
        }
        }


        /**
        /**
         * @desc Upper Tester message describing an action/event 
         * @desc Upper Tester message describing an action/event 
         */
         */
        type union UtCommandIndication {
        type union UtCommandIndication {
            UtAccessCommandIndication utAccessCommandIndication
            UtRadioCommandIndication utRadioCommandIndication
        }
        }


        /**
        /**
@@ -140,187 +112,6 @@ module LibItsDcc_TestSystem {
         */    
         */    
        type boolean UtResult;
        type boolean UtResult;
        
        
            /**
             * @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 ItsDcc {
                
                    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 ItsDcc {
                    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 ItsDcc {
                    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 ItsDcc {
                    
                    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 ItsDcc {
                    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 ItsDcc {
                    
                    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
            
            
    } // End of group upper tester 
    } // End of group upper tester 
    with {
    with {
Loading