Commit f3ec837f authored by garciay's avatar garciay

First try of a RSU Simulator

parent 125c349d
This diff is collapsed.
This diff is collapsed.
/**
*
* @desc
*
* @reference https://wiki.plugtests.net/wiki/ITS-CMS5/index.php/Base_Specs_and_Test_Specs
*/
module ItsRSUsSimulator_Pixits {
// LibIts
import from ITS_Container 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;
// LibItsCommon
import from LibItsCommon_Functions all;
// AtsRSUsSimulator
import from ItsRSUsSimulator_TypesAndValues all;
import from ItsRSUsSimulator_Pics all;
modulepar integer PX_ETSI_USE_CASE_ID := 0;
modulepar integer PX_RSU_ID := 1; // 1: D1, 2: D2
} // End of module ItsRSUsSimulator_Pixits
This diff is collapsed.
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;
import from ItsRSUsSimulator_Pixits all;
testcase TC_RSUSIMU_BV_01() runs on ItsRSUsSimulator system ItsGeoNetworkingSystem {
// 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
tc_cam.start;
tc_denm.start;
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].mapem)) {
tc_mapem.start;
}
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatem)) {
tc_spatem.start;
}
if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].ivim)) {
tc_ivim.start;
}
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwPdu(
mw_geoNwUnicastPacketWithNextHeader_srem(
?,
?,
e_btpB
)))) -> value v_gnInd { // Receive a SREM message
f_processSrem(v_gnInd.msgIn);
repeat;
}
[] geoNetworkingPort.receive(mw_geoNwInd(?)) -> value v_gnInd { // Receive a message
// Nothing to do, just for logging purposes
repeat;
}
[] tc_cam.timeout {
f_prepare_cam(v_payload);
f_send(v_payload);
tc_cam.start;
repeat;
}
[] tc_denm.timeout {
f_prepare_denm(v_payload);
f_send(v_payload);
tc_cam.start;
repeat;
}
// [] tc_spatem.timeout {
// f_prepare_spatem(v_payload);
// f_send(v_payload);
// tc_spatem.start;
// repeat;
// }
// [] tc_mapem.timeout {
// f_prepare_spatem(v_payload);
// f_send(v_payload);
// tc_mapem.start;
// repeat;
// }
// [] tc_ivim.timeout {
// f_prepare_ivim(v_payload);
// f_send(v_payload);
// tc_ivim.start;
// repeat;
// }
} // End of 'alt' statement
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
// Postamble
f_cf01Down();
}
} // End of module ItsRSUsSimulator_TestCases
\ No newline at end of file
module ItsRSUsSimulator_TestControl {
// AtsRSUsSimulator
import from ItsRSUsSimulator_TestCases all;
control {
execute(TC_RSUSIMU_BV_01());
}
} // End of module ItsRSUsSimulator_TestControl
\ No newline at end of file
module ItsRSUsSimulator_TestSystem {
// LibItsGeoNetworking
import from LibItsGeoNetworking_TestSystem all;
import from LibItsGeoNetworking_TypesAndValues all;
// AtsRSUsSimulator
import from ItsRSUsSimulator_TypesAndValues all;
import from ItsRSUsSimulator_Pics all;
/**
* @desc Test component for ITS Network and Transport layer
*/
type component ItsRSUsSimulator extends ItsGeoNetworking {
var LongPosVector vc_longPosVectorRsu := {};
var GeoArea vc_geoArea := {};
var RsuMessagesValueList vc_rsuMessagesValueList := {};
var integer vc_denmEventCounter := 0;
timer tc_cam := PICS_CAM_FREQUENY;
timer tc_denm := PICS_DENM_FREQUENY;
timer tc_mapem := PICS_MAPEM_FREQUENY;
timer tc_spatem := PICS_SPATEM_FREQUENY;
timer tc_ivim := PICS_IVIM_FREQUENY;
} // End of component ItsRSUsSimulator
} // End of module ItsRSUsSimulator_TestSystem
\ No newline at end of file
module ItsRSUsSimulator_TypesAndValues {
// LibCommon
import from LibCommon_BasicTypesAndValues all;
// LibIts
import from ITS_Container 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 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;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TypesAndValues all;
/**
* @desc Data structures used to build IS messages & event for a specific RSU
*/
group rsiSimulatordataStructures {
/**
* @desc This is the list of DENM events hosted by a single RSU
*/
type record of DENM DENMs;
/**
* @desc Defines the list of messages to be sent by a single RSU
* @member cam CAM message that a RSU shall send
* @member denms List of DENM events that a RSU shall send
*/
type record RsuMessagesValue {
CAM cam,
DENMs denms,
MAPEM mapem optional,
SPATEM spatem optional,
IVIM ivim optional
} // End of type RsuMessagesValue
/**
* @desc List of the RSU settings (for future usage (e.g. dynamic change of the RSU ID)
*/
type record of RsuMessagesValue RsuMessagesValueList;
type record DenmParmContainers {
ManagementContainer managementContainer,
SituationContainer situationContainer,
LocationContainer locationContainer
} // End of type DenmParm
/**
* @desc This is the list of DENM dynamic parameters for the different events hosted by a single RSU
*/
type record of DenmParmContainers DenmParmContainersList;
/**
* @desc This is the list of DENM dynamic parameters for the different events hosted for all RSUs
*/
type record of DenmParmContainersList DenmParmContainersListRsu;
} // End of group rsiSimulatordataStructures
/**
* @desc Data structures used to set up IS messages & event according to the track configuration
*/
group picsDataStructures {
/**
* @desc CAM setup
*/
group camDataStructures {
/**
* @desc Describe the parameter for each CAM event
*/
type record RsuParm {
GN_Address gnAddress,
LongPosVector longPosVector,
StationID stationID,
GeoShape geoShape,
union {
UInt16 radius
} geoParms,
PathHistory pathHistory
} // End of type CamParm
/**
*
* @desc List of CAM parms per RSU
* <pre>
* vc_longPosVectorRsu := PICS_RSU_PARAMS[PX_RSU_ID - 1].longPosVector;
* </pre>
*/
type record of RsuParm RsuParmList;
} // End of group camDataStructures
/**
* @desc MAPEM setup
*/
group mapemDataStructures {
// TODO To be done
} // End of group mapemDataStructures
/**
* @desc IVIM setup
*/
group ivimDataStructures {
// TODO To be done
} // End of group ivimDataStructures
/**
* @desc DENM setup
*/
group denmDataStructures {
/**
* @desc Describe the parameter for each DENM event
*/
type record DenmParm {
ReferencePosition eventPosition,
CauseCodeType causeCodeType,
EventHistory eventHistory
} // End of type DenmParm
/**
* @desc List of DENM events per use case
* @see <wiki URL>
* <pre>
* v_denmParm := PICS_DENM_PARMS_UC1_RWW[vc_eventId];
* vc_eventId := (vc_eventId + 1) mod lengthof(PICS_DENM_PARMS_UC1_RWW)
* </pre>
*/
type record of DenmParm DenmEventsParmsUseCase;
/**
* @desc List of DENM events per use case and per RSUs
* <pre>
* v_denmParm := PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][PX_ETSI_USE_CASE_ID][vc_eventId];
* vc_eventId := (vc_eventId + 1) mod lengthof(PICS_DENM_EVENTS_RSU[PX_RSU_ID - 1][PX_ETSI_USE_CASE_ID])
* </pre>
*/
type record of DenmEventsParmsUseCase DenmEventsParmsUseCaseRsu;
} // End of group denmDataStructures
} // End of group picsDataStructures
} // End of module ItsRSUsSimulator_TypesAndValues
\ No newline at end of file
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