Newer
Older
/**
* @author ETSI / STF422_EETS
* @version $URL:$
* $Id:$
* @desc Inter-ITS-SCU communications (ISO 24102-4) functions
*/
module LibItsMgt_Functions {
// LibCommon
import from LibCommon_BasicTypesAndValues {
const
c_uInt8Max;
};
import from LibCommon_Sync {
function
f_selfOrClientSyncAndVerdict, f_selfOrClientSyncAndVerdictPreamble
};
import from LibCommon_VerdictControl all;
// LibIts
garciay
committed
import from CALMiitsscu language "ASN.1:1997" {
type
PduCounter
};
import from CALMllsap language "ASN.1:1997" {
type
MedType, CIaClass, CIclass
};
import from CALMmanagement language "ASN.1:1997" {
type
ITS_scuId
};
import from CALMmsap language "ASN.1:1997" {
type
CommandRef,
MN_Request_request, FWTupdate,
MF_Request_request
};
import from CALMfsap language "ASN.1:1997" {
type
GCregServer, GCregClient, GCderegClient, GCctxTxCmd, CTXrxNot
};
import from LibItsMgt_Templates all;
import from LibItsMgt_Pixits all;
import from LibIts_Interface {
type
ItsMgt,
group functions {
/**
* @desc Triggers a request command event in the test system adaptation.
* @param p_requestRequest The remote commad to trigger
* @return FncRetCode
*/
function f_mgtMFTriggerRequest(
in template (value) MF_Request_request p_requestRequest
) runs on ItsMgt return FncRetCode {
var FncRetCode v_ret := e_success;
mgtMFSapPort.send(m_mgtMFSapRequestReq(p_requestRequest));
return v_ret;
}
} // End of group functions
group mgtAltsteps {
group mfSap {
/**
* @desc The base default.
*/
altstep a_mgtMFSapPortDefault() runs on ItsMgt {
[] mgtMFSapPort.receive(mw_mgtMFSapCommandReq(mw_mfCommandRequest_any)) { // Receive any MF-COMMAND.request message
log("*** a_mgtMFSapPortDefault: INFO: MF-SAP service primitive received in default ***");
repeat;
}
[] mgtMFSapPort.receive(mw_mgtMFSapRequestReq(mw_mfRequestRequest_any)) { // Receive any MF-COMMAND.request message
log("*** a_mgtMFSapPortDefault: INFO: MF-SAP service primitive received in default ***");
repeat;
}
// FIXME Add support of response to CommandRequest & RequestRequest
// [] mgtMFSapPort.receive(mw_mgtMFSapCommandInd(mw_mfCommandRequest_any)) { // Receive any MF-COMMAND.request message
// log("*** a_mgtMFSapPortDefault: INFO: MF-SAP service primitive received in default ***");
// repeat;
// }
[] mgtMFSapPort.receive(mw_mgtMFSapRequestConfirm(mw_mfRequestConfirm(0))) { // Receive any MF-REQUEST.confirm message with success status
log("*** a_mgtMFSapPortDefault: INFO: MF-SAP service primitive received in default ***");
repeat;
}
[] mgtMFSapPort.receive(mw_mgtMFSapRequestConfirm(mw_mfRequestConfirm(?))) { // Receive any MF-REQUEST.confirm message with error status
f_selfOrClientSyncAndVerdict("error", e_error);
log("*** a_mgtMFSapPortDefault: ERROR: Received MF-SAP error status ***");
}
[] mgtMFSapPort.receive { // Receive unknown message
f_selfOrClientSyncAndVerdict("error", e_error);
log("*** a_mgtMFSapPortDefault: ERROR: Event received on MgtMFSapPort port in default ***");
}
} // End of altstep a_mgtMFSapPortDefault
// /**
// * @desc Wait for REQUEST.confirm/GCregServer MF-REQUEST.confirm
// * @param p_commandRef Unique cyclic reference number of command. Same value as in related MN-REQUEST.request
// * @verdict Unchanged
// */
// altstep a_mgtAwaitGCregServerReqConf(in CommandRef p_commandRef) runs on ItsMgt {
//
// [] mgtMFSapPort.receive(mw_mgtMFSapRequestConfirm(mdw_gCregServerRequestConf(p_commandRef))) {
// log("*** a_mgtAwaitGCregServerReqConf: INFO: MF-SAP GCregServer service primitive received ***");
// repeat;
// }
// } // End of altstep a_mgtAwaitGCregServerReqConf
} // End of group mfSap
group mnSap {
/**
* @desc The base default.
*/
altstep a_mgtMNSapPortDefault() runs on ItsMgt {
[] mgtMNSapPort.receive(mw_mgtMNSapCommandConfirm(mw_mnCommandConfirm_any)) { // Receive any MF-COMMAND.confirm message
log("*** a_mgtMNSapPortDefault: INFO: MN-SAP service primitive MF-COMMAND.confirm received in default ***");
repeat;
}
[] mgtMNSapPort.receive(mw_mgtMNSapRequestConfirm(mw_mnRequestConfirm_any)) { // Receive any MF-REQUEST.confirm message
log("*** a_mgtMNSapPortDefault: INFO: MN-SAP service primitive MF-REQUEST.confirm received in default ***");
repeat;
}
[] mgtMNSapPort.receive(mw_mgtMNSapRequestReq(mw_mnRequestRequest_any)) { // Receive any MF-REQUEST.request message
log("*** a_mgtMNSapPortDefault: INFO: MN-SAP service primitive MF-REQUEST.request received in default ***");
repeat;
}
[] mgtMNSapPort.receive { // Receive unknown message
log("*** a_mgtMNSapPortDefault: ERROR: event received on MgtMNSapPort port in default ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
} // End of altstep a_mgtMNSapPortDefault
/**
* @desc Wait for MN_COMMAND/FWTupdate message
* @verdict Unchanged
* @see ISO/WD 24102-3 - Clause D.2.4 FWTupdate
*/
altstep a_mgtSapAwaitFWTupdate() runs on ItsMgt {
[] mgtMNSapPort.receive(mw_mgtMNSapCommandReq(mw_fWTUpdateCommandReq)) -> value v_fWTupdate {
//vc_noFNTPfwtEntry := v_fWTupdate.msgIn.command_param.mnCmd.fWTupdate.update.fntp.reference;
log("*** a_mgtSapAwaitFWTupdate: INFO: MN-SAP FWTupdate service primitive received: vc_noFNTPfwtEntry=" & int2str(vc_noFNTPfwtEntry) & " ***");
}
} // End of altstep a_mgtSapAwaitFWTupdate
/**
* @desc Wait for a notification of creation of an entry in a forwarding table.
* @see ISO/WD 24102-3 Clause E.2.2 FWTsetNot
* @verdict Unchanged
*/
altstep a_mgtAwaitFWTsetNot() runs on ItsMgt {
[] mgtMNSapPort.receive(mw_mgtMNSapRequestReq(mdw_fWTSetNotRequestReq)) {
log("*** a_mgtAwaitFWTsetNot: INFO: MN-SAP FWTupdateNot service primitive received ***");
} // End of altstep a_mgtAwaitFWTsetNot
/**
* @desc Wait for creation of an entry in a forwarding table.
* @see ISO/WD 24102-4 Clause D.2.3 FWTset
* @verdict Unchanged
*/
altstep a_mgtAwaitFWTset() runs on ItsMgt {
[] mgtMNSapPort.receive(mw_mgtMNSapCommandReq(mw_fWTSetCommandReq)) {
log("*** a_mgtAwaitFWTset: INFO: MN-SAP FWTupdateNot service primitive received ***");
}
} // End of altstep a_mgtAwaitFWTset
} // End of group mnSap
} // End of group mgtAltsteps
group preambule {
// /**
// * @desc TODO
// *
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
// */
// function f_fntpForwardingTableRegisterEntry() runs on ItsMgt {
// var PduCounter v_pduCounter;
// var CommandRef v_commandRef;
//
// // Get a pdu counter value
// v_pduCounter := f_getNextPduCounter();
// v_commandRef := f_getNextCommandRef();
//
// // Send FWSet MN-COMMAND
// iiscPort.send(m_iiscReq(
// m_remoteMnCommandRequest(
// PX_SRC_ITS_SCU_ID,
// PX_DST_ITS_SCU_ID,
// v_pduCounter,
// m_mnCommandRequest(
// v_commandRef,
// m_mnFWTSet(
// PX_HOST_CIID,
// PX_HOST_SCU_ID,
// PX_REMOTE_PORT,
// PX_HOST_SCU_ID,
// PX_USER_PRIORITY)))));
// tc_ac.start;
// alt {
// [] iiscPort.receive(mw_iiscResp(
// mw_mnCommandConfirm(
// PX_DST_ITS_SCU_ID,
// PX_SRC_ITS_SCU_ID,
// v_pduCounter + 1, // ISO/WD 24102-4 - Clause 6.2.1
// mw_mnCommandConfirmAny // FIXME Use a more restrictive template
// ))) {
// tc_ac.stop;
// }
// [] tc_ac.timeout {
// log("*** f_fntpForwardingTableRegisterEntry: INCONC: Pre-conditions: Failed to initialize FNTP Forwarding Table ***");
// f_selfOrClientSyncAndVerdictPreamble("error", e_timeout);
// }
// } // End of 'alt' statement
//
// } // End of function f_fntpForwardingTableRegisterEntry
} // End of group preambule
group testerFunctions {
/**
* @desc Increments the pdu counter and returns the new value
* @return The new pdu counter value
*
*/
function f_getNextPduCounter() runs on ItsMgt return PduCounter {
vc_pduCounter := (vc_pduCounter + 2) mod (c_uInt8Max - 1); // ISO/WD 24102-4 - Clause 6.2.1: modulus 254
return vc_pduCounter;
} // End of function f_getNextPduCounter
/**
* @desc Increments the commandRef value and returns it
* @return The new commandRef value
*/
function f_getNextCommandRef() runs on ItsMgt return CommandRef {
vc_commandRef := (vc_commandRef + 1) mod (c_uInt8Max + 1);
return vc_commandRef;
} // End of function f_getNextCommandRef
} // End of group testerFunctions
group iutFunctions {
/**
* @desc TODO
* @return TODO
* @verdict Unchanged
* @see PX_SRC_ITS_SCU_ID
*/
function f_getIutSourceITS_scuId() return ITS_scuId {
return PX_SRC_ITS_SCU_ID;
}
/**
* @desc TODO
* @return TODO
* @verdict Unchanged
* @see PX_DST_ITS_SCU_ID
*/
function f_getIutDestITS_scuId() return ITS_scuId {
return PX_DST_ITS_SCU_ID;
}
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
/**
* @desc TODO
* @return TODO
* @verdict Unchanged
* @see PX_MED_TYPE
*/
function f_getIutMedType() return MedType {
return PX_MED_TYPE;
}
/**
* @desc TODO
* @return TODO
* @verdict Unchanged
* @see PX_CIACLASS
*/
function f_getIutCIaClass() return CIaClass {
return PX_CIACLASS;
}
/**
* @desc TODO
* @return TODO
* @verdict Unchanged
* @see PX_CICLASS
*/
function f_getIutCIClass() return CIclass {
return PX_CICLASS;
}
} // End of group iutFunctions
} // End of module LibItsMgt_Functions