Newer
Older
garciay
committed
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
/**
* @author ETSI / STF422_EETS
* @version $URL:$
* $Id:$
* @desc Inter-ITS-SCU communications (ISO 24102-4) functions
*/
module LibItsIicp_Functions {
// LibCommon
import from LibCommon_Sync all;
import from LibCommon_Time {
function f_sleepIgnoreDef
};
import from LibCommon_BasicTypesAndValues {
const
c_uInt8Max;
};
import from LibCommon_Sync {
function
f_selfOrClientSyncAndVerdict, f_selfOrClientSyncAndVerdictPreamble
};
import from LibCommon_VerdictControl all;
// LibIts
import from CALMmanagement language "ASN.1:1997" {
type
ITS_scuId
};
import from CALMiitsscu language "ASN.1:1997" {
type
IIC_Request,
ITS_SCUtype
};
import from LibItsCommon_Functions {
function
f_utInitializeIut
};
import from LibItsIicp_Templates all;
import from LibItsIicp_Pics all;
import from LibItsIicp_Pixits all;
import from LibIts_Interface {
type
garciay
committed
IicpResp, IicpResp,
garciay
committed
ItsMgt
};
group iicpConfigurationFunctions {
/**
* @desc This configuration features:
* <li>Host and Router are combined (see ISO/WD 29281-2 - Figure 1 - Implementation architecture I)</li>
* <li>MGT1 IISC Port (IISC/LAN) is used if specified</li>
*/
function f_cf01Up() runs on ItsMgt {
// Map
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
garciay
committed
map(self:iicpPort, system:iicpPort);
map(self:iicpPort, system:iicpPort);
garciay
committed
map(self:mgtMFSapPort, system:mgtMFSapPort);
// Connect
f_connect4SelfOrClientSync();
// Set processing on shutdown
activate(a_cf01Down());
// Initialize the component
f_initialiseComponent("cf01Up");
// Initialze the IUT
f_initialState();
} // End of function f_cf01Up
/**
* @desc Deletes configuration cf01
*/
function f_cf01Down() runs on ItsMgt {
deactivate;
// Unmap
unmap(self:acPort, system:acPort);
unmap(self:utPort, system:utPort);
garciay
committed
unmap(self:iicpPort, system:iicpPort);
garciay
committed
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
unmap(self:mgtMFSapPort, system:mgtMFSapPort);
// Disconnect
f_disconnect4SelfOrClientSync();
} // End of f_cf01Down
/**
* @desc Behavior function for initializing component's variables and tables
* @param p_componentName Name of the component
* @param p_iicpMGM Set to true if IISC port shall be used
*/
function f_initialiseComponent(in charstring p_componentName) runs on ItsMgt {
// Initialize variables
// Set defaults
activate(a_iicpDefault());
} // end f_initialiseComponent
} // End of group iicpConfigurationFunctions
group functions {
} // End of group functions
group iicpFunctions {
/**
* @desc Triggers a request command event in the test system adaptation.
* @param p_rCmd The remote commad to trigger
* @return FncRetCode
*/
function f_iicpTriggerRequest(
in template (value) IIC_Request p_rCmd
) runs on ItsMgt return FncRetCode {
var FncRetCode v_ret := e_success;
garciay
committed
iicpPort.send(m_iicpReq(p_rCmd));
garciay
committed
return v_ret;
}
} // End of group iicpFunctions
group iicpAltsteps {
// /**
// * @desc Trap for not processed IICP message
// * @verdict Unchanged
// */
garciay
committed
// altstep a_iicpAwaitFWTupdateNot(
garciay
committed
// in template (value) ITS_scuId p_sourceITS_scuId,
// in template (value) ITS_scuId p_destinationITS_scuId,
// in template (value) PduCounter p_pduCounter
// ) runs on ItsMgt {
garciay
committed
// [] iicpPort.receive(//mw_iicpResp(mdw_fWTupdateNotRequestReq)) {
// mw_iicpResp(
// mw_iicpMnRequestReq(
garciay
committed
// p_sourceITS_scuId,
// p_destinationITS_scuId,
// p_pduCounter,
// mdw_fWTupdateNotRequestReq))) {
garciay
committed
// log("*** a_iicpAwaitFWTupdateNot: INFO: IISC FWTupdateNot service primitive received ***");
garciay
committed
// repeat;
// }
garciay
committed
// } // End of function a_iicpAwaitFWTupdateNot
garciay
committed
/**
* @desc Inter-ITS-SCU communications MN-rreq (see ISO/CD 24102-5) with payload MN-Request "SAMrxNot" (see ISO/CD 24102-3 & ISO/CD 24102-5)
* @param p_sourceITS-scuId ITS-SCU-ID of the source ITS-SCU which produces the request
* @param p_destinationITS-scuId ITS-SCU-ID of the destination ITS-SCU which shall evaluate the request
* @param p_pduCounter Even number generated fro a cyclic counter at the ITS-SCU
* @param p_mn_rreq The MN-REQUEST.request/SAMrxNot to be forwarded
* @verdict Unchanged
*/
garciay
committed
// altstep a_iicpAwaitSAMrxNotRequestReq(
garciay
committed
// in template (value) ITS_scuId p_sourceITS_scuId,
// in template (value) ITS_scuId p_destinationITS_scuId,
// in template (value) PduCounter p_pduCounter,
// in template (value) MN_Request_request p_mn_rreq // FIXME Replace MN_Request_request by SAMrxNot template
// ) runs on ItsMgt {
garciay
committed
// [] iicpPort.receive(
// mw_iicpResp(
// mw_iicpMnRequestReq(
garciay
committed
// p_sourceITS_scuId,
// p_destinationITS_scuId,
// p_pduCounter,
// p_mn_rreq))) { // Receive MN-REQUEST.request/SAMrxNot message
garciay
committed
// log("*** a_iicpAwaitSAMrxNotRequestReq: INFO: Remote command service primitive received in default ***");
garciay
committed
// repeat;
// }
garciay
committed
// } // End of altstep a_iicpAwaitSAMrxNotRequestReq
garciay
committed
/**
* @desc Inter-ITS-SCU communications MN-rreq (see ISO/WD 24102-4) with payload MN-Request "CTXrxNot" (see ISO/CD 24102-3 & ISO/CD 24102-5)
* @param p_sourceITS-scuId ITS-SCU-ID of the source ITS-SCU which produces the request
* @param p_destinationITS-scuId ITS-SCU-ID of the destination ITS-SCU which shall evaluate the request
* @param p_pduCounter Even number generated fro a cyclic counter at the ITS-SCU
* @param p_mn_rcmd The MN-REQUEST.request/SAMrxNot to be forwarded
* @verdict Unchanged
*/
garciay
committed
// altstep a_iicpAwaitCTXrxNotRequestReq(
garciay
committed
// in template (value) ITS_scuId p_sourceITS_scuId,
// in template (value) ITS_scuId p_destinationITS_scuId,
// in template (value) PduCounter p_pduCounter,
// in template (value) MN_Request_request p_mn_rreq // FIXME Replace MN_Request_request by CTXrxNot template
// ) runs on ItsMgt {
garciay
committed
// [] iicpPort.receive(mw_iicpResp(mw_iicpMnRequestReq(
garciay
committed
// p_sourceITS_scuId,
// p_destinationITS_scuId,
// p_pduCounter,
// p_mn_rreq))) { // Receive MN-REQUEST.request/CTXrxNot message
garciay
committed
// log("*** a_iicpAwaitCTXrxNotRequestReq: INFO: Remote command service primitive received in default ***");
garciay
committed
// repeat;
// }
garciay
committed
// } // End of altstep a_iicpAwaitCTXrxNotRequestReq
garciay
committed
/**
* @desc Trap for not processed IICP message.
* @verdict Set to fail on unknown message
*/
altstep a_iicpDefault() runs on ItsMgt {
[] iicpPort.receive(mw_iicpRequest(mw_iicpRequest_any)) { // Receive any IIC-Request message
log("*** a_iicpDefault: INFO: Remote IIC-Request command service primitive received in default ***");
repeat;
}
[] iicpPort.receive(mw_iicpResponse(mw_iicpResponse_any)) { // Receive any IIC-Response message
garciay
committed
log("*** a_iicpDefault: INFO: Remote IIC-Response command service primitive received in default ***");
repeat;
}
garciay
committed
[] iicpPort.receive { // Receive unknown message
garciay
committed
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
log("*** a_iicpDefault: ERROR: event received on IISC port in default ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] tc_wait.timeout {
log("*** a_iicpDefault: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
[] tc_ac.timeout {
log("*** a_iicpDefault: ERROR: Timeout while awaiting the reception of a message ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
[] any timer.timeout {
log("*** a_iicpDefault: INCONC: An unknown timer has expired in default ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
[] a_shutdown() {
f_poDefault();
log("*** a_iicpDefault: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
if(self == mtc) {
f_cf01Down();
}
stop;
}
} // End of altstep a_iicpDefault
/**
* @desc Default handling cf01 de-initialisation.
*/
altstep a_cf01Down() runs on ItsMgt {
[] a_shutdown() {
f_poDefault();
f_cf01Down();
log("*** a_cf01Down: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
} // End of altstep a_cf01Down()
} // End of group iicpAltsteps
group preambule {
/**
* @desc Brings the IUT into an initial state.
*/
function f_initialState() {
f_utInitializeIut(m_iicpInitialize);
f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...)
} // End of function f_initialState
} // End of group preambule
group postambles {
/**
* @desc The default postamble.
*/
function f_poDefault() runs on ItsMgt {
// Nothing to do
} // End of function f_poDefault
} // End of group postambles
group adapterControl {
} // End of group adapterControl
group testerFunctions {
} // End of group testerFunctions
group iutFunctions {
/**
* @desc Gets the Local/source ITS scuID
* @return The Local/source ITS scuID
* @see PX_LOCAL_ITS_SCU_ID
* @verdict Unchanged
* @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment
*/
function f_getIutLocalITSscuId() return ITS_scuId {
return PX_LOCAL_ITS_SCU_ID;
}
/**
* @desc TODO
* @return TODO
* @verdict Unchanged
* @see PX_SRC_ITS_SCU_TYPE
*/
function f_getIutSourceITS_scuType() return ITS_SCUtype {
return PX_SRC_ITS_SCU_TYPE;
}
/**
* @desc Gets the type ITS scuID
* @return The type ITS scuID
* @see PX_LOCAL_ITS_TYPE
* @verdict Unchanged
* @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment
*/
function f_getIutLocalITSType() return ITS_SCUtype {
return PX_LOCAL_ITS_TYPE;
}
} // End of group iutFunctions
} // End of module LibItsIicp_Functions