LibItsDenm_Templates.ttcn 36.2 KB
Newer Older
 *    @author     ETSI / STF449
 *  @version     $URL$
 *                $Id$
 *    @desc        Module containing base template definitions for DENM
module LibItsDenm_Templates {
    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    // LibIts
    import from ITS_Container language "ASN.1:1997" all;
    import from DENM_PDU_Descriptions language "ASN.1:1997" all;
    
    // LibItsCommon
tepelmann's avatar
tepelmann committed
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_Functions all;
    import from LibItsCommon_Pixits all;
reinaortega's avatar
reinaortega committed
    import from LibItsDenm_TestSystem all;
    import from LibItsDenm_TypesAndValues all;
tepelmann's avatar
tepelmann committed
    
garciay's avatar
garciay committed
    group asn1Constants {
        
        const integer HeadingValue_wgs84North   := 0;
        const integer HeadingValue_wgs84East    := 900;
        const integer HeadingValue_wgs84South   := 1800;
        const integer HeadingValue_wgs84West    := 2700;
        const integer HeadingValue_unavailable  := 3600;
        
        const integer HeadingConfidence_withinZeroPointOneDegree    := 1;
        const integer HeadingConfidence_withinOneDegree             := 10;
        const integer HeadingConfidence_outOfRange                  := 126;
        const integer HeadingConfidence_unavailable                 := 127;
        
    } // End of group asn1Constants 
    
    group primitivesTemplates {
        /**
         * @desc    Send template for DEN Message (DenmPort Primitive)
tepelmann's avatar
tepelmann committed
         * @param   p_denMsg    The DEN Message to be sent
         */
        template (value) DenmReq m_denmReq(
tepelmann's avatar
tepelmann committed
            template (value) DENM p_denMsg
tepelmann's avatar
tepelmann committed
        ) := {
tepelmann's avatar
tepelmann committed
            msgOut := p_denMsg
        }
        
        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
tepelmann's avatar
tepelmann committed
         * @param   p_denMsg    The expected DEN Message
tepelmann's avatar
tepelmann committed
        template (present) DenmInd mw_denmInd(
tepelmann's avatar
tepelmann committed
            template (present) DENM p_denMsg
tepelmann's avatar
tepelmann committed
        ) := {
            msgIn               := p_denMsg,
            gnNextHeader        := *,
            gnHeaderType        := *,
            gnHeaderSubtype     := *,
            gnLifetime          := *,
            gnTrafficClass      := *,
            btpDestinationPort  := *,
            btpInfo             := *,
            ssp                 := *,
            its_aid             := *
tepelmann's avatar
tepelmann committed
        }

        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg            The expected DEN Message
         * @param   p_gnNextHeader      GN next header value
         * @param   p_gnHeaderType      GN header type value
         * @param   p_gnHeaderSubtype   GN header subtype value
         * @param   p_gnLifetime        GN packet lifetime value (ms)
         * @param   p_gnTrafficClass    GN traffic class value
         */
        template DenmInd mw_denmIndWithGnParameters (
            template (present) DENM p_denMsg,
            in template UInt8 p_gnNextHeader := *,
            in template UInt8 p_gnHeaderType := *,
            in template UInt8 p_gnHeaderSubtype := *,
            in template UInt32 p_gnLifetime := *,
            in template UInt8 p_gnTrafficClass := *
        ) modifies mw_denmInd := { 
            gnNextHeader := p_gnNextHeader,
            gnHeaderType := p_gnHeaderType,
            gnHeaderSubtype := p_gnHeaderSubtype,
            gnLifetime := p_gnLifetime,
            gnTrafficClass := p_gnTrafficClass    
        };
        
        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg    The expected DEN Message
         * @param   p_ssp       SSP security parameter
         * @param   p_its_aid   ITS-AID value
         */
        template DenmInd mw_denmIndWithSecurityParameters(
                                                          template (present) DENM p_denMsg,
                                                          template Bit256 p_ssp := *,
                                                          template UInt32 p_its_aid := c_its_aid_DENM
        ) modifies mw_denmInd := { 
            ssp             := p_ssp,
            its_aid         := p_its_aid
        };
        
        /**
         * @desc    Receive template for DEN Message (DenmPort Primitive)
         * @param   p_denMsg                The expected DEN Message
         * @param   p_btpDestinationPort    BTP destination port value
         * @param   p_btpInfo               BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A)
         */
        template DenmInd mw_denmIndWithBtpParameters (
            template (present) DENM p_denMsg,
garciay's avatar
garciay committed
            in template UInt16 p_btpDestinationPort := *,
            in template UInt16 p_btpInfo := *
        ) modifies mw_denmInd := { 
            btpDestinationPort := p_btpDestinationPort,
            btpInfo := p_btpInfo     
        };
tepelmann's avatar
tepelmann committed
        
        group utPrimitives {
            
tepelmann's avatar
tepelmann committed
             * @desc    Send template for Upper Tester event initialization
             */
            template (value) UtInitialize m_denmInitialize := {
garciay's avatar
garciay committed
                hashedId8 := '0000000000000000'O
            /**
             * @desc    Send template for Upper Tester event changePseudonym
             */
            template (value) UtChangePseudonym m_utChangePseudonym := {
            }
            
             * @desc    Send template for Upper Tester Trigger event
garciay's avatar
garciay committed
             * @param   p_situation                     The Situation Container
             * @param   p_location                      The Location Container
             * @param   p_validityDuration              The validity duration (Default: omit)
             * @param   p_repetitionDuration            The repetition duration (Default: omit)
             * @param   p_repetitionInterval            The repetition interval (Default: omit)
             * @param   p_transmissionInterval          The transmission interval (Default: omit)
garciay's avatar
garciay committed
             * @param   p_alacarte                      The Alacarte container (Default: omit)
            template (value) UtDenmTrigger m_utTriggerEvent(
tepelmann's avatar
tepelmann committed
                template (value) SituationContainer p_situation,
                template (omit) ValidityDuration p_validityDuration := c_duration_2sec,
                template (omit) ValidityDuration p_repetitionDuration := omit,
                template (omit) TransmissionInterval p_repetitionInterval := omit,
tepelmann's avatar
tepelmann committed
                template (omit) TransmissionInterval p_transmissionInterval := omit,
                template (omit) AlacarteContainer p_alacarte := omit
            ) := {
                detectionTime := f_getCurrentTime(),
                validityDuration := p_validityDuration,
tepelmann's avatar
tepelmann committed
                repetitionDuration := p_repetitionDuration,
                situation := p_situation,
tepelmann's avatar
tepelmann committed
                relevanceDistance := lessThan50m,
                relevanceTrafficDirection := allTrafficDirections,
tepelmann's avatar
tepelmann committed
                transmissionInterval := p_transmissionInterval,
                repetitionInterval := p_repetitionInterval,
                alacarte := p_alacarte
garciay's avatar
garciay committed
            /**
             * @desc Send template for Upper Tester event update
             * @param p_actionId                    The action id
             * @param p_situation                   The Situation Container (Default: omit)
             * @param p_location                    The Location Container (Default: omit)
             * @param p_validityDuration            The validity duration (Default: omit)
             * @param p_relevanceDistance           The relevance distance (Default: omit)
             * @param p_relevanceTrafficDirection   The relevance traffic direction (Default: omit)
             * @param p_trafficClass                The traffic class (Default: omit)
             * @param p_repetitionInterval            The repetition interval (Default: omit)
garciay's avatar
garciay committed
             * @param p_transmissionInterval        The transmission interval (Default: omit)
             * @param p_alacarte                    The Alacarte Container (Default: omit)
tepelmann's avatar
tepelmann committed
             */
            template (value) UtDenmUpdate m_utUpdateEvent(
tepelmann's avatar
tepelmann committed
                template (value) ActionID p_actionId,
                template (omit) SituationContainer p_situation := omit,
                template (omit) LocationContainer p_location := omit,
                template (omit) ValidityDuration p_validityDuration := omit,
                template (omit) RelevanceDistance p_relevanceDistance := omit,
                template (omit) RelevanceTrafficDirection p_relevanceTrafficDirection := omit,
                template (omit) ValidityDuration p_repetitionDuration := omit,
                template (omit) TransmissionInterval p_repetitionInterval := omit,
tepelmann's avatar
tepelmann committed
                template (omit) TransmissionInterval p_transmissionInterval := omit,
                template (omit) AlacarteContainer p_alacarte := omit
            ) := {
                actionId := p_actionId,
                detectionTime := f_getCurrentTime(),
                validityDuration := p_validityDuration,
                situation := p_situation,
                location := p_location,
                relevanceDistance := p_relevanceDistance,
                relevanceTrafficDirection := p_relevanceTrafficDirection,
                transmissionInterval := p_transmissionInterval,
                repetitionInterval := p_repetitionInterval,
                alacarte := p_alacarte
            /**
             * @desc    Send template for Upper Tester event cancellation
tepelmann's avatar
tepelmann committed
             * @param   p_actionId  The action id
            template (value) UtDenmTermination m_utEventCancellation(
tepelmann's avatar
tepelmann committed
                template (value) ActionID p_actionId
tepelmann's avatar
tepelmann committed
            ) := {
                actionId := p_actionId
garciay's avatar
garciay committed
            /**
             * @desc Send template for Upper Tester event change position
             * @param p_latitude    The new latitude
             * @param p_longitude   The new longitude
             * @param p_elevation   The new elevation (Default: 0)
tepelmann's avatar
tepelmann committed
             */
berge's avatar
berge committed
            template (value) UtChangePosition m_utChangePosition(
tepelmann's avatar
tepelmann committed
                template (value) integer p_latitude,
                template (value) integer p_longitude,
                template (value) integer p_elevation := 0
            ) := {
                latitude := p_latitude,
                longitude := p_longitude,
                elevation := p_elevation
            }
berge's avatar
berge committed
            
        } // end utPrimitives
      
tepelmann's avatar
tepelmann committed
    } // end primitives
    
    group denmPduTemplates {
        
tepelmann's avatar
tepelmann committed
         * @desc    Send template for DENM PDU
tepelmann's avatar
tepelmann committed
         * @param   p_denm  The DEN Message
tepelmann's avatar
tepelmann committed
        template (value) DENM m_denmPdu(
tepelmann's avatar
tepelmann committed
            template (value) DecentralizedEnvironmentalNotificationMessage p_denm
tepelmann's avatar
tepelmann committed
        ) := {
            header := m_itsPduHeader,
            denm := p_denm
tepelmann's avatar
tepelmann committed
         * @desc    Default receive template for DENM PDU
         * @param   p_itsPduHeader  The expected ITS PDU header (Default: any)
garciay's avatar
garciay committed
         * @param   p_denm          The expected DEN Message (Default: any)
         */
        template DENM mw_anyDenmPdu(
tepelmann's avatar
tepelmann committed
            template (present) ItsPduHeader p_itsPduHeader := ?,
            template (present) DecentralizedEnvironmentalNotificationMessage p_denm := ?
        ) := {
            header := p_itsPduHeader,
            denm := p_denm
        }
        
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for DENM PDU
tepelmann's avatar
tepelmann committed
         * @param   p_denm              The expected DEN Message 
garciay's avatar
garciay committed
         * @param   p_stationID         The expected station id (Default: any)
         * @param   p_protocolVersion   The expected protocol version (Default: current DEN protocol version)
         * @param   p_messageID         The expected message id (Default: DEN message id)
tepelmann's avatar
tepelmann committed
        template (present) DENM mw_denmPdu(
            template (present) DecentralizedEnvironmentalNotificationMessage p_denm,
tepelmann's avatar
tepelmann committed
            template (present) StationID p_stationID := ?,
            template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_,
            template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_
tepelmann's avatar
tepelmann committed
        ) := {
            header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID),
            denm := p_denm
tepelmann's avatar
tepelmann committed
        
    } // end denmPduTemplates
    
    group headerTemplates {
        
tepelmann's avatar
tepelmann committed
         * @desc    Default send template for ITS PDU header
tepelmann's avatar
tepelmann committed
         * @param   p_stationID         The source station ID (Default: test system station id)
         * @param   p_protocolVersion   The protocol version (Default: current DEN protocol version)
         * @param   p_messageID         The message Id (Default: DEN message id)
tepelmann's avatar
tepelmann committed
        template (value) ItsPduHeader m_itsPduHeader(
            template (value) StationID p_stationID := f_getTsStationId(),
            template (value) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_,
            template (value) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_
tepelmann's avatar
tepelmann committed
            protocolVersion := p_protocolVersion,
            messageID := p_messageID,
            stationID := p_stationID
tepelmann's avatar
tepelmann committed
         * @desc    Default receive template for ITS PDU header
garciay's avatar
garciay committed
         * @param   p_stationID         The expected station id (Default: any)
         * @param   p_protocolVersion   The expected protocol version (Default: current DEN protocol version)
         * @param   p_messageID         The expected message id (Default: DEN message id)
tepelmann's avatar
tepelmann committed
        template ItsPduHeader mw_itsPduHeader(
            template (present) StationID p_stationID := ?,
            template (present) ItsPduHeader.protocolVersion p_protocolVersion := ItsPduHeader_protocolVersion_currentVersion_,
            template (present) ItsPduHeader.messageID p_messageID := ItsPduHeader_messageID_denm_
tepelmann's avatar
tepelmann committed
            protocolVersion := p_protocolVersion,
            messageID := p_messageID,
            stationID := p_stationID
        }
        
garciay's avatar
garciay committed
        /**
         * @desc    Default receive template for the station id
tepelmann's avatar
tepelmann committed
         */
berge's avatar
berge committed
        template (present) StationID mw_anyStationId := ?;
tepelmann's avatar
tepelmann committed
    } // 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
garciay's avatar
garciay committed
        )  := (valueof(p_time)-PX_TIME_DELTA .. valueof(p_time)+PX_TIME_DELTA);
    group positionTemplates {
garciay's avatar
garciay committed
        /**
         * @desc    Send template for the test system position
         * @param   p_longitude The longitude (Default: Test system's longitude)
tepelmann's avatar
tepelmann committed
         * @param   p_latitude  The latitude (Default: Test system's latitude)
         * @see     m_posConfidenceEllipse
garciay's avatar
garciay committed
         * @see     m_elevation
tepelmann's avatar
tepelmann committed
         */
tepelmann's avatar
tepelmann committed
        template (value) ReferencePosition m_tsPosition(
            template (value) Longitude p_longitude := f_getTsLongitude(),
            template (value) Latitude p_latitude := f_getTsLatitude()
        ) := {
            longitude := p_longitude,
            latitude := p_latitude,
            positionConfidenceEllipse := m_posConfidenceEllipse,
            altitude := m_altitude
garciay's avatar
garciay committed
        /**
         * @desc    Send template for the position confidence
         * @param   p_semiMajorConfidence   The major confidence (Default: 1cm)
         * @param   p_semiMinorConfidence   The minor confidence (Default: 1cm)
         * @param   p_semiMajorOrientation  The major orientation (Default: HeadingValue_wgs84North)
tepelmann's avatar
tepelmann committed
         */
tepelmann's avatar
tepelmann committed
        template (value) PosConfidenceEllipse m_posConfidenceEllipse(
            template (value) SemiAxisLength p_semiMajorConfidence := SemiAxisLength_oneCentimeter_,
            template (value) SemiAxisLength p_semiMinorConfidence := SemiAxisLength_oneCentimeter_,
            template (value) HeadingValue p_semiMajorOrientation := HeadingValue_wgs84North
tepelmann's avatar
tepelmann committed
        ) := {
            semiMajorConfidence := p_semiMajorConfidence,
            semiMinorConfidence := p_semiMinorConfidence,
            semiMajorOrientation := p_semiMajorOrientation
        }
        
garciay's avatar
garciay committed
        /**
         * @desc    Send template for altitude
         * @param   p_altitudeValue        The altitude (Default: Sea level)
         * @param   p_altitudeConfidence   The confidence of the elevation (Default: within one meter)
tepelmann's avatar
tepelmann committed
         */
        template (value) Altitude m_altitude(
            template (value) AltitudeValue p_altitudeValue := AltitudeValue_referenceEllipsoidSurface_,
            template (value) AltitudeConfidence p_altitudeConfidence := alt_000_01
tepelmann's avatar
tepelmann committed
        ) := {
            altitudeValue := p_altitudeValue,
            altitudeConfidence := p_altitudeConfidence
        }
        
    } // end positionTemplates
    
berge's avatar
berge committed
    group decentralizedEnvironmentalNotificationMessageTemplates {
tepelmann's avatar
tepelmann committed
        
        /**
         * @desc    Send template for DEN Message
tepelmann's avatar
tepelmann committed
         * @param   p_management    The Management Container
         * @param   p_situation     The Situation Container
         * @param   p_location      The Location Container
garciay's avatar
garciay committed
         * @param   p_alacarte      The Alacarte Container (Default: omit)
         */
        template (value) DecentralizedEnvironmentalNotificationMessage m_denm(
tepelmann's avatar
tepelmann committed
            template (value) ManagementContainer p_management,
            template (omit) SituationContainer p_situation,
            template (omit) LocationContainer p_location,
tepelmann's avatar
tepelmann committed
            template (omit) AlacarteContainer p_alacarte := omit
tepelmann's avatar
tepelmann committed
        ) := {
            management := p_management, 
            situation := p_situation, 
            location := p_location,
tepelmann's avatar
tepelmann committed
            alacarte := p_alacarte
tepelmann's avatar
tepelmann committed
        }
        /**
         * @desc    Default receive template for DEN Message
tepelmann's avatar
tepelmann committed
        template (present) DecentralizedEnvironmentalNotificationMessage mw_anyDenm := {
berge's avatar
berge committed
            management := ?, 
tepelmann's avatar
tepelmann committed
            situation := *, 
            location := *,
            alacarte := *
        }
        
        /**
         * @desc    Receive template for DEN Message
tepelmann's avatar
tepelmann committed
         * @param   p_management    The expected Management Container (Default: any)
         * @param   p_situation     The expected Situation Container (Default: any or omit)
garciay's avatar
garciay committed
         * @param   p_location      The expected location Container (Default: any or omit)
         * @param   p_alacarte      The expected Alacarte Container (Default: any or omit)
tepelmann's avatar
tepelmann committed
        template (present) DecentralizedEnvironmentalNotificationMessage mw_denm(
            template (present) ManagementContainer p_management := ?,
            template SituationContainer p_situation := *,
            template LocationContainer p_location := *,
berge's avatar
berge committed
            template AlacarteContainer p_alacarte := *
tepelmann's avatar
tepelmann committed
        ) modifies mw_anyDenm := {
            management := p_management, 
            situation := p_situation, 
            location := p_location,
berge's avatar
berge committed
            alacarte := p_alacarte
tepelmann's avatar
tepelmann committed
        }
tepelmann's avatar
tepelmann committed
         * @desc    Send template for DEN Message for event termination.
garciay's avatar
garciay committed
         * @param   p_actionID  The action id
tepelmann's avatar
tepelmann committed
        template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation(
            template (value) ActionID p_actionID,
            template (value) StationType p_stationType
tepelmann's avatar
tepelmann committed
        ) := {
            management := m_denmMgmtConTermination(p_actionID, p_stationType, 1, -, -, -, isCancellation), 
tepelmann's avatar
tepelmann committed
            situation := omit, 
            location := omit,
            alacarte := omit
tepelmann's avatar
tepelmann committed
        }
berge's avatar
berge committed
    } // end group decentralizedEnvironmentalNotificationMessageTemplates
tepelmann's avatar
tepelmann committed
    
    group decentralizedManagementTemplates {
tepelmann's avatar
tepelmann committed
        
tepelmann's avatar
tepelmann committed
         * @desc    Send template for Management Container
garciay's avatar
garciay committed
         * @param   p_actionID              The action id
         * @param   p_isNegation            The negation flag (Default: false)
         * @param   p_validityDuration      The validity duration (Default: omit)
         * @param   p_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_detectionTime         The detection time (Default: current time)
garciay's avatar
garciay committed
         * @param   p_referenceTime         The reference time (Default: current time)
tepelmann's avatar
tepelmann committed
        template (value) ManagementContainer m_denmMgmtCon(
            template (value) ActionID p_actionID,
            template (value) StationType p_stationType := f_getTsStationType(),
            template (value) ValidityDuration p_validityDuration := defaultValidity,
            template (omit) TransmissionInterval p_transmissionInterval := omit,
            template (value) TimestampIts p_detectionTime := f_getCurrentTime(),
            template (value) TimestampIts p_referenceTime := f_getCurrentTime()
tepelmann's avatar
tepelmann committed
        ) := {
tepelmann's avatar
tepelmann committed
            actionID := p_actionID,
berge's avatar
berge committed
            detectionTime := p_detectionTime,
            referenceTime := p_referenceTime,
tepelmann's avatar
tepelmann committed
            eventPosition := m_tsPosition,
            relevanceDistance := lessThan50m,
            relevanceTrafficDirection := allTrafficDirections,
berge's avatar
berge committed
            validityDuration := p_validityDuration,
            transmissionInterval := p_transmissionInterval,
            stationType := p_stationType
tepelmann's avatar
tepelmann committed
        
        /**
         * @desc    Send template for Management Container
         * @param   p_actionID              The action id
         * @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_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_detectionTime         The detection time (Default: current time)
         * @param   p_referenceTime         The reference time (Default: current time)
         */
        template (value) ManagementContainer m_denmMgmtConTermination (
            template (value) ActionID p_actionID,
            template (value) StationType p_stationType := f_getTsStationType(),
            template (value) ValidityDuration p_validityDuration := defaultValidity,
            template (omit) TransmissionInterval p_transmissionInterval := omit,            
            template (value) TimestampIts p_detectionTime := f_getCurrentTime(),
            template (value) TimestampIts p_referenceTime := f_getCurrentTime(),
            template (value) Termination p_termination
        ) modifies m_denmMgmtCon := {
            termination := p_termination
        }
        
        /**
         * @desc    Send template for Management Container
         * @param   p_actionID              The action id
         * @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_transmissionInterval  The transmission interval (Default: omit)
         * @param   p_detectionTime         The detection time (Default: current time)
         * @param   p_referenceTime         The reference time (Default: current time)
         */
        template (present) ManagementContainer mw_denmMgmtConTermination (
            template (present) ActionID p_actionID,
            template (present) StationType p_stationType := f_getIutStationType(),
            template (present) TimestampIts p_referenceTime := ?,
            template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit
            template TransmissionInterval p_transmissionInterval := *,
            template Termination p_termination := *
        ) modifies mw_denmMgmtCon := {
            termination := p_termination
        }
        
berge's avatar
berge committed
        /**
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for Management Container
garciay's avatar
garciay committed
         * @param   p_actionID              The expected action id
         * @param   p_referenceTime         The reference time (Default: any)
         * @param   p_isNegation            The expected negation flag (Default: false)
garciay's avatar
garciay committed
         * @param   p_validityDuration      The expected validity duration (Default: any or omit)
         * @param   p_transmissionInterval  The expected transmission interval (Default: any or omit)
berge's avatar
berge committed
         */
tepelmann's avatar
tepelmann committed
        template (present) ManagementContainer mw_denmMgmtCon(
berge's avatar
berge committed
            template (present) ActionID p_actionID,
            template (present) StationType p_stationType := f_getIutStationType(),
            template (present) TimestampIts p_referenceTime := ?,
            template ValidityDuration p_validityDuration := *, // In ASN.1, a DEFAULT value constraint could be replaced by an omit
            template TransmissionInterval p_transmissionInterval := *,
            template Termination p_termination := *
tepelmann's avatar
tepelmann committed
        ) := {
berge's avatar
berge committed
            actionID := p_actionID,
            detectionTime := ?,
            referenceTime := p_referenceTime,
            termination    := p_termination,
berge's avatar
berge committed
            eventPosition := ?,
            relevanceDistance := *,//?,
            relevanceTrafficDirection := *,//?,
berge's avatar
berge committed
            validityDuration := p_validityDuration,
            transmissionInterval := p_transmissionInterval,
            stationType    := p_stationType
berge's avatar
berge committed
        }
tepelmann's avatar
tepelmann committed
        
berge's avatar
berge committed
        /**
         * @desc    Send template for Test system ActionID
garciay's avatar
garciay committed
         * @param   p_sequenceNumber    The sequence number (Default: 0)
tepelmann's avatar
tepelmann committed
         */
tepelmann's avatar
tepelmann committed
        template (value) ActionID m_tsActionId(
tepelmann's avatar
tepelmann committed
            template (value) SequenceNumber p_sequenceNumber := 0
tepelmann's avatar
tepelmann committed
        ) := {
            originatingStationID := f_getTsStationId(),
tepelmann's avatar
tepelmann committed
            sequenceNumber := p_sequenceNumber
tepelmann's avatar
tepelmann committed
         * @desc    Default receive template for Management Container
tepelmann's avatar
tepelmann committed
        template (present) ManagementContainer mw_anyDenmMgmtCon := {
            actionID := ?,
            detectionTime := ?,
            referenceTime := ?,
            termination    := *,
            eventPosition := ?,
            relevanceDistance := *,
            relevanceTrafficDirection := *,
            validityDuration := *, // It seems that a default value can be omitted (asn1studio)
            transmissionInterval := *,
            stationType    := ?
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for Management Container with the given action id
garciay's avatar
garciay committed
         * @param   p_actionId  The expected action id (Default: any)
tepelmann's avatar
tepelmann committed
        template (present) ManagementContainer mw_denmMgmtConWithActionID(
            template (present) ActionID p_actionId := ?
        ) modifies mw_anyDenmMgmtCon := {
            actionID := p_actionId
        }
        
        /**
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for Management Container with the given data version
garciay's avatar
garciay committed
         * @param   p_referenceTime   The expected reference time (Default: any)
        template (present) ManagementContainer mw_denmMgmtConWithReferenceTime(
            template (present) TimestampIts p_referenceTime := ?
        ) modifies mw_anyDenmMgmtCon := {
            referenceTime := p_referenceTime
tepelmann's avatar
tepelmann committed
         * @desc    Send template for ActionID
garciay's avatar
garciay committed
         * @param   p_sequenceNumber        The sequence number
         * @param   p_originatorStationID   The originator station id (Default: IUT's station id)
         */
        template (value) ActionID m_actionId(
tepelmann's avatar
tepelmann committed
            template (value) SequenceNumber p_sequenceNumber,
            template (value) ITS_Container.StationID p_originatorStationID := f_getIutStationId()
            originatingStationID := p_originatorStationID,
            sequenceNumber := p_sequenceNumber
        }
        
        /**
         * @desc    Receive template for ActionID
garciay's avatar
garciay committed
         * @param   p_originatorStationID   The expected originator station id (Default: any)
         * @param   p_sequenceNumber        The expected sequence number (Default: any)
berge's avatar
berge committed
        template (present) ActionID mw_actionId(
            template (present) ITS_Container.StationID p_originatorStationID := ?,
tepelmann's avatar
tepelmann committed
            template (present) SequenceNumber p_sequenceNumber := ?
            originatingStationID := p_originatorStationID,
            sequenceNumber := p_sequenceNumber
        }
        
berge's avatar
berge committed
        /**
tepelmann's avatar
tepelmann committed
         * @desc    Default receive template for any ActionID
berge's avatar
berge committed
         */
        template (present) ActionID mw_anyActionId := ?;
        
    } // end group decentralizedManagementTemplates
tepelmann's avatar
tepelmann committed
    
berge's avatar
berge committed
    group decentralizedSituationTemplates {
tepelmann's avatar
tepelmann committed
        
berge's avatar
berge committed
        group situationTemplates {
tepelmann's avatar
tepelmann committed
            
tepelmann's avatar
tepelmann committed
             * @desc    Send template for Situation Container
             * @param   p_cause                 The cause code
             * @param   p_subCause              The sub-cause code
garciay's avatar
garciay committed
             * @param   p_informationQuality    The information quality (Default: 0)
tepelmann's avatar
tepelmann committed
            template (value) SituationContainer m_situation(
                template (value) CauseCodeType p_cause, 
                template (value) SubCauseCodeType p_subCause,
berge's avatar
berge committed
                template (value) InformationQuality p_informationQuality := 0
tepelmann's avatar
tepelmann committed
            ) := {
tepelmann's avatar
tepelmann committed
                informationQuality := p_informationQuality,
                eventType := {
                    causeCode := p_cause,
                    subCauseCode := p_subCause
                },
                linkedCause := omit,
                eventHistory := omit
tepelmann's avatar
tepelmann committed
            }
            
tepelmann's avatar
tepelmann committed
             * @desc    Receive template for Situation Container
             * @param   p_cause                 The expected cause code
             * @param   p_subCause              The expected sub-cause code
             * @param   p_informationQuality    The expected information quality (Default: any)
             */
            template (present) SituationContainer mw_situation(
                template (present) CauseCodeType p_cause, 
                template (present) SubCauseCodeType p_subCause,
                template (present) InformationQuality p_informationQuality := ?
tepelmann's avatar
tepelmann committed
            ) := {
                informationQuality := p_informationQuality,
                eventType := {
                    causeCode := p_cause,
                    subCauseCode := p_subCause
                },
                linkedCause := *,
                eventHistory := *
tepelmann's avatar
tepelmann committed
            /**
tepelmann's avatar
tepelmann committed
             * @desc    Default receive template for Situation Container
             */
            template (present) SituationContainer mw_anySitutation := ?;
berge's avatar
berge committed
        } // end group situationTemplates
tepelmann's avatar
tepelmann committed
        
berge's avatar
berge committed
    } // end group decentralizedSituationTemplates
tepelmann's avatar
tepelmann committed
    
    group decentralizedLocationTemplates {
tepelmann's avatar
tepelmann committed
        
tepelmann's avatar
tepelmann committed
         * @desc    Send template for Location Container where no delta is given
tepelmann's avatar
tepelmann committed
        template (value) LocationContainer m_denmLocation_zeroDelta := {
            eventSpeed := omit,
            eventPositionHeading := omit,
            traces := {
                {
                    {
                        pathPosition := {
                            deltaLatitude := 0,
                            deltaLongitude := 0,
                            deltaAltitude := 0
tepelmann's avatar
tepelmann committed
                        },
                        pathDeltaTime := 0
                    }
            roadType := omit 
tepelmann's avatar
tepelmann committed
        }
        
tepelmann's avatar
tepelmann committed
         * @desc    Default receive template for Location Container
         */
        template (present) LocationContainer mw_anyDenmLocation := {
            eventSpeed := *,
            eventPositionHeading := *,
            traces := ?,
            roadType := *
tepelmann's avatar
tepelmann committed
         * @desc    Receive template for Location Container with the given traces
garciay's avatar
garciay committed
         * @param   p_traces    The expected traces.
         */
        template (present) LocationContainer mw_denmLocationWithTrace(
tepelmann's avatar
tepelmann committed
            template (present) Traces p_traces
        ) := {
            eventSpeed := *,
            eventPositionHeading := *,
            traces := p_traces,
            roadType := *
        }
        
    } // end group decentralizedLocationTemplates
    group alacarteTemplates {
tepelmann's avatar
tepelmann committed
        /**
         * @desc    Send template for Alacarte Container including lanePosition
tepelmann's avatar
tepelmann committed
         */
        template (value) AlacarteContainer m_alacarteConLaneCount := {
            lanePosition := 0,
tepelmann's avatar
tepelmann committed
            impactReduction := omit,
            externalTemperature := omit,
            roadWorks := omit,
            positioningSolution := omit,
            stationaryVehicle := omit
        }
         
        /**
         * @desc    Send template for Alacarte Container including impactReduction
         */
        template (value) AlacarteContainer m_alacarteConImpactReduction := {
            lanePosition := omit,
            impactReduction := m_impactReduction,
            externalTemperature := omit,
            roadWorks := omit,
            positioningSolution := omit,
            stationaryVehicle := omit
        }
        
        /**
         * @desc    Send template for ImpactReduction Container
         */
        template (value) ImpactReductionContainer m_impactReduction := {
            heightLonCarrLeft            := 100,
            heightLonCarrRight            := 100,
            posLonCarrLeft                := 127,
            posLonCarrRight             := 127,
            positionOfPillars             := { 30 },
            posCentMass                    := 63,
            wheelBaseVehicle            := 127,
            turningRadius                := 255,
            posFrontAx                    := 20,
            positionOfOccupants            := '00000000000000000000'B,
            vehicleMass                    := 1024,
            requestResponseIndication    := request
        }
         
        /**
         * @desc    Receive template for Alacarte Container including impactReduction
         */
        template (present) AlacarteContainer mw_alacarteConImpactReduction := {
            lanePosition := *,
            impactReduction := mw_impactReduction,
            externalTemperature := *,
            roadWorks := *,
            positioningSolution := *,
            stationaryVehicle := *
        }
        
        /**
         * @desc    Receive template for ImpactReductio nContainer
         */
        template (present) ImpactReductionContainer mw_impactReduction := {
            heightLonCarrLeft            := ?,
            heightLonCarrRight            := ?,
            posLonCarrLeft                := ?,
            posLonCarrRight             := ?,
            positionOfPillars             := ?,
            posCentMass                    := ?,
            wheelBaseVehicle            := ?,
            turningRadius                := ?,
            posFrontAx                    := ?,
            positionOfOccupants            := ?,
            vehicleMass                    := ?,
            requestResponseIndication    := response
    } // end alacarteTemplates
berge's avatar
berge committed
    
        template (present) bitstring mw_sspNoTrafficCondition        := '*0'B;
        template (present) bitstring mw_sspNoAccident                := '*0?'B;
        template (present) bitstring mw_sspNoRoadworks               := '*0??'B;
} // end LibItsDenmTemplates