/** * @author ETSI / STF405 * @version $URL$ * $Id$ * @desc Module containing base template definitions for DENM * */ module LibItsDenm_Templates { //LibIts import from DENM_PDU_Descriptions language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; import from LibIts_Interface all; import from LibItsDenm_TypesAndValues all; import from LibItsCommon_TypesAndValues 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) DenmPdu 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) DenmPdu p_denMsg ) := { msgIn := p_denMsg, receptionTime := ? } group utPrimitives { /** * @desc Initializes the DENM IUT. */ template (value) UtInitialize m_denmInitialize := { utDenmInitialize := { } } /** * @desc Send template for Upper Tester event * @param p_situation Situation */ template (value) UtEvent m_utEvent(in template (value) Situation p_situation) := { utDenmEvent := { situation := p_situation, eventOption := omit } } /** * @desc Send template for Upper Tester event cancellation * @param p_situation Situation * @param p_actionId Action ID of the event to be cancelled */ template (value) UtEvent m_utEventCancellation( in template (value) Situation p_situation, in template (value) ActionID p_actionId ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventCancellation := p_actionId } } } /** * @desc Send template for Upper Tester event negation * @param p_situation Situation * @param p_actionId Action ID of the event to be negated * @see m_utEvent */ template (value) UtEvent m_utEventNegation( in template (value) Situation p_situation, in template (value) ActionID p_actionId ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventNegation := p_actionId } } } /** * @desc Send template for Upper Tester event with Traffic flow effect * @param p_situation Situation * @param p_trafficFlowEffect Traffic flow effect */ template (value) UtEvent m_utEventTrafficFlowEffect( in template (value) Situation p_situation, in template (value) TrafficFlowEffect p_trafficFlowEffect ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventTrafficFlowEffect := p_trafficFlowEffect } } } /** * @desc Send template for Upper Tester event with linked cause * @param p_situation Situation * @param p_linkedCause Linked situation */ template (value) UtEvent m_utEventLinkedCause( in template (value) Situation p_situation, in template (value) Situation p_linkedCause ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventLinkedCause := p_linkedCause } } } /** * @desc Send template for Upper Tester event update of expiration time * @param p_situation Situation * @param p_actionId ActionID of the event * @param p_expirationTime Expiration time */ template (value) UtEvent m_utUpdateEventExpirationTime( in template (value) Situation p_situation, in template (value) ActionID p_actionId, in template (value) TimeStamp p_expirationTime ) modifies m_utEvent := { utDenmEvent := { eventOption := { updateEventExpiry := { eventActionId := p_actionId, expiryTime := p_expirationTime } } } } /** * @desc Send template for Upper Tester event with expiration time * @param p_situation Situation * @param p_expirationTime Expiration time */ template (value) UtEvent m_utEventExpirationTime( in template (value) Situation p_situation, in template (value) TimeStamp p_expirationTime ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventExpirationTime := p_expirationTime } } } /** * @desc Send template for Upper Tester event with expiration time and frequency * @param p_situation Situation * @param p_expirationTime Expiration time * @param p_frequency Frequency */ template (value) UtEvent m_utEventExpirationTimeFrequency( in template (value) Situation p_situation, in template (value) TimeStamp p_expirationTime, in template (value) DecentralizedSituationManagement.frequency p_frequency ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventExpirationTimeFrequency := { p_expirationTime, p_frequency } } } } /** * @desc Send template for Upper Tester event with characteristics * @param p_situation Situation * @param p_eventCharact Event characteristics */ template (value) UtEvent m_utEventCharact( in template (value) Situation p_situation, in template (value) DecentralizedSituation.eventCharact p_eventCharact ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventCharact := p_eventCharact } } } /** * @desc Send template for Upper Tester event with reliability * @param p_situation Situation * @param p_eventReliability Event reliability */ template (value) UtEvent m_utEventReliability( in template (value) Situation p_situation, in template (value) DecentralizedSituationManagement.reliability p_eventReliability ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventReliability := p_eventReliability } } } /** * @desc Send template for Upper Tester event with severity * @param p_situation Situation * @param p_eventSeverity Event severity */ template (value) UtEvent m_utEventSeverity( in template (value) Situation p_situation, in template (value) Severity p_eventSeverity ) modifies m_utEvent := { utDenmEvent := { eventOption := { eventSeverity := p_eventSeverity } } } } // end utPrimitives } // end primitives group denmPduTemplates { /** * @desc Default send template for ITS PDU header * @remark generationTime 0 indicates that the lower layer should add the time while sending */ template (value) ItsPduHeader m_itsPduHeader := { protocolVersion := c_protocolVersionDenm, messageID := c_messageId, generationTime := 0 } /** * @desc Default receive template for ITS PDU header */ template ItsPduHeader mw_itsPduHeader := { protocolVersion := c_protocolVersionDenm, messageID := c_messageId, generationTime := ? } /** * @desc Send template for DENM PDU * @param p_denm DEN Message */ template (value) DenmPdu 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 DenmPdu mw_denmPdu( in template (present) DecentralizedEnvironmentalNotificationMessage p_denm ) := { header := mw_itsPduHeader, denm := p_denm } } // end denmPduTemplates 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) DecentralizedSituationManagement p_mgmt, template (value) DecentralizedSituation p_sit, template (value) DecentralizedSituationLocation p_loc ) := { management := p_mgmt, situation := p_sit, location := p_loc } /** * @desc Default receive template for DEN Message */ template DecentralizedEnvironmentalNotificationMessage mw_anyDenm := { management := ?, situation := ?, location := ? } /** * @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) DecentralizedSituationManagement p_mgmt, template (present) DecentralizedSituation p_sit ) modifies mw_anyDenm := { management := p_mgmt, situation := p_sit } /** * @desc Send template for DENM with cause * @param p_dataVersion Data version * @param p_sit Situation * @param p_eventPosition Event Position * @param p_stationId Source station ID */ template (value) DecentralizedEnvironmentalNotificationMessage m_denmWithCause( template (value) DataVersion p_dataVersion, template (value) Situation p_sit, template (value) DecentralizedSituationLocation.eventPosition p_eventPosition, template (value) StationID p_stationId ) := { management := m_denmMgmtCon(p_dataVersion, p_stationId), situation := m_denmSitCon(p_sit, informative), location := m_denmSitLoc( p_eventPosition, m_locationRef ) } /** * @desc Send template for DENM with cause and negation * @param p_dataVersion Data version * @param p_sit Situation * @param p_eventPosition Event Position * @param p_stationId Source station ID * @param p_isNeg Is it a negation * @see m_denmWithCause */ template (value) DecentralizedEnvironmentalNotificationMessage m_denmWithCauseIsNeg( template (value) DataVersion p_dataVersion, template (value) Situation p_sit, template (value) DecentralizedSituationLocation.eventPosition p_eventPosition, template (value) StationID p_stationId, template (value) DecentralizedSituationManagement.isNegation p_isNeg ) modifies m_denmWithCause := { management := m_denmMgmtCon_isNeg(p_dataVersion, p_stationId, p_isNeg) } /** * @desc Default receive template for any decentralized situation */ template DecentralizedSituation mw_anySitutation := ?; } // end group decentralizedEnvironmentalNotificationMessageTemplates group decentralizedSituationManagementTemplates { /** * @desc Send template for Decentralized Situation Management * @param p_dataVersion Data version * @param p_stationId Station ID of the source */ template (value) DecentralizedSituationManagement m_denmMgmtCon( template (value) DataVersion p_dataVersion, template (value) StationID p_stationId ) := { actionID := { stationID := p_stationId, sequenceNo := 0 }, dataVersion := p_dataVersion, expiryTime := omit, frequency := omit, reliability := 0, isNegation := false } /** * @desc Send template for Decentralized Situation Management with negation * @param p_dataVersion Data version * @param p_stationId Station ID of the source * @param p_isNeg Is it a negation * @see m_denmMgmtCon */ template (value) DecentralizedSituationManagement m_denmMgmtCon_isNeg( template (value) DataVersion p_dataVersion, template (value) StationID p_stationId, template (value) DecentralizedSituationManagement.isNegation p_isNeg ) modifies m_denmMgmtCon := { isNegation := p_isNeg } /** * @desc Receive template for Decentralized Situation Management * @param p_dataVersion Data version */ template DecentralizedSituationManagement mw_denmMgmtCon ( template (present) DataVersion p_dataVersion ):= { actionID := { stationID := ?, sequenceNo := ? }, dataVersion := p_dataVersion, expiryTime := *, frequency := *, reliability := ?, isNegation := ? } /** * @desc Receive template for Decentralized Situation Management with negation * @param p_dataVersion Data version * @param p_isNeg Is it a negation * @see mw_denmMgmtCon */ template DecentralizedSituationManagement mw_denmMgmtCon_isNeg( template (present) DataVersion p_dataVersion, template (present) DecentralizedSituationManagement.isNegation p_isNeg ) modifies mw_denmMgmtCon := { isNegation := p_isNeg } /** * @desc Receive template for Decentralized Situation Management with expiry time * @param p_dataVersion Data version * @param p_expiryTime Expiry time * @see mw_denmMgmtCon */ template DecentralizedSituationManagement mw_denmMgmtConWithExpiryTime( template (present) DataVersion p_dataVersion, template (present) DecentralizedSituationManagement.expiryTime p_expiryTime ) modifies mw_denmMgmtCon := { expiryTime := p_expiryTime } /** * @desc Receive template for Decentralized Situation Management with expiry time * @param p_dataVersion Data version * @param p_reliability Reliability * @param p_isNeg Is it a negation * @see mw_denmMgmtCon */ template DecentralizedSituationManagement mw_denmMgmtConWithReliability_isNeg( template (present) DataVersion p_dataVersion, template (present) DecentralizedSituationManagement.reliability p_reliability, template (present) DecentralizedSituationManagement.isNegation p_isNeg ) modifies mw_denmMgmtCon := { reliability := p_reliability, isNegation := p_isNeg } /** * @desc Default receive template for expiry time */ template DecentralizedSituationManagement.expiryTime mw_anyExpiryTime := ?; } // end group decentralizedSituationManagementTemplates group decentralizedSituationTemplates { /** * @desc Send template for decentralized situation * @param p_sit Situation * @param p_sev Severity */ template (value) DecentralizedSituation m_denmSitCon( template (value) Situation p_sit, template (value) Severity p_sev ) := { trafficFlowEffect := omit, situation := p_sit, linkedCause := omit, severity := p_sev, eventCharact := omit, vehicleCommonParameters := omit, profile := omit } /** * @desc Default receive template for decentralized situation */ template DecentralizedSituation mw_denmSitCon := { trafficFlowEffect := *, situation := ?, linkedCause := *, severity := ?, eventCharact := *, vehicleCommonParameters := *, profile := * } /** * @desc Receive template for decentralized situation with specific situation * @param p_sit Situation * @see mw_denmSitCon */ template DecentralizedSituation mw_denmSitCon_sit( template (present) Situation p_sit ) modifies mw_denmSitCon := { situation := p_sit } /** * @desc Receive template for decentralized situation with specific situation * and traffic flow effect * @param p_sit Situation * @param p_tfe Traffic flow effect * @see mw_denmSitCon_sit */ template DecentralizedSituation mw_denmSitCon_sitTfe( template (present) Situation p_sit, template (present) TrafficFlowEffect p_tfe ) modifies mw_denmSitCon_sit := { trafficFlowEffect := p_tfe } /** * @desc Receive template for decentrelized situation with specific situation * and linked cause * @param p_sit Situation * @param p_lc Linked Situation * @see mw_denmSitCon_sit */ template DecentralizedSituation mw_denmSitCon_sitLc( template (present) Situation p_sit, template (present) Situation p_lc ) modifies mw_denmSitCon_sit := { linkedCause := p_lc } /** * @desc Receive template for decentrelized situation with specific situation * and event characteristics * @param p_sit Situtation * @param p_ec Event characteristics * @see mw_denmSitCon_sit */ template DecentralizedSituation mw_denmSitCon_sitEc( template (present) Situation p_sit, template (present) DecentralizedSituation.eventCharact p_ec ) modifies mw_denmSitCon_sit := { eventCharact := p_ec } group situationTemplates { /** * @desc Send template for situation * @param p_cause Cause code * @param p_subCause Sub-cause code */ template (value) Situation m_situation( template (value) DENM_PDU_Descriptions.CauseCode p_cause, template (value) SubCauseCode p_subCause ) := { cause := p_cause, subCause := p_subCause } /** * @desc Receive template for situation * @param p_cause Cause code * @param p_subCause Sub-cause code */ template Situation mw_situation( template (present) DENM_PDU_Descriptions.CauseCode p_cause, template (present) SubCauseCode p_subCause ) := { cause := p_cause, subCause := p_subCause } /** * @desc Default receive template for ant sub-cause */ template SubCauseCode mw_anySubCause := ?; } // end group situationTemplates group eventCharactTemplates { /** * @desc Default send template for event characteristics */ template (value) DecentralizedSituation.eventCharact m_eventCharact := { eventmobility := true, causeType := geographicalRegion, relevance := difficultDrivingConditions, timeCriticality := false } } // end eventCharactTemplates } // end group decentralizedSituationTemplates group decentralizedSituationLocationTemplates { /** * @desc Send template for relevance area * @param p_refPosition Reference position of event */ template (value) RelevanceArea m_denmRelevanceArea( ReferencePosition p_refPosition ) := { geoAreaCenterLatitude := p_refPosition.latitude, geoAreaCenterLongitude := p_refPosition.longitude, shape := { circle := { radius := 1000 /* FIXME hard-coded value */ } }, directionalityFilter := omit, disseminationAreaSize := same } /** * @desc Receive template for relevance area */ template RelevanceArea mw_denmRelevanceArea := { geoAreaCenterLatitude := ?, geoAreaCenterLongitude := ?, shape := ?, directionalityFilter := *, disseminationAreaSize := ? } /** * @desc Send template for situation location * @param p_eventPosition Event position * @param p_locationRef Location reference */ template (value) DecentralizedSituationLocation m_denmSitLoc( template (value) DecentralizedSituationLocation.eventPosition p_eventPosition, template (value) DecentralizedSituationLocation.locationRef p_locationRef ) := { eventPosition := p_eventPosition, locationRef := p_locationRef, relevanceArea := m_denmRelevanceArea(p_eventPosition.eventPositionCurrentDefinition.refPosition) } /** * @desc Receive template for situation location * @param p_eventPosition Event position * @param p_locationRef Location reference */ template DecentralizedSituationLocation mw_denmSitLoc ( template (present) DecentralizedSituationLocation.eventPosition p_eventPosition, template (present) DecentralizedSituationLocation.locationRef p_locationRef ) := { eventPosition := p_eventPosition, locationRef := p_locationRef, relevanceArea := mw_denmRelevanceArea } /** * @desc Send template for event position * @param p_referencePosition Reference position of the event */ template (value) DecentralizedSituationLocation.eventPosition m_eventPosition ( template (value) ReferencePosition p_referencePosition ) := { eventPositionCurrentDefinition := { refPosition := p_referencePosition, eventSpeed := omit } } group locationRefTemplates { /** * @desc Default send template for location reference */ template (value) DecentralizedSituationLocation.locationRef m_locationRef := { trace := { traceID := 0, waypoints := {} } } } // end group locationRefTemplates } // end group decentralizedSituationLocationTemplates } // end LibItsDenmTemplates