Newer
Older
module ItsRSUsSimulator_TestCases {
// Libcommon
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
// LibItsCommon
import from LibItsCommon_Functions all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TestSystem all;
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsGeoNetworking_Templates all;
// LibItsDenm
import from LibItsDenm_Templates all;
// AtsRSUsSimulator
import from ItsRSUsSimulator_TypesAndValues all;
import from ItsRSUsSimulator_Templates all;
import from ItsRSUsSimulator_TestSystem all;
import from ItsRSUsSimulator_Functions all;
testcase TC_RSUSIMU_BV_01() runs on ItsRSUsSimulator system ItsRSUsSimulatorSystem {
// Local variables
var template (value) Payload v_payload;
var GeoNetworkingInd v_gnInd;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
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)) {
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].denms)) {
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].mapem)) {
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].spatems)) {
if (ispresent(vc_rsuMessagesValueList[vc_rsu_id].ivim)) {
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
?,
?,
e_btpB
)))) -> value v_gnInd { // Receive a SREM message
log("*** " & testcasename() & ": DEBUG: Processing SREM ***");
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwTsbPacketWithNextHeader_denm(
?,
?,
e_btpB // TODO Refined to exclude RSU StationID
)))) -> value v_gnInd { // Receive a DENM message
log("*** " & testcasename() & ": DEBUG: Processing DENM ***");
// Nothing to do, just for logging purposes
repeat;
}
[] geoNetworkingPort.receive(mw_geoNwInd(?)) -> value v_gnInd { // Receive a message
log("*** " & testcasename() & ": DEBUG: Recieving unsollicited message ***");
// Nothing to do, just for logging purposes
repeat;
}
[] cfPort.receive(CfEvent:?) -> value v_cfEvent {
log("*** " & testcasename() & ": DEBUG: Configuration port command:", v_cfEvent, " ***");
if (f_process_cf_event(v_cfEvent) == true) {
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;
}
log("*** " & testcasename() & ": DEBUG: Processing CAM ***");
f_send(v_payload, PICS_CAM_ITS_AID);
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'
[PICS_GENERATE_MAPEM] tc_mapem.timeout {
log("*** " & testcasename() & ": DEBUG: Processing MAPEM ***");
f_prepare_mapem(v_payload);
f_send(v_payload, PICS_MAPEM_ITS_AID);
tc_mapem.start;
repeat;
}
[PICS_GENERATE_SPATEM] tc_spatem.timeout {
log("*** " & testcasename() & ": DEBUG: Processing SPATEM ***");
for (var integer v_counter := 0; v_counter < lengthof(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems); v_counter := v_counter + 1) {
f_prepare_spatem(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems[v_counter], v_payload);
f_send(v_payload, PICS_SPATEM_ITS_AID);
tc_spatem.start;
repeat;
}
[PICS_GENERATE_IVIM] tc_ivim.timeout {
log("*** " & testcasename() & ": DEBUG: Processing IVIM ***");
f_prepare_ivim(v_payload);
f_send(v_payload, PICS_IVIM_ITS_AID);