Commit 1328993c authored by berge's avatar berge
Browse files

Aligned DENM test suite to latest TB-approved base spec

parent fedb5c29
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -29,5 +29,9 @@ module LibItsCommon_Pixits {
     */
     */
    modulepar integer PX_TS_LONGITUDE := 70546480;
    modulepar integer PX_TS_LONGITUDE := 70546480;


    /**
     * @desc Tolerance to be applied when checking timestamps (ms)
     */
    modulepar integer PX_TIME_DELTA := 1000;
    
    
} // end LibItsCommon_Pixits
} // end LibItsCommon_Pixits
 No newline at end of file
+1 −14
Original line number Original line Diff line number Diff line
@@ -296,7 +296,6 @@ module LibItsDenm_Functions {
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                    f_selfOrClientSyncAndVerdict("error", e_timeout);
                }
                }
            }            
            }            
            
        }
        }
        
        
    } // end receiveFunctions
    } // end receiveFunctions
@@ -314,18 +313,6 @@ module LibItsDenm_Functions {
            return ((p_sequenceNumber + 1) mod 65536);
            return ((p_sequenceNumber + 1) mod 65536);
        }
        }
        
        
        /**
         * @desc Increases the data version and handles the special case where the 
         *       data version reaches the limit of 254(255 is the special cancellation value) 
         *       and will be reset to 0.
         * @param p_dataVersion The data version to increase.
         * @return The increased data version.
         */
        function f_increaseDataVersion(in DataVersion p_dataVersion) return DataVersion {
            // if maximum number of 254 reached, reset it to 0
            return ((p_dataVersion + 1) mod 255);
        }
        
    } // end group miscellaneousFunctions
    } // end group miscellaneousFunctions
    
    
} // end LibItsDenm_Functions
} // end LibItsDenm_Functions
 No newline at end of file
+38 −21
Original line number Original line Diff line number Diff line
@@ -10,6 +10,7 @@ module LibItsDenm_Templates {
    //LibIts
    //LibIts
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_Functions all;
    import from LibItsCommon_Functions all;
    import from LibItsCommon_Pixits all;
    import from LibItsDenm_TestSystem all;
    import from LibItsDenm_TestSystem all;
    import from LibItsDenm_TypesAndValues all;
    import from LibItsDenm_TypesAndValues all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
@@ -232,6 +233,18 @@ module LibItsDenm_Templates {
        
        
    } // end headerTemplates
    } // end headerTemplates
    
    
    group timeTemplates {
        
        /**
         * @desc    Receive template for TimestampIts check with delta
         * @param   p_time The expected timestamp
         */
        template TimestampIts mw_timestampIts_withDelta(
            in template (value) TimestampIts p_time
        )  := (p_time-PX_TIME_DELTA .. p_time+PX_TIME_DELTA);
        
    } // end timeTemplates
    
    group positionTemplates {
    group positionTemplates {
        
        
        /**
        /**
@@ -348,7 +361,7 @@ module LibItsDenm_Templates {
        template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation(
        template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation(
            template (value) ActionID p_actionID
            template (value) ActionID p_actionID
        ) := {
        ) := {
            management := m_denmMgmtCon(p_actionID, c_dataVersionCancellation), 
            management := m_denmMgmtCon(p_actionID, -, true), 
            situation := omit, 
            situation := omit, 
            location := omit,
            location := omit,
            alacarte := omit
            alacarte := omit
@@ -361,24 +374,27 @@ module LibItsDenm_Templates {
        /**
        /**
         * @desc    Send template for Management Container
         * @desc    Send template for Management Container
         * @param   p_actionID              The action id
         * @param   p_actionID              The action id
         * @param   p_dataVersion           The data version
         * @param   p_isNegation            The negation flag (Default: false)
         * @param   p_isNegation            The negation flag (Default: false)
         * @param   p_isCancellation        The cancellation flag (Default: false)
         * @param   p_validityDuration      The validity duration (Default: omit)
         * @param   p_validityDuration      The validity duration (Default: omit)
         * @param   p_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_detectionTime         The detection time (Default: current time)
         * @param   p_detectionTime         The detection time (Default: current time)
         * @param   p_referenceTime         The reference time (Default: current time)
         */
         */
        template (value) ManagementContainer m_denmMgmtCon(
        template (value) ManagementContainer m_denmMgmtCon(
            template (value) ActionID p_actionID,
            template (value) ActionID p_actionID,
            template (value) DataVersion p_dataVersion,
            template (value) boolean p_isNegation := false,
            template (value) boolean p_isNegation := false,
            template (value) boolean p_isCancellation := false,
            template (omit) ValidityDuration p_validityDuration := omit,
            template (omit) ValidityDuration p_validityDuration := omit,
            template (omit) TransmissionInterval p_transmissionInterval := omit,
            template (omit) TransmissionInterval p_transmissionInterval := omit,
            template (value) TimestampIts p_detectionTime := f_getCurrentTime()
            template (value) TimestampIts p_detectionTime := f_getCurrentTime(),
            template (value) TimestampIts p_referenceTime := f_getCurrentTime()
        ) := {
        ) := {
            actionID := p_actionID,
            actionID := p_actionID,
            dataVersion := p_dataVersion,
            detectionTime := p_detectionTime,
            detectionTime := p_detectionTime,
            referenceTime := p_referenceTime,
            isNegation := p_isNegation,
            isNegation := p_isNegation,
            isCancellation := p_isCancellation,
            eventPosition := m_tsPosition,
            eventPosition := m_tsPosition,
            relevanceDistance := lessThan50m,
            relevanceDistance := lessThan50m,
            relevanceTrafficDirection := allTrafficDirection,
            relevanceTrafficDirection := allTrafficDirection,
@@ -389,22 +405,25 @@ module LibItsDenm_Templates {
        /**
        /**
         * @desc    Receive template for Management Container
         * @desc    Receive template for Management Container
         * @param   p_actionID              The expected action id
         * @param   p_actionID              The expected action id
         * @param   p_dataVersion           The expected data version (Default: any)
         * @param   p_referenceTime         The reference time (Default: any)
         * @param   p_isNegation            The expected negation flag (Default: false)
         * @param   p_isNegation            The expected negation flag (Default: false)
         * @param   p_isCancellation        The expected cancellation flag (Default: false)
         * @param   p_validityDuration      The expected validity duration (Default: any or omit)
         * @param   p_validityDuration      The expected validity duration (Default: any or omit)
         * @param   p_transmissionInterval  The expected transmission interval (Default: any or omit)
         * @param   p_transmissionInterval  The expected transmission interval (Default: any or omit)
         */
         */
        template (present) ManagementContainer mw_denmMgmtCon(
        template (present) ManagementContainer mw_denmMgmtCon(
            template (present) ActionID p_actionID,
            template (present) ActionID p_actionID,
            template (present) DataVersion p_dataVersion := ?,
            template (present) TimestampIts p_referenceTime := ?,
            template (present) boolean p_isNegation := false,
            template (present) boolean p_isNegation := false,
            template (present) boolean p_isCancellation := false,
            template ValidityDuration p_validityDuration := *,
            template ValidityDuration p_validityDuration := *,
            template TransmissionInterval p_transmissionInterval := *
            template TransmissionInterval p_transmissionInterval := *
        ) := {
        ) := {
            actionID := p_actionID,
            actionID := p_actionID,
            dataVersion := p_dataVersion,
            detectionTime := ?,
            detectionTime := ?,
            referenceTime := p_referenceTime,
            isNegation := p_isNegation,
            isNegation := p_isNegation,
            isCancellation := p_isCancellation,
            eventPosition := ?,
            eventPosition := ?,
            relevanceDistance := ?,
            relevanceDistance := ?,
            relevanceTrafficDirection := allTrafficDirection,
            relevanceTrafficDirection := allTrafficDirection,
@@ -428,9 +447,10 @@ module LibItsDenm_Templates {
         */
         */
        template (present) ManagementContainer mw_anyDenmMgmtCon := {
        template (present) ManagementContainer mw_anyDenmMgmtCon := {
            actionID := ?,
            actionID := ?,
            dataVersion := ?,
            detectionTime := ?,
            detectionTime := ?,
            referenceTime := ?,
            isNegation := ?,
            isNegation := ?,
            isCancellation := ?,
            eventPosition := ?,
            eventPosition := ?,
            relevanceDistance := ?,
            relevanceDistance := ?,
            relevanceTrafficDirection := ?,
            relevanceTrafficDirection := ?,
@@ -450,12 +470,12 @@ module LibItsDenm_Templates {
        
        
        /**
        /**
         * @desc    Receive template for Management Container with the given data version
         * @desc    Receive template for Management Container with the given data version
         * @param   p_dataVersion   The expected data version (Default: any)
         * @param   p_referenceTime   The expected reference time (Default: any)
         */
         */
        template (present) ManagementContainer mw_denmMgmtConWithDataVersion(
        template (present) ManagementContainer mw_denmMgmtConWithReferenceTime(
            template (present) DataVersion p_dataVersion := ?
            template (present) TimestampIts p_referenceTime := ?
        ) modifies mw_anyDenmMgmtCon := {
        ) modifies mw_anyDenmMgmtCon := {
            dataVersion := p_dataVersion
            referenceTime := p_referenceTime
        }
        }
        
        
        /**
        /**
@@ -590,16 +610,13 @@ module LibItsDenm_Templates {
        
        
    } // end group decentralizedLocationTemplates
    } // end group decentralizedLocationTemplates
    
    
    group alacateTemplates {
    group alacarteTemplates {
        
        
        /**
        /**
         * @desc    Send template for Alacarte Container including lane count
         * @desc    Send template for Alacarte Container including lane count
         */
         */
        template (value) AlacarteContainer m_alacarteConLaneCount := {
        template (value) AlacarteContainer m_alacarteConLaneCount := {
            laneCount := {
            laneNumber := 2,
            laneNumber := 2,
                laneNumberConfidence := 100
            },
            impactReduction := omit,
            impactReduction := omit,
            externalTemperature := omit,
            externalTemperature := omit,
            roadWorks := omit,
            roadWorks := omit,
@@ -607,6 +624,6 @@ module LibItsDenm_Templates {
            stationaryVehicle := omit
            stationaryVehicle := omit
        }
        }
        
        
    } // end alacateTemplates
    } // end alacarteTemplates
    
    
} // end LibItsDenmTemplates
} // end LibItsDenmTemplates
 No newline at end of file
+0 −3
Original line number Original line Diff line number Diff line
@@ -42,9 +42,6 @@ module LibItsDenm_TypesAndValues {
        
        
        const ItsPduHeader.messageID c_messageId := 1;
        const ItsPduHeader.messageID c_messageId := 1;
        
        
        const DataVersion c_dataVersionFirst := 0;
        const DataVersion c_dataVersionCancellation := 255;
        
        const ValidityDuration c_validityDuration_10sec := 10;
        const ValidityDuration c_validityDuration_10sec := 10;
        const ValidityDuration c_defaultValidity := 600;
        const ValidityDuration c_defaultValidity := 600;