Commit 7ab73a70 authored by garciay's avatar garciay
Browse files

Changes after test session in Livorno (20160613-14):

- Add beacon support
- Bugs fixed in DENM message templates
- The 3 DENMs (D1..3) are sent at the same time
parent 96928c11
......@@ -109,6 +109,7 @@ module ItsRSUsSimulator_Functions {
// Local variables
var template (value) DenmParmContainers v_denmParmContainers;
var template (omit) octetstring v_beacon := omit;
var template (omit) DENMs v_denms := omit;
var template (omit) CAM v_cam := omit;
var template (omit) MAPEM v_mapem := omit;
......@@ -191,7 +192,8 @@ module ItsRSUsSimulator_Functions {
PICS_DENM_RELEVANCE_TRAFFIC_DIRECTION
);
v_denms[v_counter] := valueof(
m_denmPdu(
m_denmPdu_rsu(
PICS_RSU_PARAMS[p_rsu_id].stationID,
m_denm(
v_denmParmContainers.managementContainer,
v_denmParmContainers.situationContainer,
......@@ -215,9 +217,14 @@ module ItsRSUsSimulator_Functions {
PICS_RSU_PARAMS[p_rsu_id].pathHistory
);
}
if (PICS_GENERATE_BEACON) {
// Build the list of the BeACON events
v_beacon := 'AAAAAAAA'O; // TODO Use a PICS
}
// Build the messages value list for this RSU
vc_rsuMessagesValueList[p_rsu_id] :=
m_rsuProfile(
v_beacon,
v_cam,
v_denms,
v_mapem,
......@@ -242,6 +249,9 @@ module ItsRSUsSimulator_Functions {
// Terminate simulation
if (p_cfEvent == "stop") {
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].beacon)) {
tc_beacon.stop;
}
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].cam)) {
tc_cam.stop;
}
......@@ -266,6 +276,20 @@ module ItsRSUsSimulator_Functions {
return false;
} // End of function f_process_cf_event
function f_prepare_beacon(
out template (value) Payload p_payload
) runs on ItsRSUsSimulator {
p_payload := valueof(
f_adaptPayload(
vc_rsuMessagesValueList[vc_rsu_id].beacon,
0,
-,
e_any
)
);
} // End of function f_prepare_cam
function f_prepare_cam(
out template (value) Payload p_payload
) runs on ItsRSUsSimulator {
......@@ -410,22 +434,23 @@ module ItsRSUsSimulator_Functions {
function f_adaptPayload(
in template (value) octetstring p_finalPayload,
in template (value) BtpPortId p_destPort,
in template (value) BtpPortId p_srcPort := 0
in template (value) BtpPortId p_srcPort := 0,
in NextHeader p_nextHeader := PX_GN_UPPER_LAYER
) return template (value) Payload {
var template (value) Payload v_payload;
if(PX_GN_UPPER_LAYER == e_any) {
if(p_nextHeader == e_any) {
v_payload := { decodedPayload := omit, rawPayload := p_finalPayload};
return v_payload;
}
if(PX_GN_UPPER_LAYER == e_ipv6) {
if(p_nextHeader == e_ipv6) {
log("*** " & testcasename() & ": INCONC: Layer IPv6 not supported ***");
setverdict(inconc);
stop;
}
if(PX_GN_UPPER_LAYER == e_btpA) {
if(p_nextHeader == e_btpA) {
v_payload := {
decodedPayload := {
btpPacket := m_btpAWithPorts(
......@@ -442,7 +467,7 @@ module ItsRSUsSimulator_Functions {
return v_payload;
}
if(PX_GN_UPPER_LAYER == e_btpB) {
if(p_nextHeader == e_btpB) {
v_payload := {
decodedPayload := {
btpPacket := m_btpBWithPorts(
......
......@@ -558,6 +558,22 @@ module ItsRSUsSimulator_Pics {
} // End of group camCommonSettings
} // End of group camParams
/**
* @desc This group describes the BEACON common settings for the RSUs CAM message broadcast
*/
group beaconParams {
/**
* @desc Common settings
*/
group beaconCommonSettings {
modulepar UInt32 PICS_BEACON_ITS_AID := 38;
} // End of group beaconCommonSettings
} // End of group rsuParameters
/**
......@@ -595,7 +611,7 @@ module ItsRSUsSimulator_Pics {
/**
* @desc DENM RelevanceDistance
*/
modulepar RelevanceDistance PICS_DENM_RELEVANCE_DISTANCE := lessThan100m;
modulepar RelevanceDistance PICS_DENM_RELEVANCE_DISTANCE := lessThan200m;
/**
* @desc DENM RelevanceTrafficDirection
......@@ -5514,18 +5530,25 @@ module ItsRSUsSimulator_Pics {
group generationFrequencies {
modulepar boolean PICS_GENERATE_CAM := false;
modulepar boolean PICS_GENERATE_BEACON := false;
modulepar boolean PICS_GENERATE_DENM := false;
modulepar boolean PICS_GENERATE_CAM := true;
modulepar boolean PICS_GENERATE_IVIM := true;
modulepar boolean PICS_GENERATE_DENM := true;
modulepar boolean PICS_GENERATE_MAPEM := true;
modulepar boolean PICS_GENERATE_IVIM := false;
modulepar boolean PICS_GENERATE_SPATEM := true;
modulepar boolean PICS_GENERATE_MAPEM := false;
modulepar boolean PICS_GENERATE_SPATEM := false;
modulepar boolean PICS_GENERATE_SSEM := true;
/**
* @desc CAM frequency timer
*/
modulepar float PICS_BEACON_FREQUENCY := 1.0;
/**
* @desc CAM frequency timer
*/
......
......@@ -45,6 +45,7 @@ module ItsRSUsSimulator_Templates {
import from ItsRSUsSimulator_Pics all;
template (omit) RsuMessagesValue m_rsuProfile(
in template (omit) octetstring p_beacon := omit,
in template (omit) CAM p_cam := omit,
in template (omit) DENMs p_denms := omit,
in template (omit) MAPEM p_mapem := omit,
......@@ -52,6 +53,7 @@ module ItsRSUsSimulator_Templates {
in template (omit) IVIM p_ivim := omit,
in template (omit) SSEM p_ssem := omit
) := {
beacon := p_beacon,
cam := p_cam,
denms := p_denms,
mapem := p_mapem,
......@@ -256,6 +258,18 @@ module ItsRSUsSimulator_Templates {
group denmTemplates {
/**
* @desc Send template for DENM PDU
* @param p_denm The DEN Message
*/
template (value) DENM m_denmPdu_rsu(
in template (value) StationID p_stationID,
in template (value) DecentralizedEnvironmentalNotificationMessage p_denm
) := {
header := LibItsDenm_Templates.m_itsPduHeader(p_stationID),
denm := p_denm
}
/**
* @desc Send template for Alacarte Container including lanePosition
*/
......@@ -287,7 +301,7 @@ module ItsRSUsSimulator_Templates {
originatingStationID := p_originatingStationID,
sequenceNumber := p_sequenceNumber
},
detectionTime := 0,
detectionTime := f_getCurrentTime(),
referenceTime := f_getCurrentTime(), // FIXME To be checked
termination := omit,
eventPosition := p_eventPosition,
......
......@@ -40,6 +40,9 @@ module ItsRSUsSimulator_TestCases {
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].beacon)) {
tc_beacon.start;
}
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].cam)) {
tc_cam.start;
}
......@@ -92,6 +95,13 @@ module ItsRSUsSimulator_TestCases {
repeat;
}
}
[PICS_GENERATE_BEACON] tc_beacon.timeout {
log("*** " & testcasename() & ": DEBUG: Processing BEACON ***");
f_prepare_beacon(v_payload);
f_send(v_payload, PICS_CAM_ITS_AID);
tc_beacon.start;
repeat;
}
[PICS_GENERATE_CAM] tc_cam.timeout {
log("*** " & testcasename() & ": DEBUG: Processing CAM ***");
f_prepare_cam(v_payload);
......@@ -101,8 +111,10 @@ module ItsRSUsSimulator_TestCases {
}
[PICS_GENERATE_DENM] tc_denm.timeout {
log("*** " & testcasename() & ": DEBUG: Processing DENM ***");
for (var integer v_i := 0; v_i < lengthof(vc_rsuMessagesValueList[vc_rsu_id].denms); v_i := v_i + 1) {
f_prepare_denm(v_payload);
f_send(v_payload, PICS_DENM_ITS_AID);
} // End of 'for'
tc_denm.start;
repeat;
}
......
......@@ -83,6 +83,7 @@ module ItsRSUsSimulator_TestSystem {
*/
var integer vc_spatemStatesNum := lengthof(vc_repitition_duration);
timer tc_beacon := PICS_BEACON_FREQUENCY;
timer tc_cam := PICS_CAM_FREQUENCY;
timer tc_denm := PICS_DENM_FREQUENCY;
timer tc_mapem := PICS_MAPEM_FREQUENCY;
......
......@@ -44,6 +44,7 @@ module ItsRSUsSimulator_TypesAndValues {
* @member denms List of DENM events that a RSU shall send
*/
type record RsuMessagesValue {
octetstring beacon optional,
CAM cam optional,
DENMs denms optional,
MAPEM mapem optional,
......
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