Loading BTP/LibItsBtp_Functions.ttcn +4 −85 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ // LibIts import from LibIts_Interface all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Templates all; import from LibItsCommon_Functions all; group configurationFunctions { Loading Loading @@ -82,7 +84,7 @@ function f_prInitialState() runs on ItsNt { f_prDefault(); f_utInitializeIut(); f_utInitializeIut(m_btpInitialize); } Loading @@ -100,87 +102,4 @@ } // end postambles group upperTester { /** * @desc Requests to bring the IUT in an initial state */ function f_utInitializeIut() runs on ItsNt { utPort.send(UtBtpInitialize:{}); tc_wait.start; alt { [] utPort.receive(UtBtpResult:true) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; f_selfOrClientSyncAndVerdict("error", e_error, "*** IUT could not be initialized ***"); } [] tc_wait.timeout { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** IUT could not be initialized in time ***"); } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. * @return */ function f_utTriggerEvent(template (value) UtBtpEvent p_event) runs on ItsNt return FncRetCode { var FncRetCode v_ret := e_success; var template (value) UtBtpTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); return v_ret; } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. * @param p_discard The event should not appear. Default value: FALSE. * @return */ function f_utCheckEvent(template (value) UtBtpEvent p_event, boolean p_discard := false) runs on ItsNt { var template (value) UtBtpCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtBtpResult:true) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: Event correctly indicated at application layer ***"); } else { f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event indicated at application layer where it should be discarded ***"); } } [] utPort.receive { tc_wait.stop; if (p_discard == false) { f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event not correctly indicated at application layer ***"); } else { log("*** f_utCheckEvent: Another event indicated at application layer, repeating check ***"); repeat; } } [] tc_wait.timeout { if (p_discard == false) { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utCheckEvent: Timeout while waiting for event check result ***"); } else { log("*** f_utCheckEvent: Event not indicated at application layer ***"); } } } } } // end of group upper tester } // end LibItsBtp_Functions No newline at end of file BTP/LibItsBtp_Templates.ttcn +25 −10 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ module LibItsBtp_Templates { import from LibIts_Interface all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Pixits all; import from LibItsCommon_TypesAndValues all; group btpPrimitivesTemplates { Loading @@ -36,38 +37,52 @@ module LibItsBtp_Templates { group utPrimitives { /** * @desc Initializes the BTP IUT. */ template (value) UtInitialize m_btpInitialize := { utBtpInitialize := { } } /** * @desc Generate a BTP A packet * @param p_destPort The destination port * @param p_srcPort The source port */ template (value) UtBtpEvent m_generateBtpAPacket(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { template (value) UtEvent m_generateBtpAPacket(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { utBtpEvent := { btpA := { destinationPort := p_destPort, sourcePort := p_srcPort } } } /** * @desc Generate a BTP B packet * @param p_destPort The destination port * @param p_destPortInfo The destination port information */ template (value) UtBtpEvent m_generateBtpBPacket(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { template (value) UtEvent m_generateBtpBPacket(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { utBtpEvent := { btpB := { destinationPort := p_destPort, destinationPortInfo := p_destPortInfo } } } /** * @desc Generate a BTP B packet * @param p_destPort The destination port * @param p_destPortInfo The destination port information */ template (value) UtBtpEvent m_checkPayload(in BtpPayload p_payload) := { template (value) UtEvent m_checkPayload(in BtpPayload p_payload) := { utBtpEvent := { payload := p_payload } } } // end utPrimitives Loading BTP/LibItsBtp_TypesAndValues.ttcn +0 −10 Original line number Diff line number Diff line Loading @@ -87,16 +87,6 @@ module LibItsBtp_TypesAndValues { type record UtBtpInitialize { } type record UtBtpTrigger { UtBtpEvent utEvent } type record UtBtpCheck { UtBtpEvent utEvent } type boolean UtBtpResult; type union UtBtpEvent { BtpAHeader btpA, BtpBHeader btpB, Loading CAM/LibItsCam_Functions.ttcn +82 −73 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ module LibItsCam_Functions { // basic default altstep activate(a_default()); f_utInitializeIut(); f_utInitializeIut(m_camInitialize); } // end f_prInitialState Loading Loading @@ -128,78 +128,87 @@ module LibItsCam_Functions { } // end group otherFunctions group upperTester { /** * @desc Requests to bring the IUT in an initial state */ function f_utInitializeIut() runs on ItsFa { utPort.send(UtCamInitialize:{}); tc_wait.start; alt { [] utPort.receive(UtCamResult:true) { tc_wait.stop; log("*** f_utInitializeIut: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utInitializeIut: IUT could not be initialized ***"); stop; } [] tc_wait.timeout { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utInitializeIut: IUT could not be initialized in time ***"); stop; } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. */ function f_utTriggerEvent(template (value) UtCamEvent p_event) runs on ItsFa return FncRetCode { var FncRetCode v_ret := e_success; var template (value) UtCamTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); return v_ret; } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. */ function f_utCheckEvent(template (value) CamPdu p_event) runs on ItsFa return FncRetCode { var FncRetCode v_ret := e_success; var template (value) UtCamCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtCamResult:true) { tc_wait.stop; log("*** f_utCheckEvent: PASS: Event correctly indicated at application layer ***"); v_ret := e_success; } [] utPort.receive { tc_wait.stop; f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event not correctly indicated at application layer ***"); v_ret := e_error; } [] tc_wait.timeout { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utCheckEvent: Timeout while waiting for event check result ***"); v_ret := e_timeout; } } return v_ret; } } // end group upperTester // group upperTester { // // /** // * @desc Requests to bring the IUT in an initial state // */ // function f_utInitializeIut() runs on ItsFa { // // utPort.send(UtCamInitialize:{}); // tc_wait.start; // alt { // [] utPort.receive(UtCamResult:true) { // tc_wait.stop; // log("*** f_utInitializeIut: IUT initialized ***"); // } // [] utPort.receive { // tc_wait.stop; // f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utInitializeIut: IUT could not be initialized ***"); // } // [] tc_wait.timeout { // f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utInitializeIut: IUT could not be initialized in time ***"); // } // } // // } // // /** // * @desc Triggers event from the application layer // * @param p_event The event to trigger. // */ // function f_utTriggerEvent(template (value) UtCamEvent p_event) runs on ItsFa return FncRetCode { // var FncRetCode v_ret := e_success; // var template (value) UtCamTrigger v_utMsg := { p_event }; // // utPort.send(v_utMsg); // // return v_ret; // } // // /** // * @desc Checks that the event was indicated at the application layer // * @param p_event The event to check. // * @param p_discard The event should not appear. Default value: FALSE. // */ // function f_utCheckEvent(template (value) CamPdu p_event, boolean p_discard := false) runs on ItsFa { // var template (value) UtCamCheck v_utMsg := { p_event }; // // utPort.send(v_utMsg); // tc_wait.start; // alt { // [] utPort.receive(UtCamResult:true) { // tc_wait.stop; // if (p_discard == false) { // log("*** f_utCheckEvent: Event correctly indicated at application layer ***"); // } // else { // f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event indicated at application layer where it should be discarded ***"); // } // } // [] utPort.receive { // tc_wait.stop; // if (p_discard == false) { // f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event not correctly indicated at application layer ***"); // } // else { // log("*** f_utCheckEvent: Another event indicated at application layer, repeating check ***"); // repeat; // } // } // [] tc_wait.timeout { // if (p_discard == false) { // f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utCheckEvent: Timeout while waiting for event check result ***"); // } // else { // log("*** f_utCheckEvent: Event not indicated at application layer ***"); // } // } // } // } // // } // end group upperTester // group getIutFunctions { /** Loading CAM/LibItsCam_Templates.ttcn +87 −34 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ module LibItsCam_Templates { import from LibItsCam_Pixits all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; import from LibItsCommon_TypesAndValues all; group Primitives { Loading @@ -37,142 +38,194 @@ module LibItsCam_Templates { group utPrimitives { /** * @desc Initializes the CAM IUT. */ template (value) UtInitialize m_camInitialize := { utCamInitialize := { } } /** * @desc Change the heading * @param p_offset Offset to the current heading */ template (value) UtCamEvent m_changeHeading(Direction p_offset) := { template (value) UtEvent m_changeHeading(Direction p_offset) := { utCamEvent := { changeHeading := p_offset } } /** * @desc Change the position in the direction of the current heading * @param p_offset Offset to the current position */ template (value) UtCamEvent m_changePosition(integer p_offset) := { template (value) UtEvent m_changePosition(integer p_offset) := { utCamEvent := { changePosition := p_offset } } /** * @desc Change the speed * @param p_offset Offset to the current position */ template (value) UtCamEvent m_changeSpeed(Speed p_offset) := { template (value) UtEvent m_changeSpeed(Speed p_offset) := { utCamEvent := { changeSpeed := p_offset } } /** * @desc Set the crash status * @param p_status The status to set */ template (value) UtCamEvent m_setCrashSignal(CrashStatus p_status) := { template (value) UtEvent m_setCrashSignal(CrashStatus p_status) := { utCamEvent := { setCrashSignal := p_status } } /** * @desc Set the dangerous goods status * @param p_status The status to set */ template (value) UtCamEvent m_setDangerousGoodsStatus(DangerousGoods p_status) := { template (value) UtEvent m_setDangerousGoodsStatus(DangerousGoods p_status) := { utCamEvent := { setDangerousGoodsStatus := p_status } } //TODO not clear which parameter type to use /** * @desc Set the length and width precision * @param p_precision The precision to set */ template (value) UtCamEvent m_setLengthWidthPrecision(boolean p_precision) := { template (value) UtEvent m_setLengthWidthPrecision(boolean p_precision) := { utCamEvent := { setLengthWidthPrecision := p_precision } } /** * @desc Set the distance to the stop line * @param p_distance The distance to set */ template (value) UtCamEvent m_setDistanceToStopLine(Distance p_distance) := { template (value) UtEvent m_setDistanceToStopLine(Distance p_distance) := { utCamEvent := { setDistanceToStopLine := p_distance } } /** * @desc Set the turn advice * @param p_turnAdvice The turn advice to set */ template (value) UtCamEvent m_setTurnAdvice(TurnAdvice p_turnAdvice) := { template (value) UtEvent m_setTurnAdvice(TurnAdvice p_turnAdvice) := { utCamEvent := { setTurnAdvice := p_turnAdvice } } /** * @desc Change the curvature * @param p_offset Offset to the current curvature */ template (value) UtCamEvent m_changeCurvature(Curvature p_offset) := { template (value) UtEvent m_changeCurvature(Curvature p_offset) := { utCamEvent := { changeCurvature := p_offset } } /** * @desc Set the occupancy * @param p_occupancy The occupancy to set */ template (value) UtCamEvent m_setOccupancy(Occupancy p_occupancy) := { template (value) UtEvent m_setOccupancy(Occupancy p_occupancy) := { utCamEvent := { setOccupancy := p_occupancy } } /** * @desc Set the door status * @param p_status The status to set */ template (value) UtCamEvent m_setDoorStatus(DoorOpen p_status) := { template (value) UtEvent m_setDoorStatus(DoorOpen p_status) := { utCamEvent := { setDoorStatus := p_status } } /** * @desc Set the light bar status * @param p_status The status to set */ template (value) UtCamEvent m_setLightBarStatus(SimpleSystemState p_status) := { template (value) UtEvent m_setLightBarStatus(SimpleSystemState p_status) := { utCamEvent := { setLightBarStatus := p_status } } /** * @desc Set the sirene status * @param p_status The status to set */ template (value) UtCamEvent m_setSireneStatus(SimpleSystemState p_status) := { template (value) UtEvent m_setSireneStatus(SimpleSystemState p_status) := { utCamEvent := { setSireneStatus := p_status } } /** * @desc Set the traffic light priority * @param p_priority The priority to set */ template (value) UtCamEvent m_setTrafficLightPriority(Priority p_priority) := { template (value) UtEvent m_setTrafficLightPriority(Priority p_priority) := { utCamEvent := { setTrafficLightPriority := p_priority } } /** * @desc Set the schedule deviation * @param p_scheduleDeviation The schedule deviation to set */ template (value) UtCamEvent m_setScheduleDeviation(ScheduleDeviation p_scheduleDeviation) := { template (value) UtEvent m_setScheduleDeviation(ScheduleDeviation p_scheduleDeviation) := { utCamEvent := { setScheduleDeviation := p_scheduleDeviation } } /** * @desc Set the PT line description * @param p_ptLineDescription The PT line description to set */ template (value) UtCamEvent m_setPtLineDescription(PTLineDescription p_ptLineDescription) := { template (value) UtEvent m_setPtLineDescription(PTLineDescription p_ptLineDescription) := { utCamEvent := { setPtLineDescription := p_ptLineDescription } } /** * @desc Set the exterior lights status * @param p_status The status to set */ template (value) UtCamEvent m_setExteriorLightsStatus(ExteriorLights p_status) := { template (value) UtEvent m_setExteriorLightsStatus(ExteriorLights p_status) := { utCamEvent := { setExteriorLightsStatus := p_status } } /** * @desc Checks the receive of a message at LDM * @param p_message The CAM message to check */ template (value) UtEvent m_checkLDM(CamPdu p_message) := { utCamEvent := { checkLdm := p_message } } } // end utPrimitives Loading Loading
BTP/LibItsBtp_Functions.ttcn +4 −85 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ // LibIts import from LibIts_Interface all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Templates all; import from LibItsCommon_Functions all; group configurationFunctions { Loading Loading @@ -82,7 +84,7 @@ function f_prInitialState() runs on ItsNt { f_prDefault(); f_utInitializeIut(); f_utInitializeIut(m_btpInitialize); } Loading @@ -100,87 +102,4 @@ } // end postambles group upperTester { /** * @desc Requests to bring the IUT in an initial state */ function f_utInitializeIut() runs on ItsNt { utPort.send(UtBtpInitialize:{}); tc_wait.start; alt { [] utPort.receive(UtBtpResult:true) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; f_selfOrClientSyncAndVerdict("error", e_error, "*** IUT could not be initialized ***"); } [] tc_wait.timeout { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** IUT could not be initialized in time ***"); } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. * @return */ function f_utTriggerEvent(template (value) UtBtpEvent p_event) runs on ItsNt return FncRetCode { var FncRetCode v_ret := e_success; var template (value) UtBtpTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); return v_ret; } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. * @param p_discard The event should not appear. Default value: FALSE. * @return */ function f_utCheckEvent(template (value) UtBtpEvent p_event, boolean p_discard := false) runs on ItsNt { var template (value) UtBtpCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtBtpResult:true) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: Event correctly indicated at application layer ***"); } else { f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event indicated at application layer where it should be discarded ***"); } } [] utPort.receive { tc_wait.stop; if (p_discard == false) { f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event not correctly indicated at application layer ***"); } else { log("*** f_utCheckEvent: Another event indicated at application layer, repeating check ***"); repeat; } } [] tc_wait.timeout { if (p_discard == false) { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utCheckEvent: Timeout while waiting for event check result ***"); } else { log("*** f_utCheckEvent: Event not indicated at application layer ***"); } } } } } // end of group upper tester } // end LibItsBtp_Functions No newline at end of file
BTP/LibItsBtp_Templates.ttcn +25 −10 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ module LibItsBtp_Templates { import from LibIts_Interface all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Pixits all; import from LibItsCommon_TypesAndValues all; group btpPrimitivesTemplates { Loading @@ -36,38 +37,52 @@ module LibItsBtp_Templates { group utPrimitives { /** * @desc Initializes the BTP IUT. */ template (value) UtInitialize m_btpInitialize := { utBtpInitialize := { } } /** * @desc Generate a BTP A packet * @param p_destPort The destination port * @param p_srcPort The source port */ template (value) UtBtpEvent m_generateBtpAPacket(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { template (value) UtEvent m_generateBtpAPacket(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { utBtpEvent := { btpA := { destinationPort := p_destPort, sourcePort := p_srcPort } } } /** * @desc Generate a BTP B packet * @param p_destPort The destination port * @param p_destPortInfo The destination port information */ template (value) UtBtpEvent m_generateBtpBPacket(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { template (value) UtEvent m_generateBtpBPacket(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { utBtpEvent := { btpB := { destinationPort := p_destPort, destinationPortInfo := p_destPortInfo } } } /** * @desc Generate a BTP B packet * @param p_destPort The destination port * @param p_destPortInfo The destination port information */ template (value) UtBtpEvent m_checkPayload(in BtpPayload p_payload) := { template (value) UtEvent m_checkPayload(in BtpPayload p_payload) := { utBtpEvent := { payload := p_payload } } } // end utPrimitives Loading
BTP/LibItsBtp_TypesAndValues.ttcn +0 −10 Original line number Diff line number Diff line Loading @@ -87,16 +87,6 @@ module LibItsBtp_TypesAndValues { type record UtBtpInitialize { } type record UtBtpTrigger { UtBtpEvent utEvent } type record UtBtpCheck { UtBtpEvent utEvent } type boolean UtBtpResult; type union UtBtpEvent { BtpAHeader btpA, BtpBHeader btpB, Loading
CAM/LibItsCam_Functions.ttcn +82 −73 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ module LibItsCam_Functions { // basic default altstep activate(a_default()); f_utInitializeIut(); f_utInitializeIut(m_camInitialize); } // end f_prInitialState Loading Loading @@ -128,78 +128,87 @@ module LibItsCam_Functions { } // end group otherFunctions group upperTester { /** * @desc Requests to bring the IUT in an initial state */ function f_utInitializeIut() runs on ItsFa { utPort.send(UtCamInitialize:{}); tc_wait.start; alt { [] utPort.receive(UtCamResult:true) { tc_wait.stop; log("*** f_utInitializeIut: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utInitializeIut: IUT could not be initialized ***"); stop; } [] tc_wait.timeout { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utInitializeIut: IUT could not be initialized in time ***"); stop; } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. */ function f_utTriggerEvent(template (value) UtCamEvent p_event) runs on ItsFa return FncRetCode { var FncRetCode v_ret := e_success; var template (value) UtCamTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); return v_ret; } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. */ function f_utCheckEvent(template (value) CamPdu p_event) runs on ItsFa return FncRetCode { var FncRetCode v_ret := e_success; var template (value) UtCamCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtCamResult:true) { tc_wait.stop; log("*** f_utCheckEvent: PASS: Event correctly indicated at application layer ***"); v_ret := e_success; } [] utPort.receive { tc_wait.stop; f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event not correctly indicated at application layer ***"); v_ret := e_error; } [] tc_wait.timeout { f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utCheckEvent: Timeout while waiting for event check result ***"); v_ret := e_timeout; } } return v_ret; } } // end group upperTester // group upperTester { // // /** // * @desc Requests to bring the IUT in an initial state // */ // function f_utInitializeIut() runs on ItsFa { // // utPort.send(UtCamInitialize:{}); // tc_wait.start; // alt { // [] utPort.receive(UtCamResult:true) { // tc_wait.stop; // log("*** f_utInitializeIut: IUT initialized ***"); // } // [] utPort.receive { // tc_wait.stop; // f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utInitializeIut: IUT could not be initialized ***"); // } // [] tc_wait.timeout { // f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utInitializeIut: IUT could not be initialized in time ***"); // } // } // // } // // /** // * @desc Triggers event from the application layer // * @param p_event The event to trigger. // */ // function f_utTriggerEvent(template (value) UtCamEvent p_event) runs on ItsFa return FncRetCode { // var FncRetCode v_ret := e_success; // var template (value) UtCamTrigger v_utMsg := { p_event }; // // utPort.send(v_utMsg); // // return v_ret; // } // // /** // * @desc Checks that the event was indicated at the application layer // * @param p_event The event to check. // * @param p_discard The event should not appear. Default value: FALSE. // */ // function f_utCheckEvent(template (value) CamPdu p_event, boolean p_discard := false) runs on ItsFa { // var template (value) UtCamCheck v_utMsg := { p_event }; // // utPort.send(v_utMsg); // tc_wait.start; // alt { // [] utPort.receive(UtCamResult:true) { // tc_wait.stop; // if (p_discard == false) { // log("*** f_utCheckEvent: Event correctly indicated at application layer ***"); // } // else { // f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event indicated at application layer where it should be discarded ***"); // } // } // [] utPort.receive { // tc_wait.stop; // if (p_discard == false) { // f_selfOrClientSyncAndVerdict("error", e_error, "*** f_utCheckEvent: Event not correctly indicated at application layer ***"); // } // else { // log("*** f_utCheckEvent: Another event indicated at application layer, repeating check ***"); // repeat; // } // } // [] tc_wait.timeout { // if (p_discard == false) { // f_selfOrClientSyncAndVerdict("error", e_timeout, "*** f_utCheckEvent: Timeout while waiting for event check result ***"); // } // else { // log("*** f_utCheckEvent: Event not indicated at application layer ***"); // } // } // } // } // // } // end group upperTester // group getIutFunctions { /** Loading
CAM/LibItsCam_Templates.ttcn +87 −34 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ module LibItsCam_Templates { import from LibItsCam_Pixits all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; import from LibItsCommon_TypesAndValues all; group Primitives { Loading @@ -37,142 +38,194 @@ module LibItsCam_Templates { group utPrimitives { /** * @desc Initializes the CAM IUT. */ template (value) UtInitialize m_camInitialize := { utCamInitialize := { } } /** * @desc Change the heading * @param p_offset Offset to the current heading */ template (value) UtCamEvent m_changeHeading(Direction p_offset) := { template (value) UtEvent m_changeHeading(Direction p_offset) := { utCamEvent := { changeHeading := p_offset } } /** * @desc Change the position in the direction of the current heading * @param p_offset Offset to the current position */ template (value) UtCamEvent m_changePosition(integer p_offset) := { template (value) UtEvent m_changePosition(integer p_offset) := { utCamEvent := { changePosition := p_offset } } /** * @desc Change the speed * @param p_offset Offset to the current position */ template (value) UtCamEvent m_changeSpeed(Speed p_offset) := { template (value) UtEvent m_changeSpeed(Speed p_offset) := { utCamEvent := { changeSpeed := p_offset } } /** * @desc Set the crash status * @param p_status The status to set */ template (value) UtCamEvent m_setCrashSignal(CrashStatus p_status) := { template (value) UtEvent m_setCrashSignal(CrashStatus p_status) := { utCamEvent := { setCrashSignal := p_status } } /** * @desc Set the dangerous goods status * @param p_status The status to set */ template (value) UtCamEvent m_setDangerousGoodsStatus(DangerousGoods p_status) := { template (value) UtEvent m_setDangerousGoodsStatus(DangerousGoods p_status) := { utCamEvent := { setDangerousGoodsStatus := p_status } } //TODO not clear which parameter type to use /** * @desc Set the length and width precision * @param p_precision The precision to set */ template (value) UtCamEvent m_setLengthWidthPrecision(boolean p_precision) := { template (value) UtEvent m_setLengthWidthPrecision(boolean p_precision) := { utCamEvent := { setLengthWidthPrecision := p_precision } } /** * @desc Set the distance to the stop line * @param p_distance The distance to set */ template (value) UtCamEvent m_setDistanceToStopLine(Distance p_distance) := { template (value) UtEvent m_setDistanceToStopLine(Distance p_distance) := { utCamEvent := { setDistanceToStopLine := p_distance } } /** * @desc Set the turn advice * @param p_turnAdvice The turn advice to set */ template (value) UtCamEvent m_setTurnAdvice(TurnAdvice p_turnAdvice) := { template (value) UtEvent m_setTurnAdvice(TurnAdvice p_turnAdvice) := { utCamEvent := { setTurnAdvice := p_turnAdvice } } /** * @desc Change the curvature * @param p_offset Offset to the current curvature */ template (value) UtCamEvent m_changeCurvature(Curvature p_offset) := { template (value) UtEvent m_changeCurvature(Curvature p_offset) := { utCamEvent := { changeCurvature := p_offset } } /** * @desc Set the occupancy * @param p_occupancy The occupancy to set */ template (value) UtCamEvent m_setOccupancy(Occupancy p_occupancy) := { template (value) UtEvent m_setOccupancy(Occupancy p_occupancy) := { utCamEvent := { setOccupancy := p_occupancy } } /** * @desc Set the door status * @param p_status The status to set */ template (value) UtCamEvent m_setDoorStatus(DoorOpen p_status) := { template (value) UtEvent m_setDoorStatus(DoorOpen p_status) := { utCamEvent := { setDoorStatus := p_status } } /** * @desc Set the light bar status * @param p_status The status to set */ template (value) UtCamEvent m_setLightBarStatus(SimpleSystemState p_status) := { template (value) UtEvent m_setLightBarStatus(SimpleSystemState p_status) := { utCamEvent := { setLightBarStatus := p_status } } /** * @desc Set the sirene status * @param p_status The status to set */ template (value) UtCamEvent m_setSireneStatus(SimpleSystemState p_status) := { template (value) UtEvent m_setSireneStatus(SimpleSystemState p_status) := { utCamEvent := { setSireneStatus := p_status } } /** * @desc Set the traffic light priority * @param p_priority The priority to set */ template (value) UtCamEvent m_setTrafficLightPriority(Priority p_priority) := { template (value) UtEvent m_setTrafficLightPriority(Priority p_priority) := { utCamEvent := { setTrafficLightPriority := p_priority } } /** * @desc Set the schedule deviation * @param p_scheduleDeviation The schedule deviation to set */ template (value) UtCamEvent m_setScheduleDeviation(ScheduleDeviation p_scheduleDeviation) := { template (value) UtEvent m_setScheduleDeviation(ScheduleDeviation p_scheduleDeviation) := { utCamEvent := { setScheduleDeviation := p_scheduleDeviation } } /** * @desc Set the PT line description * @param p_ptLineDescription The PT line description to set */ template (value) UtCamEvent m_setPtLineDescription(PTLineDescription p_ptLineDescription) := { template (value) UtEvent m_setPtLineDescription(PTLineDescription p_ptLineDescription) := { utCamEvent := { setPtLineDescription := p_ptLineDescription } } /** * @desc Set the exterior lights status * @param p_status The status to set */ template (value) UtCamEvent m_setExteriorLightsStatus(ExteriorLights p_status) := { template (value) UtEvent m_setExteriorLightsStatus(ExteriorLights p_status) := { utCamEvent := { setExteriorLightsStatus := p_status } } /** * @desc Checks the receive of a message at LDM * @param p_message The CAM message to check */ template (value) UtEvent m_checkLDM(CamPdu p_message) := { utCamEvent := { checkLdm := p_message } } } // end utPrimitives Loading