Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/**
* @author ETSI / STF405 / STF449 / STF484 / STF517
* @version $Url: https://oldforge.etsi.org/svn/ITS/tags/20170222_STF527_Final/ttcn/AtsCAM/ItsCam_TpFunctions.ttcn $
* $Id: ItsCam_TpFunctions.ttcn 2655 2017-01-26 10:46:08Z filatov $
* @desc CAM TP functions
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
*
*/
module ItsCam_TpFunctions {
import from LibItsCommon_Pixits all;
// 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_Functions all;
import from LibItsCommon_Pixits all;
import from LibItsCommon_ASN1_NamedNumbers all;
// LibItsCam
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 LibItsSecurity_Functions 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 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
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 ***");
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
f_prInitialState(e_dynamicPosition1500m);
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;
}
Loading full blame...