/** * @author ETSI / STF449 * @version $URL$ * $Id$ * @desc Module containing base template definitions for DENM * */ module LibItsDenm_Templates { //LibIts import from LibItsCommon_TypesAndValues all; import from LibItsCommon_Functions all; import from LibItsDenm_TestSystem all; import from LibItsDenm_TypesAndValues all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; group primitivesTemplates { /** * @desc Send template for DEN Message (DenmPort Primitive) * @param p_denMsg DEN Message to be sent */ template (value) DenmReq m_denmReq( template (value) DENM p_denMsg ) := { msgOut := p_denMsg } /** * @desc Receive template for DEN Message (DenmPort Primitive) * @param p_denMsg Expected DEN Message */ template DenmInd mw_denmInd( template (present) DENM p_denMsg ) := { msgIn := p_denMsg, receptionTime := ? } group utPrimitives { /** * @desc Initializes the DENM IUT. */ template (value) UtInitialize m_denmInitialize := { } /** * @desc Send template for Upper Tester Trigger event */ template (value) UtTrigger m_utTriggerEvent( template (value) SituationContainer p_situation, template (value) LocationContainer p_location, template (omit) ValidityDuration p_validityDuration := omit, template (omit) TransmissionInterval p_transmissionInterval := omit, template (omit) boolean p_keepAliveForwardingRequest := omit, template (omit) AlacarteContainer p_alacarte := omit ) := { detectionTime := f_getCurrentTime(), validityDuration := c_validityDuration_10sec, repetitionDuration := 10, situtation := p_situation, location := p_location, alacarte := p_alacarte, relevanceDistance := lessThan50m, relevanceTrafficDirection := allTrafficDirection, trafficClass := 0, transmissionInterval := p_transmissionInterval, keepAliveForwardingRequest := p_keepAliveForwardingRequest } template (value) UtUpdate m_utUpdateEvent( 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) integer p_trafficClass := omit, template (omit) TransmissionInterval p_transmissionInterval := omit, template (omit) boolean p_keepAliveForwardingRequest := omit, template (omit) AlacarteContainer p_alacarte := omit ) := { actionId := p_actionId, detectionTime := f_getCurrentTime(), validityDuration := p_validityDuration, situation := p_situation, location := p_location, alacarte := p_alacarte, relevanceDistance := p_relevanceDistance, relevanceTrafficDirection := p_relevanceTrafficDirection, trafficClass := p_trafficClass, transmissionInterval := p_transmissionInterval, keepAliveForwardingRequest := p_keepAliveForwardingRequest } /** * @desc Send template for Upper Tester event cancellation * @param p_actionId Action ID of the event to be cancelled */ template (value) UtTermination m_utEventCancellation( in template (value) ActionID p_actionId ) := { actionId := p_actionId } } // end utPrimitives } // end primitives group denmPduTemplates { /** * @desc Send template for DENM PDU * @param p_denm DEN Message */ template (value) DENM m_denmPdu( in template (value) DecentralizedEnvironmentalNotificationMessage p_denm ) := { header := m_itsPduHeader, denm := p_denm } /** * @desc Receive template for DENM PDU * @param p_denm DEN Message */ template DENM mw_anyDenmPdu( in template (present) ItsPduHeader p_itsPduHeader := ?, in template (present) DecentralizedEnvironmentalNotificationMessage p_denm := ? ) := { header := p_itsPduHeader, denm := p_denm } /** * @desc Receive template for DENM PDU * @param p_denm DEN Message */ template DENM mw_denmPdu( in template (present) DecentralizedEnvironmentalNotificationMessage p_denm, template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := c_protocolVersionDenm, template (present) ItsPduHeader.messageID p_messageID := c_messageId ) := { header := mw_itsPduHeader(p_stationID, p_protocolVersion, p_messageID), denm := p_denm } } // end denmPduTemplates group headerTemplates { /** * @desc Default send template for ITS PDU header * @param p_stationID Source station ID * @param p_protocolVersion Protocol version (Default: current DENM protocol version) * @param p_messageID Message Id of DENM (Default: DENM message id) */ template (value) ItsPduHeader m_itsPduHeader( template (value) StationID p_stationID := f_getTsStationId(), template (value) ItsPduHeader.protocolVersion p_protocolVersion := c_protocolVersionDenm, template (value) ItsPduHeader.messageID p_messageID := c_messageId ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, stationID := p_stationID } /** * @desc Default receive template for ITS PDU header */ template ItsPduHeader mw_itsPduHeader( template (present) StationID p_stationID := ?, template (present) ItsPduHeader.protocolVersion p_protocolVersion := c_protocolVersionDenm, template (present) ItsPduHeader.messageID p_messageID := c_messageId ) := { protocolVersion := p_protocolVersion, messageID := p_messageID, stationID := p_stationID } template (present) StationID mw_anyStationId := ?; } // end headerTemplates group positionTemplates { 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, elevation := m_elevation } template (value) PosConfidenceEllipse m_posConfidenceEllipse( template (value) SemiAxisLength p_semiMajorConfidence := c_semiAxisLengthOneCentimeter, template (value) SemiAxisLength p_semiMinorConfidence := c_semiAxisLengthOneCentimeter, template (value) Direction p_semiMajorOrientation := m_direction ) := { semiMajorConfidence := p_semiMajorConfidence, semiMinorConfidence := p_semiMinorConfidence, semiMajorOrientation := p_semiMajorOrientation } template (value) Direction m_direction := { directionValue := c_directionValueNorth, directionConfidence := c_directConfidenceWithinZeroPointOneDegree } template (value) Elevation m_elevation( template (value) ElevationValue p_elevationValue := c_seaLevel, template (value) ElevationConfidence p_elevationConfidence := c_withinOneMeter ) := { elevationValue := p_elevationValue, elevationConfidence := p_elevationConfidence } } // end positionTemplates group decentralizedEnvironmentalNotificationMessageTemplates { /** * @desc Send template for DEN Message * @param p_mgmt Decentralized Situation Management * @param p_sit Decentralized Situation * @param p_loc Decentralized Situation Location */ template (value) DecentralizedEnvironmentalNotificationMessage m_denm( template (value) ManagementContainer p_mgmt, template (omit) SituationContainer p_sit, template (omit) LocationContainer p_loc, template (omit) AlacarteContainer p_alacarte := omit ) := { management := p_mgmt, situation := p_sit, location := p_loc, alacarte := p_alacarte } /** * @desc Default receive template for DEN Message */ template DecentralizedEnvironmentalNotificationMessage mw_anyDenm := { management := ?, situation := *, location := *, alacarte := * } /** * @desc Receive template for DEN Message * @param p_mgmt Decentralized Situation Management * @param p_sit Decentralized Situation * @see mw_anyDenm */ template DecentralizedEnvironmentalNotificationMessage mw_denm( template (present) ManagementContainer p_mgmt := ?, template SituationContainer p_sit := *, template LocationContainer p_loc := *, template AlacarteContainer p_alacarte := * ) modifies mw_anyDenm := { management := p_mgmt, situation := p_sit, location := p_loc, alacarte := p_alacarte } /** * @desc Send template for DEN Message for event termination. */ template (value) DecentralizedEnvironmentalNotificationMessage m_denmCancellation( template (value) ActionID p_actionID ) := { management := m_denmMgmtCon(p_actionID, c_dataVersionCancellation), situation := omit, location := omit, alacarte := omit } /** * @desc Send template for DEN Message for event termination. */ template (value) DecentralizedEnvironmentalNotificationMessage m_denmNegation( template (value) ActionID p_actionID, template (value) DataVersion p_dataVersion ) := { management := m_denmMgmtCon(p_actionID, p_dataVersion, true), situation := omit, location := omit, alacarte := omit } } // end group decentralizedEnvironmentalNotificationMessageTemplates group decentralizedManagementTemplates { /** * @desc Send template for Decentralized Situation Management * @param p_dataVersion Data version * @param p_stationId Station ID of the source */ template (value) ManagementContainer m_denmMgmtCon( template (value) ActionID p_actionID, template (value) DataVersion p_dataVersion, template (value) boolean p_isNegation := false, template (omit) ValidityDuration p_validityDuration := omit, template (omit) TransmissionInterval p_transmissionInterval := omit ) := { actionID := p_actionID, dataVersion := p_dataVersion, detectionTime := f_getCurrentTime(), isNegation := p_isNegation, eventPosition := m_tsPosition, relevanceDistance := lessThan50m, relevanceTrafficDirection := allTrafficDirection, validityDuration := p_validityDuration, transmissionInterval := p_transmissionInterval } /** * @desc Reception template for Decentralized Situation Management * @param p_dataVersion Data version * @param p_stationId Station ID of the source */ template ManagementContainer mw_denmMgmtCon( template (present) ActionID p_actionID, template (present) DataVersion p_dataVersion := ?, template (present) boolean p_isNegation := false, template ValidityDuration p_validityDuration := *, template TransmissionInterval p_transmissionInterval := * ) := { actionID := p_actionID, dataVersion := p_dataVersion, detectionTime := ?, isNegation := p_isNegation, eventPosition := ?, relevanceDistance := ?, relevanceTrafficDirection := allTrafficDirection, validityDuration := p_validityDuration, transmissionInterval := p_transmissionInterval } /** * @desc Send template for Test system ActionID */ template (value) ActionID m_tsActionId := { originatorStationID := f_getTsStationId(), sequenceNumber := 0 } /** * @desc Receive template for Management Container */ template ManagementContainer mw_anyDenmMgmtCon := { actionID := ?, dataVersion := ?, detectionTime := ?, isNegation := ?, eventPosition := ?, relevanceDistance := ?, relevanceTrafficDirection := ?, validityDuration := *, transmissionInterval := * } /** * @desc Receive template for Management Container */ template ManagementContainer mw_denmMgmtConWithActionID( in template (present) ActionID p_actionId := ? ) modifies mw_anyDenmMgmtCon := { actionID := p_actionId } /** * @desc Receive template for Management Container */ template ManagementContainer mw_denmMgmtConWithDataVersion( in template (present) DataVersion p_dataVersion := ? ) modifies mw_anyDenmMgmtCon := { dataVersion := p_dataVersion } /** * @desc Receive template for ActionID */ template (value) ActionID m_actionId( in template (value) SequenceNumber p_sequenceNumber, in template (value) ITS_Container.StationID p_originatorStationID := f_getIutStationId() ) := { originatorStationID := p_originatorStationID, sequenceNumber := p_sequenceNumber } /** * @desc Receive template for ActionID */ template (present) ActionID mw_actionId( in template (present) ITS_Container.StationID p_originatorStationID := ?, in template (present) SequenceNumber p_sequenceNumber := ? ) := { originatorStationID := p_originatorStationID, sequenceNumber := p_sequenceNumber } /** * @desc Receive template for any ActionID */ template (present) ActionID mw_anyActionId := ?; } // end group decentralizedManagementTemplates group decentralizedSituationTemplates { group situationTemplates { /** * @desc Send template for situation * @param p_cause Cause code * @param p_subCause Sub-cause code */ template (value) SituationContainer m_situation( template (value) CauseCodeType p_cause, template (value) SubCauseCodeType p_subCause, template (value) InformationQuality p_informationQuality := 0 //TODO what value here??? ) := { informationQuality := p_informationQuality, eventType := { causeCode := p_cause, subCauseCode := p_subCause }, linkedCause := omit } /** * @desc Receive template for situation * @param p_cause Cause code * @param p_subCause Sub-cause code * @param p_informationQuality Information quality */ template (present) SituationContainer mw_situation( template (present) CauseCodeType p_cause, template (present) SubCauseCodeType p_subCause, template (present) InformationQuality p_informationQuality := ? ) := { informationQuality := p_informationQuality, eventType := { causeCode := p_cause, subCauseCode := p_subCause }, linkedCause := * } /** * @desc Default receive template for any decentralized situation */ template SituationContainer mw_anySitutation := ?; } // end group situationTemplates } // end group decentralizedSituationTemplates group decentralizedLocationTemplates { /** * @desc Send template for location */ template (value) LocationContainer m_denmLocation_zeroDelta := { eventSpeed := omit, eventPositionHeading := omit, traces := { { { pathPosition := { deltaLatitude := 0, deltaLongitude := 0, deltaElevation := 0 }, pathDeltaTime := 0 } } }, roadClass := omit } /** * @desc Receive template for location */ template (present) LocationContainer mw_anyDenmLocation := { eventSpeed := *, eventPositionHeading := *, traces := ?, roadClass := * } /** * @desc Receive template for location */ template (present) LocationContainer mw_denmLocationWithTrace( in template (present) Traces p_traces ) := { eventSpeed := *, eventPositionHeading := *, traces := p_traces, roadClass := * } } // end group decentralizedLocationTemplates group alacateTemplates { template AlacarteContainer m_alacarteConLaneCount := { laneCount := { laneNumber := 2, laneNumberConfidence := 100 }, impactReduction := omit, externalTemperature := omit, roadWorks := omit, positioningSolution := omit, stationaryVehicle := omit } } // end alacateTemplates } // end LibItsDenmTemplates