Commit faf5e0e9 authored by garciay's avatar garciay
Browse files

Add AcSecPrimitive/AcSecResponse support for CAM & DENM

parent 692cf76e
Loading
Loading
Loading
Loading
+37 −9
Original line number Diff line number Diff line
@@ -109,6 +109,34 @@ module LibItsCam_Functions {

    group adapterControl {
        
        /**
         * @desc    Triggers event in the test system adaptation.
         * @param   p_event The event to trigger
         * @return  FncRetCode
         */
        function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsCam return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            acPort.send(p_event);
            tc_ac.start;
            alt {
                [] acPort.receive(m_acSecResponseSuccess) {
                    tc_ac.stop;
                }
                [] acPort.receive {
                    tc_ac.stop;
                    log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                }
            }
            
            return v_ret;
        }
        
        /**
         * @desc    Triggers event in the test system adaptation.
         * @param   p_event The event to trigger
+2 −2
Original line number Diff line number Diff line
@@ -31,9 +31,9 @@ module LibItsCam_TestSystem {
         */
        type port AdapterControlPort message {
            out
                AcGnssPrimitive;
                AcGnssPrimitive, AcSecPrimitive;
            in
                AcGnssResponse, AcGnssDistanceCovered;
                AcGnssResponse, AcGnssDistanceCovered, AcSecResponse;
        } // end AdapterControlPort
        
        /**
+9 −0
Original line number Diff line number Diff line
@@ -14,6 +14,15 @@ module LibItsCommon_Templates {
    
    group taPrimitives {
        
        template (value) AcSecResponse m_acSecResponseSuccess := true;
        
        template (value) AcSecPrimitive m_setAtCertificate(
                                                           in charstring p_atCertifcate) := {
            acSetAtCertificate := {
                atCertificateName := p_atCertifcate
            }
        }
        
        template AcGnssResponse m_acGnssResponseSuccess := true;
        
        template AcGnssDistanceCovered m_acGnssDistanceCovered := true;
+22 −0
Original line number Diff line number Diff line
@@ -85,6 +85,28 @@ module LibItsCommon_TypesAndValues {
    
    group acPrimitives {
        
        /**
         * @desc TA primitives for security support
         * @member acSetCertificate     Set the AT certificate to be used by the TA
         */
        type union AcSecPrimitive {
            AcSetAtCertificate acSetAtCertificate
        } // End of type AcSecPrimitive
        
        /**
         * @desc Describes the AT certificate to be used by the TA
         * @member atCertificateName The AT certificate name
         */
        type record AcSetAtCertificate {
            charstring atCertificateName
        } // End of type AcSetAtCertificate
        
        
        /**
         * @desc    Primitive for receiving response from TA
         */
        type boolean AcSecResponse;
        
        /**
         * @desc    TA primitives for DENM
         * @member  loadScenario                -
+32 −3
Original line number Diff line number Diff line
@@ -210,6 +210,34 @@ module LibItsDenm_Functions {

    group adapterControl {
        
        /**
         * @desc    Triggers event in the test system adaptation.
         * @param   p_event The event to trigger
         * @return  FncRetCode
         */
        function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsDenm return FncRetCode {
            var FncRetCode v_ret := e_success;
            
            acPort.send(p_event);
            tc_ac.start;
            alt {
                [] acPort.receive(m_acSecResponseSuccess) {
                    tc_ac.stop;
                }
                [] acPort.receive {
                    tc_ac.stop;
                    log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***");
                    f_selfOrClientSyncAndVerdict("error", e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***");
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                }
            }
            
            return v_ret;
        }
        
        /**
         * @desc    Triggers event in the test system adaptation.
         * @param   p_event The event to trigger
@@ -391,8 +419,9 @@ module LibItsDenm_Functions {
         * @desc Brings the IUT into an initial state.
         * @return FncRetCode 
         */
        function f_prInitialState(Scenario p_scenario := e_staticPosition,
								  template (value) UtInitialize p_denmInitialize := m_denmInitialize
        function f_prInitialState(
                                  in Scenario p_scenario := e_staticPosition,
                                  in template (value) UtInitialize p_denmInitialize := m_denmInitialize
        ) runs on ItsDenm return FncRetCode {
            var FncRetCode v_ret := e_success;
            
Loading