Newer
Older
garciay
committed
/**
* @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 CALMllsap language "ASN.1:1997" {
type
Link_ID
};
import from CALMmsap language "ASN.1:1997" {
type
MF_Command, MN_Command, MI_Command
};
garciay
committed
import from CALMmanagement language "ASN.1:1997" {
type
garciay
committed
};
import from CALMiitsscu language "ASN.1:1997" {
type
IIC_Request,
ITS_SCUtype
};
import from LibItsMgt_TypesAndValues {
type IParamNoList, IParamList
};
garciay
committed
import from LibItsIicp_Templates all;
import from LibItsIicp_Pics all;
import from LibItsIicp_Pixits all;
garciay
committed
type
garciay
committed
IicpResp, IicpResp,
garciay
committed
};
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
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
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
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
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 Get the active VCI link identifier
* @return The active VCI link identifier
* @see PX_ACTIVE_VCI_LINK_ID
*/
function f_getIutCIlinkId() return Link_ID {
return PX_ACTIVE_VCI_LINK_ID;
}
garciay
committed
/**
* @desc Gets the Local/source ITS scuID
* @return The Local/source ITS scuID
* @see PX_LOCAL_ITS_SCU_ID
* @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 Get the type of ITS-SCU in the "Data" element
* @return The type of ITS-SCU in the "Data" element
garciay
committed
* @see PX_SRC_ITS_SCU_TYPE
*/
function f_getIutSourceITS_scuType() return ITS_SCUtype {
return PX_SRC_ITS_SCU_TYPE;
}
/**
garciay
committed
* @return The type ITS scuID
* @see PX_LOCAL_ITS_TYPE
* @see ISO/WD 24102-4 - Table 2 — ITS-SCU-ID value assignment
*/
function f_getIutLocalITSType() return ITS_SCUtype {
return PX_LOCAL_ITS_TYPE;
}
/**
* @desc Gets the Alive timer
* @return The Alive timer
* @see PX_TALIVE
*/
function f_getIutTAlive() return Talive {
return PX_TALIVE;
}
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
/**
* @desc TODO
* @return TODO
* @see PX_MI_RCMD_STATECINOTIFY
*/
function f_getIutRCmdForMiCommand() return MI_Command {
return PX_MI_RCMD_STATECINOTIFY;
}
/**
* @desc TODO
* @return TODO
* @see PX_MN_RCMD_STATECINOTIFY
*/
function f_getIutRCmdForMnCommand() return MN_Command {
return PX_MN_RCMD_STATECINOTIFY;
}
/**
* @desc TODO
* @return TODO
* @see PX_MF_RCMD_STATECINOTIFY
*/
function f_getIutRCmdForMfCommand() return MF_Command {
return PX_MF_RCMD_STATECINOTIFY;
}
/**
* @desc TODO
* @return TODO
* @see PX_MI_IPARAMNOLIST
*/
function f_getIutIParamNoList() return IParamNoList {
return PX_MI_IPARAMNOLIST;
}
/**
* @desc TODO
* @return TODO
* @see PX_MI_IPARAMNOLIST
*/
function f_getIutIParamList() return IParamList {
return PX_MI_IPARAMLIST;
}
garciay
committed
} // End of group iutFunctions
} // End of module LibItsIicp_Functions