Commit 39200759 authored by garciay's avatar garciay
Browse files

Validate RSUsimulator against AtsDenm in secured mode

parent f46b81d6
...@@ -11,6 +11,11 @@ module ItsRSUsSimulator_Functions { ...@@ -11,6 +11,11 @@ module ItsRSUsSimulator_Functions {
import from ITS_Container language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all; import from DENM_PDU_Descriptions language "ASN.1:1997" all;
import from MAPEM_PDU_Descriptions language "ASN.1:1997" all;
import from SPATEM_PDU_Descriptions language "ASN.1:1997" all;
import from IVIM_PDU_Descriptions language "ASN.1:1997" all;
import from SREM_PDU_Descriptions language "ASN.1:1997" all;
import from SSEM_PDU_Descriptions language "ASN.1:1997" all;
// LibItsCommon // LibItsCommon
import from LibItsCommon_Functions all; import from LibItsCommon_Functions all;
...@@ -52,9 +57,10 @@ module ItsRSUsSimulator_Functions { ...@@ -52,9 +57,10 @@ module ItsRSUsSimulator_Functions {
var template (value) DenmParmContainers v_denmParmContainers; var template (value) DenmParmContainers v_denmParmContainers;
var template (omit) DENMs v_denms := omit; var template (omit) DENMs v_denms := omit;
var template (omit) CAM v_cam := omit; var template (omit) CAM v_cam := omit;
// var template (omit) MAPEM v_mapem := omit; var template (omit) MAPEM v_mapem := omit;
// var template (omit) SPATEMs v_spatems := omit; var template (omit) SPATEMs v_spatems := omit;
// var template (omit) SSEM v_ssem := omit; var template (omit) IVIM v_ivim := omit;
var template (omit) SSEM v_ssem := omit;
var integer v_counter; var integer v_counter;
// Map // Map
...@@ -79,9 +85,11 @@ module ItsRSUsSimulator_Functions { ...@@ -79,9 +85,11 @@ module ItsRSUsSimulator_Functions {
if (PICS_GENERATE_DENM) { if (PICS_GENERATE_DENM) {
// Build the list of the DENM events // Build the list of the DENM events
for (v_counter := 0; v_counter < lengthof(PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1]); v_counter := v_counter + 1) { for (v_counter := 0; v_counter < lengthof(PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1]); v_counter := v_counter + 1) {
// Build DENM with dynamic values
v_denmParmContainers := m_denmParmContainers( v_denmParmContainers := m_denmParmContainers(
PICS_RSU_PARAMS[PX_RSU_ID - 1].stationID, PICS_RSU_PARAMS[PX_RSU_ID - 1].stationID,
f_getDenmSequenceNumber(), f_getDenmSequenceNumber(),
PICS_DENM_REPETITION_INTERVAL,
PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventPosition, PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventPosition,
PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].causeCodeType, PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].causeCodeType,
PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventHistory PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].eventHistory
...@@ -93,6 +101,9 @@ module ItsRSUsSimulator_Functions { ...@@ -93,6 +101,9 @@ module ItsRSUsSimulator_Functions {
v_denmParmContainers.situationContainer, v_denmParmContainers.situationContainer,
v_denmParmContainers.locationContainer v_denmParmContainers.locationContainer
))); )));
if (ispresent(PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].roadWorksContainerExtended)) {
v_denms[v_counter].denm.alacarte := m_alacarte(PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][v_counter].roadWorksContainerExtended);
}
} // End of 'for' loop } // End of 'for' loop
} }
if (PICS_GENERATE_CAM) { if (PICS_GENERATE_CAM) {
...@@ -109,14 +120,15 @@ module ItsRSUsSimulator_Functions { ...@@ -109,14 +120,15 @@ module ItsRSUsSimulator_Functions {
); );
} }
// Build the messages value list for this RSU // Build the messages value list for this RSU
vc_rsuMessagesValueList[PX_RSU_ID - 1] := valueof( vc_rsuMessagesValueList[PX_RSU_ID - 1] :=
m_rsuProfile( m_rsuProfile(
v_cam, v_cam,
v_denms/*, v_denms,
v_mapem, v_mapem,
v_spatems v_spatems,
v_ssem*/ v_ivim,
)); v_ssem
);
if (PICS_RSU_PARAMS[PX_RSU_ID - 1].geoShape == e_geoCircle) { if (PICS_RSU_PARAMS[PX_RSU_ID - 1].geoShape == e_geoCircle) {
vc_geoArea := f_computeCircularArea(vc_longPosVectorRsu, PICS_RSU_PARAMS[PX_RSU_ID - 1].geoParms.radius); vc_geoArea := f_computeCircularArea(vc_longPosVectorRsu, PICS_RSU_PARAMS[PX_RSU_ID - 1].geoParms.radius);
} else { } else {
...@@ -129,6 +141,8 @@ module ItsRSUsSimulator_Functions { ...@@ -129,6 +141,8 @@ module ItsRSUsSimulator_Functions {
function f_cf01Down() runs on ItsRSUsSimulator { function f_cf01Down() runs on ItsRSUsSimulator {
vc_rsuMessagesValueList := {};
f_uninitialiseSecuredMode(); f_uninitialiseSecuredMode();
// Unmap // Unmap
......
...@@ -105,6 +105,11 @@ module ItsRSUsSimulator_Pics { ...@@ -105,6 +105,11 @@ module ItsRSUsSimulator_Pics {
altitudeConfidence := unavailable altitudeConfidence := unavailable
} // End of PICS_DENM_ALTITUDE } // End of PICS_DENM_ALTITUDE
/**
* @desc DENM repetition interval, in ms
*/
modulepar TransmissionInterval PICS_DENM_REPETITION_INTERVAL := 1000;
} // End of group denmCommonParams } // End of group denmCommonParams
group denmZone1 { group denmZone1 {
...@@ -136,6 +141,24 @@ module ItsRSUsSimulator_Pics { ...@@ -136,6 +141,24 @@ module ItsRSUsSimulator_Pics {
eventDeltaTime := omit, eventDeltaTime := omit,
informationQuality := 0 informationQuality := 0
} }
},
roadWorksContainerExtended := {
lightBarSirenInUse := omit,
closedLanes := {
hardShoulderStatus := availableForDriving,
drivingLaneStatus := '0001'B
},
restriction := omit,
speedLimit := 30,
incidentIndication := omit,
recommendedPath := omit,
startingPointSpeedLimit := {
deltaLatitude := 0,
deltaLongitude := 0,
deltaAltitude := 0
},
trafficFlowRule := passToRight,
referenceDenms := omit
} }
} // End of PICS_Z1_D1_EP } // End of PICS_Z1_D1_EP
...@@ -166,6 +189,24 @@ module ItsRSUsSimulator_Pics { ...@@ -166,6 +189,24 @@ module ItsRSUsSimulator_Pics {
eventDeltaTime := omit, eventDeltaTime := omit,
informationQuality := 0 informationQuality := 0
} }
},
roadWorksContainerExtended := {
lightBarSirenInUse := omit,
closedLanes := {
hardShoulderStatus := availableForDriving,
drivingLaneStatus := '0011'B
},
restriction := omit,
speedLimit := 30,
incidentIndication := omit,
recommendedPath := omit,
startingPointSpeedLimit := {
deltaLatitude := 0,
deltaLongitude := 0,
deltaAltitude := 0
},
trafficFlowRule := passToRight,
referenceDenms := omit
} }
} // End of PICS_Z1_D2_EP } // End of PICS_Z1_D2_EP
...@@ -196,6 +237,24 @@ module ItsRSUsSimulator_Pics { ...@@ -196,6 +237,24 @@ module ItsRSUsSimulator_Pics {
eventDeltaTime := omit, eventDeltaTime := omit,
informationQuality := 0 informationQuality := 0
} }
},
roadWorksContainerExtended := {
lightBarSirenInUse := omit,
closedLanes := {
hardShoulderStatus := closed,
drivingLaneStatus := '01'B
},
restriction := omit,
speedLimit := 30,
incidentIndication := omit,
recommendedPath := omit,
startingPointSpeedLimit := {
deltaLatitude := 0,
deltaLongitude := 0,
deltaAltitude := 0
},
trafficFlowRule := passToRight,
referenceDenms := omit
} }
} // End of PICS_Z1_D3_EP } // End of PICS_Z1_D3_EP
...@@ -305,7 +364,7 @@ module ItsRSUsSimulator_Pics { ...@@ -305,7 +364,7 @@ module ItsRSUsSimulator_Pics {
/** /**
* @desc DENM frequency timer * @desc DENM frequency timer
*/ */
modulepar float PICS_DENM_FREQUENY := 0.1; modulepar float PICS_DENM_FREQUENY := int2float(PICS_DENM_REPETITION_INTERVAL) / 1000.0;
/** /**
* @desc MAPEM frequency timer * @desc MAPEM frequency timer
......
...@@ -10,7 +10,6 @@ module ItsRSUsSimulator_Templates { ...@@ -10,7 +10,6 @@ module ItsRSUsSimulator_Templates {
import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; import from MAPEM_PDU_Descriptions language "ASN.1:1997" all;
import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; import from SPATEM_PDU_Descriptions language "ASN.1:1997" all;
import from IVIM_PDU_Descriptions language "ASN.1:1997" all; import from IVIM_PDU_Descriptions language "ASN.1:1997" all;
import from SREM_PDU_Descriptions language "ASN.1:1997" all;
import from SSEM_PDU_Descriptions language "ASN.1:1997" all; import from SSEM_PDU_Descriptions language "ASN.1:1997" all;
import from DSRC language "ASN.1:1997" all; import from DSRC language "ASN.1:1997" all;
...@@ -45,17 +44,18 @@ module ItsRSUsSimulator_Templates { ...@@ -45,17 +44,18 @@ module ItsRSUsSimulator_Templates {
import from ItsRSUsSimulator_Pics all; import from ItsRSUsSimulator_Pics all;
template (omit) RsuMessagesValue m_rsuProfile( template (omit) RsuMessagesValue m_rsuProfile(
in template (value) CAM p_cam, in template (omit) CAM p_cam := omit,
in template (value) DENMs p_denms, in template (omit) DENMs p_denms := omit,
in template (omit) MAPEM p_mapem := omit, in template (omit) MAPEM p_mapem := omit,
in template (omit) SPATEM p_spatem := omit, in template (omit) SPATEMs p_spatems := omit,
in template (omit) IVIM p_ivim := omit in template (omit) IVIM p_ivim := omit,
in template (omit) SSEM p_ssem := omit
) := { ) := {
cam := p_cam, cam := p_cam,
denms := p_denms, denms := p_denms,
mapem := p_mapem, mapem := p_mapem,
spatem := p_spatem, spatems := p_spatems,
ivim := p_ivim ivim := p_ivim
} // End of template RsuMessagesValue } // End of template RsuMessagesValue
group geoNetworkingTemplates { group geoNetworkingTemplates {
...@@ -170,9 +170,24 @@ module ItsRSUsSimulator_Templates { ...@@ -170,9 +170,24 @@ module ItsRSUsSimulator_Templates {
group denmTemplates { group denmTemplates {
/**
* @desc Send template for Alacarte Container including lanePosition
*/
template (omit) AlacarteContainer m_alacarte(
in template (omit) RoadWorksContainerExtended p_roadWorksContainerExtended
) := {
lanePosition := omit,
impactReduction := omit,
externalTemperature := omit,
roadWorks := p_roadWorksContainerExtended,
positioningSolution := omit,
stationaryVehicle := omit
}
template (value) DenmParmContainers m_denmParmContainers( template (value) DenmParmContainers m_denmParmContainers(
in template (value) StationID p_originatingStationID, in template (value) StationID p_originatingStationID,
in template (value) SequenceNumber p_sequenceNumber, in template (value) SequenceNumber p_sequenceNumber,
in template (value) TransmissionInterval p_repetitionInterval,
in template (value) ReferencePosition p_eventPosition, in template (value) ReferencePosition p_eventPosition,
in template (value) CauseCodeType p_causeCodeType, in template (value) CauseCodeType p_causeCodeType,
in template (value) EventHistory p_eventHistory, in template (value) EventHistory p_eventHistory,
...@@ -184,14 +199,14 @@ module ItsRSUsSimulator_Templates { ...@@ -184,14 +199,14 @@ module ItsRSUsSimulator_Templates {
originatingStationID := p_originatingStationID, originatingStationID := p_originatingStationID,
sequenceNumber := p_sequenceNumber sequenceNumber := p_sequenceNumber
}, },
detectionTime := f_getCurrentTime(), detectionTime := 0,
referenceTime := 0, referenceTime := f_getCurrentTime(), // FIXME To be checked
termination := omit, termination := omit,
eventPosition := p_eventPosition, eventPosition := p_eventPosition,
relevanceDistance := p_relevanceDistance, relevanceDistance := p_relevanceDistance,
relevanceTrafficDirection := omit, relevanceTrafficDirection := omit,
validityDuration := p_validityDuration, validityDuration := p_validityDuration,
transmissionInterval := omit, transmissionInterval := p_repetitionInterval,
stationType := StationType_roadSideUnit_ stationType := StationType_roadSideUnit_
}, // End of field managementContainer }, // End of field managementContainer
situationContainer := { situationContainer := {
...@@ -220,7 +235,6 @@ module ItsRSUsSimulator_Templates { ...@@ -220,7 +235,6 @@ module ItsRSUsSimulator_Templates {
}, },
roadType := omit roadType := omit
} // End of field locationContainer } // End of field locationContainer
} // End of template m_denmParm } // End of template m_denmParm
} // End of group denmTemplates } // End of group denmTemplates
......
...@@ -38,19 +38,19 @@ module ItsRSUsSimulator_TestCases { ...@@ -38,19 +38,19 @@ module ItsRSUsSimulator_TestCases {
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body // Test Body
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].cam)) { if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].cam)) {
tc_cam.start; tc_cam.start;
} }
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].denms)) { if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].denms)) {
tc_denm.start; tc_denm.start;
} }
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].mapem)) { if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].mapem)) {
tc_mapem.start; tc_mapem.start;
} }
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatem)) { if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems)) {
tc_spatem.start; tc_spatem.start;
} }
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].ivim)) { if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].ivim)) {
tc_ivim.start; tc_ivim.start;
} }
alt { alt {
......
...@@ -2,6 +2,7 @@ module ItsRSUsSimulator_TestControl { ...@@ -2,6 +2,7 @@ module ItsRSUsSimulator_TestControl {
// AtsRSUsSimulator // AtsRSUsSimulator
import from ItsRSUsSimulator_TestCases all; import from ItsRSUsSimulator_TestCases all;
import from LibItsGeoNetworking_Templates all;
control { control {
......
...@@ -15,7 +15,7 @@ module ItsRSUsSimulator_TestSystem { ...@@ -15,7 +15,7 @@ module ItsRSUsSimulator_TestSystem {
var LongPosVector vc_longPosVectorRsu := {}; var LongPosVector vc_longPosVectorRsu := {};
var GeoArea vc_geoArea := {}; var GeoArea vc_geoArea := {};
var RsuMessagesValueList vc_rsuMessagesValueList := {}; var template (value) RsuMessagesValueList vc_rsuMessagesValueList := {};
var integer vc_denmEventCounter := 0; var integer vc_denmEventCounter := 0;
timer tc_cam := PICS_CAM_FREQUENY; timer tc_cam := PICS_CAM_FREQUENY;
......
...@@ -10,7 +10,6 @@ module ItsRSUsSimulator_TypesAndValues { ...@@ -10,7 +10,6 @@ module ItsRSUsSimulator_TypesAndValues {
import from MAPEM_PDU_Descriptions language "ASN.1:1997" all; import from MAPEM_PDU_Descriptions language "ASN.1:1997" all;
import from SPATEM_PDU_Descriptions language "ASN.1:1997" all; import from SPATEM_PDU_Descriptions language "ASN.1:1997" all;
import from IVIM_PDU_Descriptions language "ASN.1:1997" all; import from IVIM_PDU_Descriptions language "ASN.1:1997" all;
import from SREM_PDU_Descriptions language "ASN.1:1997" all;
import from SSEM_PDU_Descriptions language "ASN.1:1997" all; import from SSEM_PDU_Descriptions language "ASN.1:1997" all;
// LibItsGeoNetworking // LibItsGeoNetworking
...@@ -26,17 +25,23 @@ module ItsRSUsSimulator_TypesAndValues { ...@@ -26,17 +25,23 @@ module ItsRSUsSimulator_TypesAndValues {
*/ */
type record of DENM DENMs; type record of DENM DENMs;
/**
* @desc This is the list of SPATEM events hosted by a single RSU
*/
type record of SPATEM SPATEMs;
/** /**
* @desc Defines the list of messages to be sent by a single RSU * @desc Defines the list of messages to be sent by a single RSU
* @member cam CAM message that a RSU shall send * @member cam CAM message that a RSU shall send
* @member denms List of DENM events that a RSU shall send * @member denms List of DENM events that a RSU shall send
*/ */
type record RsuMessagesValue { type record RsuMessagesValue {
CAM cam, CAM cam optional,
DENMs denms, DENMs denms optional,
MAPEM mapem optional, MAPEM mapem optional,
SPATEM spatem optional, SPATEMs spatems optional,
IVIM ivim optional IVIM ivim optional,
SSEM ssem optional
} // End of type RsuMessagesValue } // End of type RsuMessagesValue
/** /**
...@@ -48,7 +53,7 @@ module ItsRSUsSimulator_TypesAndValues { ...@@ -48,7 +53,7 @@ module ItsRSUsSimulator_TypesAndValues {
ManagementContainer managementContainer, ManagementContainer managementContainer,
SituationContainer situationContainer, SituationContainer situationContainer,
LocationContainer locationContainer LocationContainer locationContainer
} // End of type DenmParm } // End of type DenmParmContainers
/** /**
* @desc This is the list of DENM dynamic parameters for the different events hosted by a single RSU * @desc This is the list of DENM dynamic parameters for the different events hosted by a single RSU
...@@ -120,9 +125,10 @@ module ItsRSUsSimulator_TypesAndValues { ...@@ -120,9 +125,10 @@ module ItsRSUsSimulator_TypesAndValues {
* @desc Describe the parameter for each DENM event * @desc Describe the parameter for each DENM event
*/ */
type record DenmParm { type record DenmParm {
ReferencePosition eventPosition, ReferencePosition eventPosition,
CauseCodeType causeCodeType, CauseCodeType causeCodeType,
EventHistory eventHistory EventHistory eventHistory,
RoadWorksContainerExtended roadWorksContainerExtended optional
} // End of type DenmParm } // End of type DenmParm
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment