Commit a2211228 authored by schmitting's avatar schmitting
Browse files

rrx functions added

parent b68bc1a8
Loading
Loading
Loading
Loading
+104 −29
Original line number Diff line number Diff line
@@ -134,25 +134,93 @@ module LibItsDcc_Functions {

    group rrxFunctions {
        /**
         * @desc Receive frames via the radio link and check that all frames are sent with
         * @desc Receive frames via the radio link and check that all expected frames are sent with
         *       the requested Tx power and inter-packet spacing on the chosen channel 
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_expectedTxPower      Expected Tx send power value
         * @param   p_channel              Channel on which the frame has been sent
         * @param   p_checkPower           If true, the power of the received signal will be checked
         */
        function f_rrx_AllRequestedFramesSent(float   p_testDuration,
                                              float   p_tOff,
                                              integer p_requestedTxPower,
                                              Channel p_channel) runs on ItsRrxDcc {
        function f_rRX_ExpectedFramesSent(float   p_tOff,
                                          integer p_expectedTxPower,
                                          Channel p_channel,
                                          boolean p_checkPower := true) runs on ItsRrxDcc {
            
            var RrxInd v_rrxInd;
            var integer v_frameReceivedCount := 0;
            
            timer tc_testDuration := p_testDuration;
            template integer m_expectedPowerWithDelta := ((p_expectedTxPower - PIXIT_POWER_DELTA) .. (p_expectedTxPower + PIXIT_POWER_DELTA));
            
            timer tc_testDuration := f_getTestDuration(p_tOff) + p_tOff;
            timer tc_tOffCheck := 2.0 * p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);

        } // End of function f_rrx_AllRequestedFramesSent
            tc_testDuration.start;
            
            alt {
                [] rrxPort.receive(m_rrxInd(p_channel, ?)) -> value v_rrxInd {
                    v_frameReceivedCount := v_frameReceivedCount + 1;
                    if(match(v_rrxInd.measuredPower, m_expectedPowerWithDelta) and p_checkPower)
                       { log("*** function f_rRX_AllRequestedFramesSent: FAIL: The measured Tx power is different to the requested Tx power. ***");
                         setverdict(fail)}
                    tc_tOffCheck.start;
                    alt {
                        [] rrxPort.receive(m_rrxInd(p_channel, ?)) -> value v_rrxInd {
                            v_frameReceivedCount := v_frameReceivedCount + 1;
                            if(match(v_rrxInd.measuredPower, m_expectedPowerWithDelta) and p_checkPower)
                               { log("*** function f_rRX_AllRequestedFramesSent: FAIL: The measured Tx power is different to the requested Tx power. ***");
                                 setverdict(fail)}
                            if(tc_tOffCheck.read < p_tOff)
                               { log("*** function f_rRX_AllRequestedFramesSent: FAIL: The inter-packet spacing time interval is smaller than the minimum allowed. ***");
                                 setverdict(fail)}
                            tc_tOffCheck.start;
                            repeat;
                         }
                        [] tc_tOffCheck.timeout {
                            tc_tOffCheck.start;
                            repeat;
                         }
                        [] tc_testDuration.timeout 
                           {setverdict(pass)}
                    }
                }
                [] tc_testDuration.timeout {
                    log("*** function f_rRX_AllRequestedFramesSent: FAIL: No packet received on the radio interface. ***");
                    setverdict(fail)
                 }
            }
            
            checkPort.send(v_frameReceivedCount);
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            
        } // End of function f_rRX_ExpectedFramesSent

        /**
         * @desc Check that no frames are received via the radio link
         * @param   p_tOff Requested Toff value
         */
        function f_rRX_NoFramesSent(float p_tOff) runs on ItsRrxDcc {
            
            timer tc_testDuration := f_getTestDuration(p_tOff);
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);

            tc_testDuration.start;
            
            alt {
                [] rrxPort.receive(m_rrxInd(?, ?)) {
                    log("*** function f_rRX_NoFramesSent: FAIL: A radio frame was received when none was expected. ***");
                    setverdict(fail)
                 }
                [] tc_testDuration.timeout {
                    setverdict(pass)
                 }
            }
            
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            
        } // End of function f_rRX_NoFramesSent
    } // End of group rrxFunctions

    /**
@@ -163,14 +231,12 @@ module LibItsDcc_Functions {
        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are 
         *       reported as sent with the requested Tx power
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel              Channel on which the frame has been sent
         */
        function f_iN_AllRequestedFramesSent(float   p_testDuration,
                                             float   p_tOff,
        function f_iN_AllRequestedFramesSent(float   p_tOff,
                                             integer p_requestedTxPower,
                                             integer p_dCCProfileIdentifier,
                                             Channel p_channel) runs on ItsInDcc {
@@ -180,7 +246,7 @@ module LibItsDcc_Functions {
            var integer v_frameRequestedCount := 1;
            var integer v_frameAcknowledgedCount := 0;
            
            timer tc_testDuration := p_testDuration;
            timer tc_testDuration := f_getTestDuration(p_tOff);
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
@@ -242,6 +308,7 @@ module LibItsDcc_Functions {
                      }     
                }
             }
            checkPort.send(v_frameAcknowledgedCount);
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            
        } // End of function f_iN_AllRequestedFramesSent
@@ -249,15 +316,13 @@ module LibItsDcc_Functions {
        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are 
         *       reported as sent with reduced Tx power being lower than the maximum allowed Tx power
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel              Channel on which the frame has been sent
         * @param   p_maxTxPower           Maximum allowed Tx power value
         */
        function f_iN_FramesSentTxPowerReduction(float   p_testDuration,
                                                 float   p_tOff,
        function f_iN_FramesSentTxPowerReduction(float   p_tOff,
                                                 integer p_requestedTxPower,
                                                 integer p_dCCProfileIdentifier,
                                                 Channel p_channel,
@@ -268,7 +333,7 @@ module LibItsDcc_Functions {
            var integer v_frameRequestedCount := 1;
            var integer v_frameAcknowledgedCount := 0;
            
            timer tc_testDuration := p_testDuration;
            timer tc_testDuration := f_getTestDuration(p_tOff);
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
@@ -330,26 +395,25 @@ module LibItsDcc_Functions {
                      }     
                }
             }
            checkPort.send(v_frameAcknowledgedCount);
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            
        } // End of function f_iN_FramesSentTxPowerReduction

        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are dropped
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         */
        function f_iN_AllRequestedFramesDropped(float   p_testDuration,
                                                float   p_tOff,
        function f_iN_AllRequestedFramesDropped(float   p_tOff,
                                                integer p_requestedTxPower,
                                                integer p_dCCProfileIdentifier) runs on ItsInDcc {
            
            var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd());
            var InSta v_inSta;
            
            timer tc_testDuration := p_testDuration;
            timer tc_testDuration := f_getTestDuration(p_tOff);
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
@@ -391,14 +455,12 @@ module LibItsDcc_Functions {
        /**
         * @desc Request sending of frames via the IN_SAP and check that some frames are 
         *       reported as sent and some reported as dropped
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel              Channel on which the frame has been sent
         */
        function f_iN_SomeRequestedFramesSent(float   p_testDuration,
                                              float   p_tOff,
        function f_iN_SomeRequestedFramesSent(float   p_tOff,
                                              integer p_requestedTxPower,
                                              integer p_dCCProfileIdentifier,
                                              Channel p_channel) runs on ItsInDcc {
@@ -410,7 +472,7 @@ module LibItsDcc_Functions {
            var integer v_frameSentCount := 0;
            var boolean v_frameSent, v_frameDropped := false;
            
            timer tc_testDuration := p_testDuration;
            timer tc_testDuration := f_getTestDuration(p_tOff);
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
@@ -483,6 +545,7 @@ module LibItsDcc_Functions {
                      }     
                }
             }
            checkPort.send(v_frameSentCount);
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            
        } // End of function f_iN_SomeRequestedFramesSent
@@ -490,15 +553,13 @@ module LibItsDcc_Functions {
        /**
         * @desc Request sending of frames via the IN_SAP and check that all frames are 
         *       reported as sent via two different channels
         * @param   p_testDuration         Overall test duration
         * @param   p_tOff                 Requested Toff value
         * @param   p_requestedTxPower     Requested Tx send power value
         * @param   p_dCCProfileIdentifier Requested DCC profile
         * @param   p_channel_1            First channel on which the frame has been sent
         * @param   p_channel_2            Second channel on which the frame has been sent
         */
        function f_iN_AllRequestedFramesSentOn2Channels(float   p_testDuration,
                                                        float   p_tOff,
        function f_iN_AllRequestedFramesSentOn2Channels(float   p_tOff,
                                                        integer p_requestedTxPower,
                                                        integer p_dCCProfileIdentifier,
                                                        Channel p_channel_1,
@@ -510,7 +571,7 @@ module LibItsDcc_Functions {
            var integer v_frameAcknowledgedCount := 0;
            var boolean v_channel_1, v_channel_2 := false;
            
            timer tc_testDuration := p_testDuration;
            timer tc_testDuration := f_getTestDuration(p_tOff);
            timer tc_tOff := p_tOff;
            
            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
@@ -580,6 +641,7 @@ module LibItsDcc_Functions {
                      }     
                }
             }
            checkPort.send(v_frameAcknowledgedCount);
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            
        } // End of function f_iN_AllRequestedFramesSentOn2Channels
@@ -624,6 +686,19 @@ module LibItsDcc_Functions {
        
    } // End of group checkFunctions
    
    group auxiliaryFunction {
        
        /**
         * @desc Returns the test duration based on the number of requested frames
         * @param p_tOff Requested Toff value
         * @return Test duration
         */
        function f_getTestDuration(float p_tOff) return float {
            return p_tOff * int2float(PIXIT_NUMBER_OF_FRAMES + 1);
        }
        
    }

    group externalFunction {
        
        /**
+0 −583

File deleted.

Preview size limit exceeded, changes collapsed.

ttcn/DCC/LibItsDcc_Pics.ttcn3

deleted100644 → 0
+0 −152
Original line number 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 {

    group dccPics {
    group roles {
        /**
         * @desc Is the IUT implemented to support the role of a single transceiver ITS station?
         * @see  ETSI TS 102 917-1 v1.1.1 A.2/1 
         */
		modulepar boolean PICS_SINGLE_TRANSCEIVER;

        /**
         * @desc Is the IUT implemented to support the role of a multiple transceiver ITS station?
         * @see  ETSI TS 102 917-1 v1.1.1 A.2/2 
         */
		modulepar boolean PICS_MULTIPLE_TRANSCEIVER;

    } // end group roles
    
    group channelSupport {
        /**
         * @desc Does IUT support the usage of the ITS-G5B band?
         * @see  ETSI TS 102 917-1 v1.1.1 A.3/2 
         */
		modulepar boolean PICS_SUPPORT_ITS_G5B;

        /**
         * @desc Does IUT support the usage of the SCH1?
         * @see  ETSI TS 102 917-1 v1.1.1 A.4/2 
         */
		modulepar boolean PICS_SUPPORT_SCH1;

        /**
         * @desc Does IUT support the usage of the SCH2?
         * @see  ETSI TS 102 917-1 v1.1.1 A.4/3 
         */
		modulepar boolean PICS_SUPPORT_SCH2;

        /**
         * @desc Does IUT support the usage of the SCH3?
         * @see  ETSI TS 102 917-1 v1.1.1 A.4/4 
         */
		modulepar boolean PICS_SUPPORT_SCH3;

        /**
         * @desc Does IUT support the usage of the SCH4?
         * @see  ETSI TS 102 917-1 v1.1.1 A.4/5 
         */
		modulepar boolean PICS_SUPPORT_SCH4;

    } // end group channelSupport
    
    group maximumTransmissionPower {
        /**
         * @desc Give the maximum Transmission power for the CCH in the Relaxed state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/1 
         */
		modulepar integer PICS_MAXPOWER_CCH_RELAXED;

        /**
         * @desc Give the maximum Transmission power for the CCH in the Active state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/2 
         */
		modulepar integer PICS_MAXPOWER_CCH_ACTIVE;

        /**
         * @desc Give the maximum Transmission power for the CCH in the Restrictive state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/3 
         */
		modulepar integer PICS_MAXPOWER_CCH_RESTRICTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH1 in the Relaxed state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/4 
         */
		modulepar integer PICS_MAXPOWER_SCH1_RELAXED;

        /**
         * @desc Give the maximum Transmission power for the SCH1 in the Active state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/5 
         */
		modulepar integer PICS_MAXPOWER_SCH1_ACTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH1 in the Restrictive state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/6 
         */
		modulepar boolean PICS_MAXPOWER_SCH1_RESTRICTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH2 in the Relaxed state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/7 
         */
		modulepar integer PICS_MAXPOWER_SCH2_RELAXED;

        /**
         * @desc Give the maximum Transmission power for the SCH2 in the Active state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/8 
         */
		modulepar integer PICS_MAXPOWER_SCH2_ACTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH2 in the Restrictive state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/9 
         */
		modulepar integer PICS_MAXPOWER_SCH2_RESTRICTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH3 in the Relaxed state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/10 
         */
		modulepar integer PICS_MAXPOWER_SCH3_RELAXED;

        /**
         * @desc Give the maximum Transmission power for the SCH3 in the Active state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/11 
         */
		modulepar integer PICS_MAXPOWER_SCH3_ACTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH3 in the Restrictive state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/12 
         */
		modulepar integer PICS_MAXPOWER_SCH3_RESTRICTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH4 in the Relaxed state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/13 
         */
		modulepar integer PICS_MAXPOWER_SCH4_RELAXED;

        /**
         * @desc Give the maximum Transmission power for the SCH4 in the Active state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/14 
         */
		modulepar integer PICS_MAXPOWER_SCH4_ACTIVE;

        /**
         * @desc Give the maximum Transmission power for the SCH4 in the Restrictive state. Value in dBm.
         * @see  ETSI TS 102 917-1 v1.1.1 A.5/15 
         */
		modulepar integer PICS_MAXPOWER_SCH4_RESTRICTIVE;
		
    } // end group maximumTransmissionPower
    } // end group dccPics
} // End of module LibItsDcc_Pics
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
@@ -231,6 +231,18 @@ module LibItsDcc_Pixits {
     */
    modulepar octetstring PIXIT_REFERENCE_BURST;

    /**
     * @desc Give the allowed delta between requested and measured power value.
     * @see  ETSI TS 102 917-3 v1.1.1 A.3/2 
     */
    modulepar integer PIXIT_POWER_DELTA;
    
    /**
     * @desc Give the number of frames to be requested in a test; used to calculate overall test duration.
     * @see  ETSI TS 102 917-3 v1.1.1 A.3/3 
     */
    modulepar integer PIXIT_NUMBER_OF_FRAMES;
    
    group testcaseDataTables {
        
        /**

ttcn/DCC/LibItsDcc_Pixits.ttcn3

deleted100644 → 0
+0 −232

File deleted.

Preview size limit exceeded, changes collapsed.

Loading