Commit 4da49c99 authored by garciay's avatar garciay

Plugtest settings

parent cf7d74f8
......@@ -14,6 +14,7 @@ module ItsRSUsSimulator_Functions {
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 EVCSN_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 DSRC language "ASN.1:1997" all;
......@@ -185,6 +186,7 @@ module ItsRSUsSimulator_Functions {
var template (omit) MAPEM v_mapem := omit;
var template (omit) SPATEMs v_spatems := omit;
var template (omit) IVIM v_ivim := omit;
var template (omit) EvcsnPdu v_evcsn := omit;
var template (omit) SSEM v_ssem := omit;
var integer v_counter;
......@@ -250,6 +252,27 @@ module ItsRSUsSimulator_Functions {
} else {
vc_ivim := false;
}
// EVCSN, only if PX_ETSI_USE_CASE_ID is set to 8
if ((vc_evcsn == true) and (PX_ETSI_USE_CASE_ID == 8)) {
// Build the list of the EVCSN events
v_evcsn :=
m_evcsnParm(
PICS_RSU_PARAMS[p_rsu_id].stationID,
m_evcsn(
m_itsPOIHeader(
-,
0, // To be updated at run time
-
),
m_itsEVCSNData(
-,
{ PICS_ITS_CHARGING }
)
));
// Update poi status
} else {
vc_evcsn := false;
}
// DENM, only if PX_ETSI_USE_CASE_ID is set to 1
if ((vc_denm == true) and (PX_ETSI_USE_CASE_ID == 1)) {
// Build the list of the DENM events for the specified RSU (PX_RSU_ID) and the given zone (PX_ETSI_ZONE_ID)
......@@ -364,6 +387,7 @@ module ItsRSUsSimulator_Functions {
v_mapem,
v_spatems,
v_ivim,
v_evcsn,
v_ssem
);
if (PICS_RSU_PARAMS[p_rsu_id].geoShape == e_geoCircle) {
......@@ -520,10 +544,14 @@ module ItsRSUsSimulator_Functions {
}
} // End of 'select' statement
}
if (v_currentTimeMark >= vc_endPhaseStartTime) { // Change state
vc_spatemStatesId := (vc_spatemStatesId + 1) mod vc_spatemStatesNum;
vc_currentPhaseStartTime := v_currentTimeMark;
vc_endPhaseStartTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
if (v_currentTimeMark >= vc_endPhaseStartTime) {
var float t := (int2float(v_currentTimeMark - vc_endPhaseStartTime) / int2float(v_currentTimeMark));
log("t = ", t);
if (t < 1.0) { // Change state
vc_spatemStatesId := (vc_spatemStatesId + 1) mod vc_spatemStatesNum;
vc_currentPhaseStartTime := v_currentTimeMark;
vc_endPhaseStartTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
}
}
log("vc_currentPhaseStartTime = ", vc_currentPhaseStartTime);
log("v_currentTimeMark = ", v_currentTimeMark);
......@@ -535,25 +563,26 @@ module ItsRSUsSimulator_Functions {
v_spatem.spat.intersections[v_intersection].states := { v_states[vc_spatemStatesId] };
v_spatem.spat.intersections[v_intersection].moy := f_getMinuteOfTheYear();
v_spatem.spat.intersections[v_intersection].timeStamp := f_getDSecond();
v_spatem.spat.intersections[v_intersection].revision := (valueof(v_spatem.spat.intersections[v_intersection].revision) + 1) mod 128;
select (vc_spatemStatesId) {
case (0) {
v_spatem.spat.intersections[v_intersection].states[1] := v_states[1];
case (0) { // permissive_Movement_Allowed
v_spatem.spat.intersections[v_intersection].states[1] := v_states[1]; // permissive-clearance
//v_spatem.spat.intersections[v_intersection].states[2] := v_states[2];
// Update startTime & minEndTime
v_spatem.spat.intersections[v_intersection].states[0].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.startTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_40);
}
case (1) {
v_spatem.spat.intersections[v_intersection].states[1] := v_states[2];
case (1) { // permissive-clearance
v_spatem.spat.intersections[v_intersection].states[1] := v_states[2]; // stop-And-Remain
//v_spatem.spat.intersections[v_intersection].states[2] := v_states[0];
// Update startTime & minEndTime
v_spatem.spat.intersections[v_intersection].states[0].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(v_currentTimeMark, PICS_SPATEM_REPITITION_DURATION_STATE_10);
v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.startTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_10);
v_spatem.spat.intersections[v_intersection].states[1].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_30);
}
case (2) {
v_spatem.spat.intersections[v_intersection].states[1] := v_states[0];
case (2) { // stop-And-Remain
v_spatem.spat.intersections[v_intersection].states[1] := v_states[0]; // permissive_Movement_Allowed
//v_spatem.spat.intersections[v_intersection].states[2] := v_states[1];
// Update startTime & minEndTime
v_spatem.spat.intersections[v_intersection].states[0].state_time_speed[0].timing.minEndTime := f_computeEndPhaseStartTime(vc_currentPhaseStartTime, PICS_SPATEM_REPITITION_DURATION_STATE_20);
......@@ -597,6 +626,25 @@ module ItsRSUsSimulator_Functions {
);
} // End of function f_prepare_ivim
function f_prepare_evcsn(
out template (value) Payload p_payload
) runs on ItsRSUsSimulator {
vc_rsuMessagesValueList[vc_rsu_id].evcsn.evcsn.poiHeader.timeStamp := f_getCurrentTime(); // Check if it is ITS or UTC time
log("vc_rsuMessagesValueList[vc_rsu_id].evcsn", valueof(vc_rsuMessagesValueList[vc_rsu_id].evcsn));
p_payload := valueof(
f_adaptPayload(
bit2oct(
encvalue(
valueof(
vc_rsuMessagesValueList[vc_rsu_id].evcsn
))),
PICS_EVCSN_BTP_DESTINATION_PORT,
PICS_EVCSN_BTP_SOURCE_PORT
)
);
} // End of function f_prepare_evcsn
function f_adaptPayload(
in template (value) octetstring p_finalPayload,
in template (value) BtpPortId p_destPort,
......@@ -652,7 +700,17 @@ module ItsRSUsSimulator_Functions {
return v_payload;
} // End of function f_adaptPayload
function f_isInApproach(
in ThreeDLocation p_detectionPoint,
in ThreeDLocation p_location,
in float p_dist := 150.0
) return boolean {
var float v_dist := fx_computeDistance(p_detectionPoint.latitude, p_detectionPoint.longitude, p_location.latitude, p_location.longitude);
log("v_dist = ", v_dist);
return v_dist <= p_dist;
}
function f_mirror_and_send_vehicle_cam(
in template (value) CAM p_camSimu,
in CAM p_camVehicle,
......@@ -663,12 +721,12 @@ module ItsRSUsSimulator_Functions {
var template (value) Payload v_payload;
// Apply 90° rotation
if (PICS_USE_SPV == true) {
if (PICS_USE_LPV == true) {
fx_computePositionFromRotation(
p_location.latitude,
p_location.longitude,
PICS_UC6_COLLISION_POINT.latitude,
PICS_UC6_COLLISION_POINT.longitude,
PICS_UC6_COLLISION_POINT_Z2.latitude, // Z1
PICS_UC6_COLLISION_POINT_Z2.longitude, // Z1
900,
v_newPosition.latitude,
v_newPosition.longitude
......@@ -678,9 +736,9 @@ module ItsRSUsSimulator_Functions {
fx_computePositionFromRotation(
p_camVehicle.cam.camParameters.basicContainer.referencePosition.latitude,
p_camVehicle.cam.camParameters.basicContainer.referencePosition.longitude,
PICS_UC6_COLLISION_POINT.latitude,
PICS_UC6_COLLISION_POINT.longitude,
900,
PICS_UC6_COLLISION_POINT_Z2.latitude, // Z1
PICS_UC6_COLLISION_POINT_Z2.longitude, // Z1
2450,
v_newPosition.latitude,
v_newPosition.longitude
);
......
......@@ -27,18 +27,18 @@ module ItsRSUsSimulator_Pixits {
/**
* @desc Indicate which Use Case to simulate
* @remark UC1 (DENM only): PX_ETSI_USE_CASE_ID := 1
* UC3 (TLM MAPEM/SPATEM): PX_ETSI_USE_CASE_ID := 3 !! PX_RSU_ID 2
* UC5 (IVIM only): PX_ETSI_USE_CASE_ID := 5 !! PX_RSU_ID 2
* UC6 (CAM only): PX_ETSI_USE_CASE_ID := 6 !! PX_RSU_ID 2
* UC7 (CAM only): PX_ETSI_USE_CASE_ID := 7 !! PX_RSU_ID 2
* UC9 (CAM only): PX_ETSI_USE_CASE_ID := 9 !! PX_RSU_ID 5
* UC3 (TLM MAPEM/SPATEM): PX_ETSI_USE_CASE_ID := 3
* UC5 (IVIM only): PX_ETSI_USE_CASE_ID := 5
* UC6 (CAM only): PX_ETSI_USE_CASE_ID := 6
* UC7 (CAM only): PX_ETSI_USE_CASE_ID := 7
* UC8 (EVCSN only): PX_ETSI_USE_CASE_ID := 8
* UC9 (CAM only): PX_ETSI_USE_CASE_ID := 9
* @remark LibItsGeoNetworking_Pixits.PX_GN_UPPER_LAYER := e_btpB
*/
modulepar integer PX_ETSI_USE_CASE_ID := 1;
modulepar integer PX_ETSI_USE_CASE_ID := 6;
/**
* @desc Indicate which zone to simulate
* @remark Used only for DENM
*/
modulepar integer PX_ETSI_ZONE_ID := 1;
......@@ -46,7 +46,7 @@ module ItsRSUsSimulator_Pixits {
modulepar boolean PICS_GENERATE_CAM := true;
modulepar boolean PICS_GENERATE_DENM := true;
modulepar boolean PICS_GENERATE_DENM := false;
modulepar boolean PICS_GENERATE_IVIM := false;
......@@ -54,6 +54,8 @@ module ItsRSUsSimulator_Pixits {
modulepar boolean PICS_GENERATE_SPATEM := false;
modulepar boolean PICS_GENERATE_SSEM := true;
modulepar boolean PICS_GENERATE_SSEM := false;
modulepar boolean PICS_GENERATE_EVCSN := false;
} // End of module ItsRSUsSimulator_Pixits
......@@ -11,6 +11,7 @@ module ItsRSUsSimulator_Templates {
import from SPATEM_PDU_Descriptions language "ASN.1:1997" all;
import from IVIM_PDU_Descriptions language "ASN.1:1997" all;
import from IVI language "ASN.1:1997" all;
import from EVCSN_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;
......@@ -52,6 +53,7 @@ module ItsRSUsSimulator_Templates {
in template (omit) MAPEM p_mapem := omit,
in template (omit) SPATEMs p_spatems := omit,
in template (omit) IVIM p_ivim := omit,
in template (omit) EvcsnPdu p_evcsn := omit,
in template (omit) SSEM p_ssem := omit
) := {
beacon := p_beacon,
......@@ -59,7 +61,9 @@ module ItsRSUsSimulator_Templates {
denms := p_denms,
mapem := p_mapem,
spatems := p_spatems,
ivim := p_ivim
ivim := p_ivim,
evcsn := p_evcsn,
ssem := p_ssem
} // End of template RsuMessagesValue
group geoNetworkingTemplates {
......@@ -190,7 +194,7 @@ module ItsRSUsSimulator_Templates {
template (present) GnNonSecuredPacket mw_geoNwShbPacketWithNextHeader_cam(
in template (present) LongPosVector p_sourceLongPosVec := ?,
in template (present) UInt8 p_hopLimit := ?,
in template (value) NextHeader p_nextHeader,
in template (present) NextHeader p_nextHeader,
in template (present) CAM p_cam := ?
) modifies mw_geoNwShbPacket := {
payload := {
......@@ -371,7 +375,49 @@ module ItsRSUsSimulator_Templates {
ivi := p_ivi
}
} // End of group ivimTemplates
} // End of ivimTemplates
group evcsnTemplates {
template (value) EvcsnPdu m_evcsnParm(
in template (value) StationID p_stationID,
in template (value) EVChargingSpotNotificationPOIMessage p_evcsn
) := {
header := {
protocolVersion := ItsPduHeader_protocolVersion_currentVersion_,
messageID := 7, //ItsPduHeader_messageID_evcsn_,
stationID := p_stationID
},
evcsn := p_evcsn
}
template (value) EVChargingSpotNotificationPOIMessage m_evcsn(
in template (value) ItsPOIHeader p_poiHeader,
in template (value) ItsEVCSNData p_evcsnData
) := {
poiHeader := p_poiHeader,
evcsnData := p_evcsnData
}
template (value) ItsPOIHeader m_itsPOIHeader(
in template (value) POIType p_poiType := 1,
in template (value) TimestampIts p_timeStamp,
in template (value) boolean p_relayCapable := true
) := {
poiType := p_poiType,
timeStamp := p_timeStamp,
relayCapable := p_relayCapable
}
template (value) ItsEVCSNData m_itsEVCSNData(
in template (value) NumberStations p_totalNumberOfStations := 1,
in template (value) ItsChargingStationDatas p_itsChargingStationDatas
) := {
totalNumberOfStations := p_totalNumberOfStations,
chargingStationsData := p_itsChargingStationDatas
}
} // End of group evcsnTemplates
group denmTemplates {
......@@ -444,6 +490,7 @@ module ItsRSUsSimulator_Templates {
roadType := omit
} // End of field locationContainer
} // End of template m_denmParm
} // End of group denmTemplates
} // End of module ItsRSUsSimulator_Templates
\ No newline at end of file
......@@ -88,12 +88,14 @@ module ItsRSUsSimulator_TestSystem {
var boolean vc_ivim := PICS_GENERATE_IVIM;
var boolean vc_mapem := PICS_GENERATE_MAPEM;
var boolean vc_spatem := PICS_GENERATE_SPATEM;
var boolean vc_evcsn := PICS_GENERATE_EVCSN;
timer tc_beacon := PICS_BEACON_FREQUENCY;
timer tc_cam := PICS_CAM_FREQUENCY;
timer tc_denm := PICS_DENM_FREQUENCY;
timer tc_mapem := PICS_MAPEM_FREQUENCY;
timer tc_spatem := PICS_SPATEM_FREQUENCY;
timer tc_ivim := PICS_IVIM_FREQUENCY;
timer tc_evcsn := PICS_EVCSN_FREQUENCY;
} // End of component ItsRSUsSimulator
......
......@@ -11,6 +11,7 @@ module ItsRSUsSimulator_TypesAndValues {
import from SPATEM_PDU_Descriptions language "ASN.1:1997" all;
import from IVIM_PDU_Descriptions language "ASN.1:1997" all;
import from IVI language "ASN.1:1997" all;
import from EVCSN_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 EfcDsrcApplication language "ASN.1:1997" all;
......@@ -50,6 +51,7 @@ module ItsRSUsSimulator_TypesAndValues {
MAPEM mapem optional,
SPATEMs spatems optional,
IVIM ivim optional,
EvcsnPdu evcsn optional,
SSEM ssem optional
} // End of type RsuMessagesValue
......@@ -199,6 +201,23 @@ module ItsRSUsSimulator_TypesAndValues {
} // End of group ivimDataStructures
/**
* @desc evcsn setup
*/
group evcsnDataStructures {
type record length (1 .. 256) of ItsChargingStationData ItsChargingStationDatas;
/**
* @desc List of evcsn parms per RSU
* <pre>
* v_provider := PICS_evcsn_PARMS_RSUs[PX_RSU_ID - 1].povider;
* </pre>
*/
type record of ItsChargingStationData PoimParmListRsu;
} // End of group evcsnDataStructures
/**
* @desc DENM setup
*/
......
Markdown is supported
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