Commit 2e383eed authored by Yann Garcia's avatar Yann Garcia
Browse files

Use of built-in TITAN ASN.1 codec; Renaming some of layers/codecs

parent da882b48
Loading
Loading
Loading
Loading
+88 −88
Original line number Diff line number Diff line
@@ -19,10 +19,10 @@ module ItsCps_TpFunctions {
  import from LibItsCommon_CddTemplates all;

  // LibItsCam
  import from LibItsCam_TypesAndValues all;
  import from LibItsCam_Templates all;
  import from LibItsCam_Functions all;
  import from LibItsCam_TestSystem all;
  // import from LibItsCam_TypesAndValues all;
  // import from LibItsCam_Templates all;
  // import from LibItsCam_Functions all;
  // import from LibItsCam_TestSystem all;

  // LibItsCps
  import from LibItsCps_TestSystem all;
@@ -35,32 +35,32 @@ module ItsCps_TpFunctions {
  // LibItsSecurity
  import from LibItsSecurity_Functions all;

  group cam_helpers {
  // group cam_helpers {

    function f_await_cam_and_send_reference_position(out CamInd p_camInd) runs on ItsCam  {
      // Local variables
  //   function f_await_cam_and_send_reference_position(out CamInd p_camInd) runs on ItsCam  {
  //     // Local variables

      log(">>> f_await_cam_and_send_reference_position");
  //     log(">>> f_await_cam_and_send_reference_position");
      
      map(self:camPort, system:camPort);
  //     map(self:camPort, system:camPort);
      
      tc_ac.start;
      alt {
        [] camPort.receive(
                           mw_camInd(
                                     mw_camMsg_BC_refPos
                           )) -> value p_camInd {
          log("*** " & testcasename() & ": INFO: CAM received with reference position ***");
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: CPS message not received ***");
        }
      } // End of 'alt' statement
  //     tc_ac.start;
  //     alt {
  //       [] camPort.receive(
  //                          mw_camInd(
  //                                    mw_camMsg_BC_refPos
  //                          )) -> value p_camInd {
  //         log("*** " & testcasename() & ": INFO: CAM received with reference position ***");
  //       }
  //       [] tc_ac.timeout {
  //         log("*** " & testcasename() & ": INCONC: CPS message not received ***");
  //       }
  //     } // End of 'alt' statement
      
      unmap(self:camPort, system:camPort);
    } // End of function f_await_cam_and_send_reference_position
  //     unmap(self:camPort, system:camPort);
  //   } // End of function f_await_cam_and_send_reference_position

  } // End of group cam_helpers
  // } // End of group cam_helpers

  group message_format {

@@ -482,71 +482,71 @@ module ItsCps_TpFunctions {
     */
    function f_TC_CPS_MSGF_BV_09() runs on ItsCps {
      // Local variables
      var ItsCam v_cam;
      var CamInd v_camInd;
      var CpmInd v_cpmInd;

      // Test control
      if (not PICS_VEHICLE or not PICS_CPS_GENERATION or not PICS_IS_IUT_SECURED) {
        log("*** " & testcasename() & ": PICS_VEHICLE and PICS_CPS_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // Test component configuration
      f_cfUp_01();

      // Test adapter configuration

      // Preamble
      LibItsCps_Functions.f_prInitialState();
      LibItsCps_Functions.f_utTriggerEvent(m_setVehicleType(LibItsCommon_ASN1_NamedNumbers.StationType_passengerCar_));
      v_cam := ItsCam.create("CAM_Port_Component") alive;
      v_cam.start(f_await_cam_and_send_reference_position(v_camInd));
      v_cam.done;
      f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] cpmPort.receive(
                           mw_cpmInd(
                                     mw_cpmMsg(
                                               mw_cpm_payload(
                                                              mw_management_container
      // var ItsCam v_cam;
      // var CamInd v_camInd;
      // var CpmInd v_cpmInd;

      // // Test control
      // if (not PICS_VEHICLE or not PICS_CPS_GENERATION or not PICS_IS_IUT_SECURED) {
      //   log("*** " & testcasename() & ": PICS_VEHICLE and PICS_CPS_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***");
      //   setverdict(inconc);
      //   stop;
      // }

                           )))) -> value v_cpmInd {
          tc_ac.stop;
          if (isbound(v_camInd)) {
            if (f_compare_positions(v_cpmInd.msgIn.payload.managementContainer.referencePosition, v_camInd.msgIn.cam.camParameters.basicContainer.referencePosition, 0.1)) {
              log("*** " & testcasename() & ": PASS: CPM is aligned with CAM reference position ***");
              f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
            } else {
              log("*** " & testcasename() & ": PASS: CPM is note aligned with CAM reference position ***");
              f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
            }
          } else {
            log("*** " & testcasename() & ": INCONC: no CA message received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        }
        // [v_await_cam == true] camPort.receive(
        //                                       mw_camInd(
        //                                                 mw_camMsg_BC_refPos
        //                                       )) -> value v_camInd {
        //   log("*** " & testcasename() & ": INFO: CAM received with reference position ***");
        //   v_await_cam := false;
        //   repeat;
      // // Test component configuration
      // f_cfUp_01();

      // // Test adapter configuration

      // // Preamble
      // LibItsCps_Functions.f_prInitialState();
      // LibItsCps_Functions.f_utTriggerEvent(m_setVehicleType(LibItsCommon_ASN1_NamedNumbers.StationType_passengerCar_));
      // v_cam := ItsCam.create("CAM_Port_Component") alive;
      // v_cam.start(f_await_cam_and_send_reference_position(v_camInd));
      // v_cam.done;
      // f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);

      // // Test Body
      // tc_ac.start;
      // alt {
      //   [] cpmPort.receive(
      //                      mw_cpmInd(
      //                                mw_cpmMsg(
      //                                          mw_cpm_payload(
      //                                                         mw_management_container
                                               
      //                      )))) -> value v_cpmInd {
      //     tc_ac.stop;
      //     if (isbound(v_camInd)) {
      //       if (f_compare_positions(v_cpmInd.msgIn.payload.managementContainer.referencePosition, v_camInd.msgIn.cam.camParameters.basicContainer.referencePosition, 0.1)) {
      //         log("*** " & testcasename() & ": PASS: CPM is aligned with CAM reference position ***");
      //         f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
      //       } else {
      //         log("*** " & testcasename() & ": PASS: CPM is note aligned with CAM reference position ***");
      //         f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
      //       }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: CPS message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      //     } else {
      //       log("*** " & testcasename() & ": INCONC: no CA message received ***");
      //       f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
      //     }
      //   }
      //   // [v_await_cam == true] camPort.receive(
      //   //                                       mw_camInd(
      //   //                                                 mw_camMsg_BC_refPos
      //   //                                       )) -> value v_camInd {
      //   //   log("*** " & testcasename() & ": INFO: CAM received with reference position ***");
      //   //   v_await_cam := false;
      //   //   repeat;
      //   // }
      //   [] tc_ac.timeout {
      //     log("*** " & testcasename() & ": INCONC: CPS message not received ***");
      //     f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
      //   }
      // } // End of 'alt' statement

      // Postamble
      LibItsCps_Functions.f_poDefault();
      f_cfDown_01();
      // // Postamble
      // LibItsCps_Functions.f_poDefault();
      // f_cfDown_01();

    } // End of function f_TC_CPS_MSGF_BV_09

+3 −3
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ module LibItsCps_Functions {
        f_acTriggerSecEvent(m_acDisableSecurity);
      }
      
    } // End of function f_initialiseSecuredMode()
    } // End of function f_uninitialiseSecuredMode()
    
    /**
     * @desc  Triggers event in the test system adaptation.
@@ -206,7 +206,7 @@ module LibItsCps_Functions {
    
    function f_acAwaitTimeInRunningScenario(
                                            integer p_time,
                                            boolean p_stopOnCamMessage := true
                                            boolean p_stopOnCpsMessage := true
                                            ) runs on ItsCps return FncRetCode {
        var FncRetCode v_ret := e_success;
        
@@ -216,7 +216,7 @@ module LibItsCps_Functions {
            
            tc_ac.start(int2float(p_time)*1.1);
            alt {
                [p_stopOnCamMessage] cpmPort.check(receive(mw_cpmInd ( mw_cpmMsg_any ))) {
                [p_stopOnCpsMessage] cpmPort.check(receive(mw_cpmInd ( mw_cpmMsg_any ))) {
                    tc_ac.stop;
                }
                [] acPort.receive(m_acGnssTimeReachedSuccess) {
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ module LibItsCps_TestSystem language "TTCN-3:2010 Real Time and Performance Test
    
    // FA1 ports
    port CpsPort cpmPort;
    //port CamPort camPort;
    //timers
    
    //component variables
+0 −6
Original line number Diff line number Diff line
@@ -20,10 +20,7 @@ modules := lib \
            ../AtsSecurity/lib_system \
            ../AtsBTP/lib \
            ../AtsBTP/lib_system \
            ../AtsCAM/lib \
            ../AtsCAM/lib_system \
            /ccsrc/Ports/LibIts_ports \
            /ccsrc/Ports/LibIts_ports/CAM_ports \
            /ccsrc/Ports/LibIts_ports/CPS_ports \
            /ccsrc/Ports/LibIts_ports/GN_ports \
            /ccsrc/Ports/LibIts_ports/IPv6oGN_ports \
@@ -39,12 +36,9 @@ modules := lib \
            /titan-test-system-framework/ccsrc/security \
            /ccsrc/Externals \
            /ccsrc/geospacial \
            /ccsrc/Asn1c \
            /ccsrc/framework \
            /ccsrc/Protocols/CPS \
            /ccsrc/Protocols/CPS_layers \
            /ccsrc/Protocols/CAM \
            /ccsrc/Protocols/CAM_layers \
            /ccsrc/Protocols/GeoNetworking \
            /ccsrc/Protocols/BTP \
            /ccsrc/Protocols/BTP_layers \