Newer
Older
/**
* @author ETSI STF484
* @version $URL$
* $Id$
* @desc CAM TP functions
*
*/
module ItsCam_TpFunctions {
// LibCommon
import from LibCommon_Sync all;
import from LibCommon_VerdictControl all;
import from LibCommon_Time all;
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
// LibIts
import from ITS_Container language "ASN.1:1997" all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
// LibItsCommon
import from LibItsCommon_TypesAndValues all;
import from LibItsCommon_Templates all;
import from LibItsCommon_Functions all;
import from LibItsCommon_Pixits all;
import from LibItsCam_TestSystem all;
import from LibItsCam_Functions all;
import from LibItsCam_Templates all;
import from LibItsCam_TypesAndValues all;
import from LibItsCam_Pics all;
import from LibItsCam_Pixits all;
// 5.2.1
group camMessageDissemination {
group camMessageFormat {
/**
* @desc TP Function for TC_CAM_MSD_FMT_BV_01
*/
function f_CAM_MSD_FMT_BV_01() runs on ItsCam {
// Local variables
// Test control
if (not PICS_CAM_GENERATION) {
log("*** " & testcasename() & ": PICS_CAM_GENERATION required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Expected CAM message received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_poDefault();
f_cfDown();
} // end f_CAM_MSD_FMT_BV_01
/**
* @desc TP Function for TC_CAM_MSD_FMT_BV_02
*/
function f_CAM_MSD_FMT_BV_02() runs on ItsCam {
// Local variables
// Test control
if (not PICS_CAM_GENERATION or PICS_RSU) {
log("*** " & testcasename() & ": PICS_CAM_GENERATION and not PICS_RSU required for executing the TC ***");
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
f_prInitialState();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_LF_any )){
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Expected CAM message received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: Expected CAM message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: CAM message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
}
// Postamble
f_poDefault();
f_cfDown();
} // end f_CAM_MSD_FMT_BV_02
/**
* @desc TP Function for TC_CAM_MSD_FMT_BV_03
*/
function f_CAM_MSD_FMT_BV_03() runs on ItsCam {
// Local variables
timer t_minTransInterval := c_lowFrequencyGenerationTime * 1.10;
var SpeedValue v_speedValues[5] := { 1000, 2000, 3000, 4000, 5000 } //cm/s
var integer v_cntSpeed, v_cntTime;
var CamInd v_camInd;
var boolean v_nextCamWithLF := false;
const integer c_cntTimeLimit := 10;
// Test control
if (not PICS_CAM_GENERATION or PICS_RSU) {
log("*** " & testcasename() & ": PICS_CAM_GENERATION and not PICS_RSU required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cfUp();
// Test adapter configuration
// Preamble
camPort.clear;
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_LF_any )){
tc_ac.stop;
t_minTransInterval.start;
log("*** " & testcasename() & ": INFO: Initial conditions: First CAM message received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CAM message not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
}
// Test Body
for (v_cntSpeed:=0; v_cntSpeed<lengthof(v_speedValues); v_cntSpeed:=v_cntSpeed + 1) {
f_changeSpeed(v_speedValues[v_cntSpeed]);
v_cntTime := 0;
tc_ac.start;
alt {
[] camPort.receive(mw_camInd ( mw_camMsg_LF_any )) {
tc_ac.stop;
v_cntTime := v_cntTime + 1;
if (v_cntTime == c_cntTimeLimit) { // Exit message loop
log("*** " & testcasename() & ": INFO: The subset of CAM messages including lowFrequencyContainer was received ***");
t_minTransInterval.start;
v_nextCamWithLF := false;
}
else {
log("*** " & testcasename() & ": INFO: CAM retransmission with LowFrequency container ***");
tc_ac.start;
t_minTransInterval.start;
v_nextCamWithLF := false;
repeat;
}
[] camPort.receive(mw_camInd ( mw_camMsg_any )) -> value v_camInd {
tc_ac.stop;
if(v_nextCamWithLF == true) {
Loading
Loading full blame...