Commit 29998f2b authored by berge's avatar berge
Browse files

Changed 'with encode' statements. Modif

parent 22399a1e
......@@ -148,7 +148,7 @@ module LibItsBtp_TypesAndValues {
type boolean UtResult;
}
with {
encode "LibItsCommon_TypesAndValues"
encode "LibItsCommon"
}
/**
......@@ -170,5 +170,5 @@ module LibItsBtp_TypesAndValues {
}
with {
encode "LibItsBtp_TypesAndValues"
encode "LibItsBtp"
}
......@@ -16,6 +16,7 @@ module LibItsCam_Functions {
import from LibItsCam_Templates all;
import from LibItsCam_TypesAndValues all;
import from LibItsCommon_Functions all;
import from LibItsCommon_TypesAndValues all;
import from ITS_Container language "ASN.1:1997" all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
......@@ -55,10 +56,9 @@ module LibItsCam_Functions {
* @desc Triggers event from the application layer
* @param p_event The event to trigger.
*/
function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsCam {
var template (value) UtTrigger v_utMsg := { p_event };
utPort.send(v_utMsg);
function f_utTriggerEvent(template (value) UtCamTrigger p_event) runs on ItsCam {
utPort.send(p_event);
alt {
[] utPort.receive(UtResult:true) {
tc_wait.stop;
......@@ -79,7 +79,7 @@ module LibItsCam_Functions {
* @param p_event The event to check.
* @param p_discard The event should not appear. Default value: FALSE.
*/
function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard := false) runs on ItsCam {
function f_utCheckEvent(template (value) UtCamTrigger p_event, boolean p_discard := false) runs on ItsCam {
var template (value) UtCheck v_utMsg := { p_event };
utPort.send(v_utMsg);
......
......@@ -9,6 +9,7 @@ module LibItsCam_Templates {
// LibIts
import from LibItsCommon_Functions all;
import from LibItsCommon_TypesAndValues all;
import from LibItsCam_TestSystem all;
import from LibItsCam_TypesAndValues all;
import from ITS_Container language "ASN.1:1997" all;
......@@ -43,98 +44,78 @@ module LibItsCam_Templates {
* @desc Initializes the CAM IUT.
*/
template (value) UtInitialize m_camInitialize := {
utCamInitialize := {
}
}
/**
* @desc Change the curvature
* @param p_offset The curvature value offset
*/
template (value) UtEvent m_changeCurvature(CurvatureValue p_offset) := {
utCamEvent := {
changeCurvature := p_offset
}
template (value) UtCamTrigger m_changeCurvature(CurvatureValue p_offset) := {
changeCurvature := p_offset
}
/**
* @desc Change the speed
* @param p_offset The speed value offset
*/
template (value) UtEvent m_changeSpeed(SpeedValue p_offset) := {
utCamEvent := {
changeSpeed := p_offset
}
template (value) UtCamTrigger m_changeSpeed(SpeedValue p_offset) := {
changeSpeed := p_offset
}
/**
* @desc Set the acceleration control status
* @param p_status The status to set
*/
template (value) UtEvent m_setAccelerationControlStatus(AccelerationControl p_status) := {
utCamEvent := {
setAccelerationControlStatus := p_status
}
template (value) UtCamTrigger m_setAccelerationControlStatus(AccelerationControl p_status) := {
setAccelerationControlStatus := p_status
}
/**
* @desc Set the exterior lights status
* @param p_status The status to set
*/
template (value) UtEvent m_setExteriorLightsStatus(ExteriorLights p_status) := {
utCamEvent := {
setExteriorLightsStatus := p_status
}
template (value) UtCamTrigger m_setExteriorLightsStatus(ExteriorLights p_status) := {
setExteriorLightsStatus := p_status
}
/**
* @desc Change the heading
* @param p_offset The heading value offset
*/
template (value) UtEvent m_changeHeading(HeadingValue p_offset) := {
utCamEvent := {
changeHeading := p_offset
}
template (value) UtCamTrigger m_changeHeading(HeadingValue p_offset) := {
changeHeading := p_offset
}
/**
* @desc Set the drive direction
* @param p_driveDirection The drive direction
*/
template (value) UtEvent m_setDriveDirection(DriveDirection p_driveDirection) := {
utCamEvent := {
setDriveDirection := p_driveDirection
}
template (value) UtCamTrigger m_setDriveDirection(DriveDirection p_driveDirection) := {
setDriveDirection := p_driveDirection
}
/**
* @desc Change the yaw rate
* @param p_offset The yaw rate value offset
*/
template (value) UtEvent m_changeYawRate(YawRateValue p_offset) := {
utCamEvent := {
changeYawRate := p_offset
}
template (value) UtCamTrigger m_changeYawRate(YawRateValue p_offset) := {
changeYawRate := p_offset
}
/**
* @desc Change the position in the direction of the current heading
* @param p_offset Offset to the current position in meter
*/
template (value) UtEvent m_changePosition(integer p_offset) := {
utCamEvent := {
changePosition := p_offset
}
template (value) UtCamTrigger m_changePosition(integer p_offset) := {
changePosition := p_offset
}
/**
* @desc Checks the receive of a message at LDM
* @param p_message The CAM message to check
*/
template (value) UtEvent m_checkLdm(CAM p_message) := {
utCamEvent := {
checkLdm := p_message
}
template (value) UtCamTrigger m_checkLdm(CAM p_message) := {
checkLdm := p_message
}
} // end utPrimitives
......
......@@ -13,6 +13,7 @@ module LibItsCam_TestSystem {
// LibIts
import from LibItsCommon_TestSystem all;
import from LibItsCommon_TypesAndValues all;
import from LibItsCam_TypesAndValues all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
......@@ -25,9 +26,9 @@ module LibItsCam_TestSystem {
*/
type port UpperTesterPort message {
out
UtInitialize, UtTrigger, UtCheck;
UtInitialize, UtCamTrigger, UtCheck;
in
UtResult;
UtInitializeResult, UtResult;
} // end UpperTesterPort
} // end portDefinitions
......
......@@ -30,33 +30,12 @@ module LibItsCam_TypesAndValues {
group utPrimitives {
group utCommonPrimitives {
/**
* @desc Upper Tester message to initialize IUT
*/
type union UtInitialize {
UtCamInitialize utCamInitialize
}
/**
* @desc Upper Tester message describing an action/event
*/
type union UtEvent {
UtCamEvent utCamEvent
}
/**
* @desc Upper Tester message to trigger an action on IUT
*/
type record UtTrigger {
UtEvent utEvent
}
/**
* @desc Upper Tester message to check event/status on IUT
*/
type record UtCheck {
UtEvent utEvent
type record UtCheck { /* FIXME: change this as in DENM */
UtCamTrigger utEvent
}
/**
......@@ -65,13 +44,7 @@ module LibItsCam_TypesAndValues {
type boolean UtResult;
}
with {
encode "LibItsCommon_TypesAndValues"
}
/**
* @desc Trigger to initialize the IUT.
*/
type record UtCamInitialize {
encode "LibItsCommon"
}
/**
......@@ -86,7 +59,7 @@ module LibItsCam_TypesAndValues {
* @member changePosition Changes the position in the direction of the current heading in meters.
* @member checkLdm Checks that the received CAM was provided at LDM.
*/
type union UtCamEvent {
type union UtCamTrigger {
CurvatureValue changeCurvature,
SpeedValue changeSpeed,
AccelerationControl setAccelerationControlStatus,
......@@ -94,12 +67,17 @@ module LibItsCam_TypesAndValues {
HeadingValue changeHeading,
DriveDirection setDriveDirection,
YawRateValue changeYawRate,
integer changePosition,
CAM checkLdm
integer changePosition, /* FIXME: use UtChangePosition */
CAM checkLdm /* FIXME: obselete, to be removed */
}
/**
* @desc Upper Tester result message of request of triggering of an event at IUT
*/
type boolean UtCamTriggerResult;
} // end utPrimitives
}
with {
encode "LibItsCam_TypesAndValues"
encode "LibItsCam"
}
......@@ -8,7 +8,39 @@
module LibItsCommon_TypesAndValues {
import from ITS_Container language "ASN.1:1997" all;
group utPrimitives {
/**
* @desc Upper Tester message to initialize DENM IUT
*/
type record UtInitialize {
// empty on purpose
}
/**
* @desc Upper Tester result message of the initialization request
*/
type boolean UtInitializeResult;
/**
* @desc Upper Tester message to change the position of IUT. Values a relatives
*/
type record UtChangePosition {
integer latitude,
integer longitude,
integer elevation
}
/**
* @desc Upper Tester result message of change position request of IUT
*/
type boolean UtChangePositionResult;
}
with {
encode "UpperTester"
}
group commonConstants {
const ElevationValue c_seaLevel := 0;
......@@ -19,7 +51,7 @@ module LibItsCommon_TypesAndValues {
const SemiAxisLength c_semiAxisLengthOneCentimeter := 1;
const SemiAxisLength c_semiAxisLengthUnavailable := 4095;
/**
* @remark check this values
*/
......@@ -70,5 +102,5 @@ module LibItsCommon_TypesAndValues {
}
with {
encode "LibItsCommon_TypesAndValues"
encode "LibItsCommon"
}
......@@ -16,6 +16,7 @@ module LibItsDenm_Functions {
};
// LibIts
import from LibItsCommon_TypesAndValues all;
import from LibItsDenm_TestSystem all;
import from LibItsDenm_TypesAndValues all;
import from LibItsDenm_Templates all;
......@@ -45,12 +46,12 @@ module LibItsDenm_Functions {
* @desc Triggers an event from the application layer
* @param p_event The event to trigger.
*/
function f_utTriggerEvent(template (value) UtTrigger p_event) runs on ItsDenm return ActionID {
function f_utTriggerEvent(template (value) UtDenmTrigger p_event) runs on ItsDenm return ActionID {
var ActionID v_actionId;
utPort.send(p_event);
alt {
[] utPort.receive(UtTriggerResult:?) -> value v_actionId {
[] utPort.receive(UtDenmTriggerResult:?) -> value v_actionId {
tc_wait.stop;
}
[] a_utDefault();
......@@ -63,12 +64,12 @@ module LibItsDenm_Functions {
* @desc Updates an event at the application layer
* @param p_event The event to update.
*/
function f_utUpdateEvent(template (value) UtUpdate p_event) runs on ItsDenm return ActionID {
function f_utUpdateEvent(template (value) UtDenmUpdate p_event) runs on ItsDenm return ActionID {
var ActionID v_actionId;
utPort.send(p_event);
alt {
[] utPort.receive(UtUpdateResult:?) -> value v_actionId {
[] utPort.receive(UtDenmUpdateResult:?) -> value v_actionId {
tc_wait.stop;
}
[] a_utDefault();
......@@ -81,11 +82,11 @@ module LibItsDenm_Functions {
* @desc Terminates an event at the application layer
* @param p_event The event to terminate.
*/
function f_utTerminateEvent(template (value) UtTermination p_event) runs on ItsDenm {
function f_utTerminateEvent(template (value) UtDenmTermination p_event) runs on ItsDenm {
utPort.send(p_event);
alt {
[] utPort.receive(UtTerminationResult:?) {
[] utPort.receive(UtDenmTerminationResult:?) {
tc_wait.stop;
}
[] a_utDefault();
......@@ -172,8 +173,8 @@ module LibItsDenm_Functions {
* @desc The default for handling upper tester messages.
*/
altstep a_utDefault() runs on ItsDenm {
var UtEventInd v_event;
[] utPort.receive(UtEventInd:?) -> value v_event {
var UtDenmEventInd v_event;
[] utPort.receive(UtDenmEventInd:?) -> value v_event {
//store every upper tester indication received
vc_utEvents[lengthof(vc_utEvents)] := v_event;
repeat;
......
......@@ -57,7 +57,7 @@ module LibItsDenm_Templates {
* @param p_keepAliveForwardingRequest The keep alive forwarding request flag (Default: omit)
* @param p_alacarte The Alacarte container (Default: omit)
*/
template (value) UtTrigger m_utTriggerEvent(
template (value) UtDenmTrigger m_utTriggerEvent(
template (value) SituationContainer p_situation,
template (value) LocationContainer p_location,
template (omit) ValidityDuration p_validityDuration := omit,
......@@ -92,7 +92,7 @@ module LibItsDenm_Templates {
* @param p_keepAliveForwardingRequest The keep alive forwarding request flag (Default: omit)
* @param p_alacarte The Alacarte Container (Default: omit)
*/
template (value) UtUpdate m_utUpdateEvent(
template (value) UtDenmUpdate m_utUpdateEvent(
template (value) ActionID p_actionId,
template (omit) SituationContainer p_situation := omit,
template (omit) LocationContainer p_location := omit,
......@@ -121,7 +121,7 @@ module LibItsDenm_Templates {
* @desc Send template for Upper Tester event cancellation
* @param p_actionId The action id
*/
template (value) UtTermination m_utEventCancellation(
template (value) UtDenmTermination m_utEventCancellation(
template (value) ActionID p_actionId
) := {
actionId := p_actionId
......
......@@ -13,6 +13,7 @@ module LibItsDenm_TestSystem {
// LibIts
import from LibItsCommon_TestSystem all;
import from LibItsCommon_TypesAndValues all;
import from LibItsDenm_TypesAndValues all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all;
......@@ -25,9 +26,9 @@ module LibItsDenm_TestSystem {
*/
type port UpperTesterPort message {
out
UtInitialize, UtTrigger, UtUpdate, UtTermination, UtChangePosition;
UtInitialize, UtDenmTrigger, UtDenmUpdate, UtDenmTermination, UtChangePosition;
in
UtInitializeResult, UtTriggerResult, UtUpdateResult, UtTerminationResult, UtChangePositionResult, UtEventInd;
UtInitializeResult, UtDenmTriggerResult, UtDenmUpdateResult, UtDenmTerminationResult, UtChangePositionResult, UtDenmEventInd;
} // end UpperTesterPort
} // end portDefinitions
......@@ -88,7 +89,7 @@ module LibItsDenm_TestSystem {
var SequenceNumber vc_sequenceNo := 0;
var boolean vc_denmReceived := false;
var UtEventIndList vc_utEvents := {};
var UtDenmEventIndList vc_utEvents := {};
} // End of component ItsDenm
......
......@@ -57,20 +57,10 @@ module LibItsDenm_TypesAndValues {
group utPrimitives {
/**
* @desc Upper Tester message to initialize DENM IUT
*/
type record UtInitialize {
}
/**
* @desc Upper Tester result message of the initialization request
*/
type boolean UtInitializeResult;
/**
* @desc Upper Tester message to request triggering of an event at IUT
*/
type record UtTrigger {
type record UtDenmTrigger {
TimestampIts detectionTime,
ValidityDuration validityDuration optional,
ValidityDuration repetitionDuration optional,
......@@ -86,12 +76,12 @@ module LibItsDenm_TypesAndValues {
/**
* @desc Upper Tester result message of request of triggering of an event at IUT
*/
type ActionID UtTriggerResult;
type ActionID UtDenmTriggerResult;
/**
* @desc Upper Tester message to update an event at IUT
*/
type record UtUpdate {
type record UtDenmUpdate {
ActionID actionId,
TimestampIts detectionTime,
ValidityDuration validityDuration optional,
......@@ -107,46 +97,33 @@ module LibItsDenm_TypesAndValues {
/**
* @desc Upper Tester result message of an update request of an event on DENM IUT
*/
type ActionID UtUpdateResult;
type ActionID UtDenmUpdateResult;
/**
* @desc Upper Tester message to request the termination of an event at IUT
*/
type record UtTermination {
type record UtDenmTermination {
ActionID actionId
}
/**
* @desc Upper Tester result message of termination of an event on DENM IUT
*/
type boolean UtTerminationResult;
/**
* @desc Upper Tester message to change the position of IUT. Values a relatives
*/
type record UtChangePosition {
integer latitude,
integer longitude,
integer elevation
}
/**
* @desc Upper Tester result message of change position request of IUT
*/
type boolean UtChangePositionResult;
type boolean UtDenmTerminationResult;
/**
* @desc Upper Tester message to check event/status on DENM IUT
*/
type record UtEventInd {
type record UtDenmEventInd {
DENM denMsg
}
/**
* @desc List of Upper Tester messages to check event/status on DENM IUT
*/
type record of UtEventInd UtEventIndList;
type record of UtDenmEventInd UtDenmEventIndList;
} // end utPrimitives
}
with {
encode "LibItsDenm_TypesAndValues"
encode "LibItsDenm"
}
......@@ -16,6 +16,7 @@ module LibItsGeoNetworking_Functions {
// LibIts
import from LibItsCommon_Functions all;
import from LibItsCommon_TestSystem all;
import from LibItsCommon_TypesAndValues all;
import from LibItsGeoNetworking_Functions all;
import from LibItsGeoNetworking_TestSystem all;
import from LibItsGeoNetworking_TypesAndValues all;
......@@ -31,7 +32,7 @@ module LibItsGeoNetworking_Functions {
* @param p_init The initialisation to trigger.
*/
function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsBaseGeoNetworking {
utPort.send(p_init);
tc_wait.start;
alt {
......@@ -52,17 +53,42 @@ module LibItsGeoNetworking_Functions {
repeat;
}
}
}
/**
* @desc Requests to change the position of the IUT
*/
function f_utChangePosition() runs on ItsBaseGeoNetworking {
utPort.send(m_changePosition);
tc_wait.start;
alt {
[] utPort.receive(UtResult:true) {
tc_wait.stop;
log("*** f_utInitializeIut: INFO: IUT initialized ***");
}
[] utPort.receive {
tc_wait.stop;
log("*** f_utInitializeIut: INFO: IUT could not be initialized ***");
f_selfOrClientSyncAndVerdict("error", e_error);
}
[] tc_wait.timeout {
log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***");
f_selfOrClientSyncAndVerdict("error", e_timeout);
}
[else] { // Shortcut defaults
repeat;
}
}
}
/**
* @desc Triggers event from the application layer
* @param p_event The event to trigger.
*/
function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsGeoNetworking {
var template (value) UtTrigger v_utMsg := { p_event };
function f_utTriggerEvent(template (value) UtGnTrigger p_event) runs on ItsGeoNetworking {
utPort.send(v_utMsg);
utPort.send(p_event);
alt {
[] utPort.receive(UtResult:true) {
tc_wait.stop;
......@@ -83,10 +109,9 @@ module LibItsGeoNetworking_Functions {
* @param p_event The event to check.
* @param p_discard The event should not appear. Default value: FALSE.
*/
function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsGeoNetworking {
var template (value) UtCheck v_utMsg := { p_event };
function f_utCheckEvent(template (value) UtGnTrigger p_event, boolean p_discard) runs on ItsGeoNetworking {
utPort.send(v_utMsg);
utPort.send(p_event);
tc_wait.start;
alt {
[] utPort.receive(UtResult:true) {
......
......@@ -12,6 +12,7 @@ module LibItsGeoNetworking_Templates {
import from LibCommon_DataStrings all;
// LibIts
import from LibItsCommon_TypesAndValues all