Newer
Older
* @author ETSI / STF405
* @version $URL$
* $Id$
* @desc Module containing common functions for ITS
// LibCommon
import from LibCommon_Sync all;
import from LibCommon_VerdictControl all;
// LibIts
import from LibIts_TestSystem all;
import from LibIts_Interface all;
import from LibItsCam_Templates all;
import from LibItsCam_Pixits all;
import from LibItsCommon_Functions all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
group camConfigurationFunctions {
/**
* @desc Setups default configuration
*/
map(self:utPort, system:utPort);
map(self:camPort, system:camPort);
f_connect4SelfOrClientSync();
} // end f_cfUp
/**
* @desc Deletes default configuration
*/
function f_cfDown() runs on ItsFa {
unmap(self:utPort, system:utPort);
unmap(self:camPort, system:camPort);
f_disconnect4SelfOrClientSync();
} // end f_cfDown
} // end of camConfigurationFunctions
/**
* @desc basic default behaviour handling
*/
[] camPort.receive(mw_camInd ( mw_camMsg_any )){
log("*** a_default: INFO: CAM message received in default ***");
repeat;
log("*** a_default: ERROR: event received on CAM port in default ***");
log("*** a_default: INCONC: a timer expired in default ***");
[] a_shutdown() {
f_poDefault();
f_cfDown();
log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***");
stop;
}
}//end altstep a_basicDefault
} // end of defaults
/**
* @desc Initialize the IUT
* @remark No specific actions specified in the base standard
*/
function f_prInitialState() runs on ItsFa {
// basic default altstep
activate(a_default());
} // end group postambles
group otherFunctions {
/** @desc function to generate a random bitstring value
* corresponding to 1 bit position set to 1 (eg '00010000', '01000000', ...)
* @see f_random
* @param p_length bitstring length - max 15
* @return bitstring
*
*/
function f_bitPositionRandom( in integer p_length )
return bitstring {
//Variables
var bitstring v_random := '00000000'B;
v_random := '000000000000001'B << f_random (0, p_length);
log("*** f_bitPositionRandom: INFO: OK - random value = " & bit2str(v_random) & " ***");
return v_random;
} // end function f_bitPositionRandom
* @see PX_PTLINE_COURSE, PX_PTLINE_REF, PX_PTLINE_ROUTE
*/
var PTLineDescription v_ptLineDescription := {"", "", ""};
v_ptLineDescription := {PX_PTLINE_COURSE, PX_PTLINE_REF, PX_PTLINE_ROUTE};
} // end function f_getIutPtLineDescription
} // end getIutFunctions
* @desc Gets tester's station characteristics
* @return Station characteristics
* @see PX_TESTER_IS_MOBILE, PX_TESTER_IS_PRIVATE, PX_TESTER_IS_PHYSICAL_RELEVANT
return CoopAwareness.stationCharacteristics {
var CoopAwareness.stationCharacteristics v_stationCharacteristics := { true, true, true };
v_stationCharacteristics := {PX_TESTER_IS_MOBILE, PX_TESTER_IS_PRIVATE, PX_TESTER_IS_PHYSICAL_RELEVANT};
return v_stationCharacteristics ;