/******************************************************************************/
// @copyright   Copyright Notification
//   No part may be reproduced except as authorized by written permission.
//   The copyright and the foregoing restriction extend to reproduction in all media.
//   Trademark 2010, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC).
//   All rights reserved.
// @version: IWD_10wk37
// $Date: 2010-09-10 11:12:18 +0200 (Fri, 10 Sep 2010) $
// $Rev: 3837 $
/******************************************************************************/

module InterRat_Handover_to_EUTRA_UTRAN {

//----------------------------------------------------------------------
// Import part
//----------------------------------------------------------------------
  
  import from CommonIratDefs all;
  
  import from UTRAN_RRC_ASN1_Definitions language "ASN.1:1997" all;
  import from UTRAN_ASP_Definitions language "ASN.1:1997" all;

  import from UTRAN_Component all;
  import from UTRAN_CommonFunctions all;
  import from UTRAN_CellInfo all;
  import from UTRAN_Templates all;
  import from UTRAN_RAB_Functions all;
  import from UTRAN_ConfigurationSteps all;
  
  import from EUTRA_CapabilityFunctions all;
  import from UTRAN_CapabilityFunctions all;
  
  //----------------------------------------------------------------------
  // Templates
  //----------------------------------------------------------------------
  
  
  
  //R5-096461 36.508 Table 4.7B.1-2: HANDOVER FROM UTRAN COMMAND
  template (value) DL_DCCH_Message cs_HandoverFromUTRANCommand_EUTRA (IntegrityCheckInfo        p_Integrityinfo,
                                                                      RRC_TransactionIdentifier p_RRC_TI,
                                                                      octetstring p_Eutra_Message) :=
  {
    integrityCheckInfo := p_Integrityinfo,
    message_ := {
      handoverFromUTRANCommand_EUTRA := {
        rrc_TransactionIdentifier := p_RRC_TI,
        criticalExtensions := {
          r8 := {
            handoverFromUTRANCommand_EUTRA_r8 := {
              activationTime :=  omit,
              toHandoverRAB_Info := {
                {
                  rab_Identity  := {
                    gsm_MAP_RAB_Identity := '00000101'B
                  },
                  //mbms_SessionIdentity := omit, //- Not specified in message
                  //mbms_ServiceIdentity := omit,
                  cn_DomainIdentity := ps_domain,
                  nas_Synchronisation_Indicator := omit, //not present specified
                  re_EstablishmentTimer := useT315
                }
              },
              eutra_Message := p_Eutra_Message
            },
            handoverFromUTRANCommand_EUTRA_r8_add_ext := omit,
            nonCriticalExtensions := omit
          }
        }
      }
    }
  };
  
  //R5-096461 36.508 Table 4.7B.1-3: MEASUREMENT CONTROL for Inter-frequency
  //deprecated
  /*template DL_DCCH_Message cs_MeasurementControl_InterFreqMeasurement (
                                                  IntegrityCheckInfo        p_Integrityinfo,
                                                  RRC_TransactionIdentifier p_RRC_TI
                                                  ) :=
  {
     integrityCheckInfo := p_Integrityinfo,
     message_ := {
                measurementControl := {
                    later_than_r3 := {
                        rrc_TransactionIdentifier := p_RRC_TI,
                        criticalExtensions := {
                            later_than_r4 := {
                                 rrc_TransactionIdentifier_MSP := p_RRC_TI, //Left as same value (0..3)
                                    criticalExtensions := {
                                        criticalExtensions := {
                                            criticalExtensions := {
                                                    r8  := {
                                                        measurementControl_r8  := {  //MeasurementControl-r8-IEs,
                                                                //-- Measurement IEs
                                                                measurementIdentity  := 3,
                                                                //-- TABULAR: The measurement type is included in measurementCommand.
                                                                measurementCommand := {  //MeasurementCommand-r8,
                                                                    setup := {
                                                                        //MeasurementType-r8
                                                                        interFrequencyMeasurement   := {//InterFrequencyMeasurement-r8
                                                                                interFreqCellInfoList := {//               InterFreqCellInfoList-r8,
                                                                                        removedInterFreqCellList  := {
                                                                                            removeAllInterFreqCells  := NULL
                                                                                        },
                                                                                        newInterFreqCellList := omit,
                                                                                        cellsForInterFreqMeasList   := omit
                                                                                },
                                                                                interFreqMeasQuantity := {
                                                                                    reportingCriteria := {
                                                                                        interFreqReportingCriteria := {
                                                                                                filterCoefficient := fc0,
                                                                                                modeSpecificInfo := {
                                                                                                    fdd :=  {
                                                                                                        freqQualityEstimateQuantity_FDD := cpich_Ec_N0
                                                                                                    }
                                                                                                }
                                                                                        }
                                                                                    }
                                                                                },
                                                                                interFreqReportingQuantity  := omit,//          InterFreqReportingQuantity            OPTIONAL,
                                                                                measurementValidity := omit,//                   MeasurementValidity                    OPTIONAL,
                                                                                interFreqSetUpdate  := omit,//                  UE-AutonomousUpdateMode                OPTIONAL,
                                                                                adjacentFrequencyIndex := omit,//               INTEGER (0..31)                        OPTIONAL,
                                                                                reportCriteria     := {//                   InterFreqReportCriteria-r7
                                                                                    intraFreqReportingCriteria   := {//IntraFreqReportingCriteria-r7
                                                                                        eventCriteriaList := {
                                                                                            {
                                                                                                        event    := {//   IntraFreqEvent-r7
                                                                                                            e1a := {//     Event1a-r4,
                                                                                                                    triggeringCondition         := activeSetCellsOnly,   //TriggeringCondition2,
                                                                                                                    reportingRange              := 0,                    //ReportingRange,
                                                                                                                    forbiddenAffectCellList     := omit,                 //ForbiddenAffectCellList-r4
                                                                                                                    w                           := 0,                    //W,
                                                                                                                    reportDeactivationThreshold := notApplicable,        //ReportDeactivationThreshold,
                                                                                                                    reportingAmount             := ra1,                  //ReportingAmount,
                                                                                                                    reportingInterval           := noPeriodicalreporting //ReportingInterval
                                                                                                            }
                                                                                                        },
                                                                                                        hysteresis := 0,//                           Hysteresis,
                                                                                                        timeToTrigger := ttt0,//                     TimeToTrigger,
                                                                                                        reportingCellStatus := {//                   ReportingCellStatus   OPTIONAL
                                                                                                            withinActiveSet   :=  e1
                                                                                                        }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                        }
                                                                    }
                                                                },
                                                                measurementReportingMode  := {    //MeasurementReportingMode            OPTIONAL,
                                                                        measurementReportTransferMode := acknowledgedModeRLC,
                                                                        periodicalOrEventTrigger      := eventTrigger
                                                                },
                                                                additionalMeasurementList  := omit,
                                                                //-- Physical channel IEs
                                                                dpch_CompressedModeStatusInfo := {
                                                                    tgps_Reconfiguration_CFN  := 0,
                                                                    tgp_SequenceShortList     := {
                                                                        {
                                                                            tgpsi := 1,
                                                                            tgps_Status := {
                                                                                activate_ := {
                                                                                    tgcfn := 0
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                        },
                                                        //-- Container for adding non critical extensions after freezing REL-9
                                                        measurementControl_r8_add_ext   := omit, // BIT STRING        OPTIONAL,
                                                        nonCriticalExtensions           := omit  // SEQUENCE {}        OPTIONAL
                                                    }
                                            }
                                        }
                                    }
                            }
                        }
                    }
                }
     }
  }*/


  //R5-096461 36.508 Table 4.7B.1-3: MEASUREMENT CONTROL for Inter-RAT
  template (value) DL_DCCH_Message cs_MeasurementControl_InterRATMeasurement (IntegrityCheckInfo         p_Integrityinfo,
                                                                              RRC_TransactionIdentifier  p_RRC_TI,
                                                                              integer                    p_EutraCell_ARFCN,
                                                                              EUTRA_MeasurementBandwidth p_EutraCell_MeasBandwidth,
                                                                              TGPS_Reconfiguration_CFN   p_Tgps_Reconfiguration_CFN,
                                                                              TGCFN                      p_TGCFN) :=
  {
    integrityCheckInfo := p_Integrityinfo,
    message_ := {
      measurementControl := {
        later_than_r3 := {
          rrc_TransactionIdentifier := p_RRC_TI,
          criticalExtensions := {
            later_than_r4 := {
              rrc_TransactionIdentifier_MSP := p_RRC_TI, //Left as same value (0..3)
              criticalExtensions := {
                criticalExtensions := {
                  criticalExtensions := {
                    r8  := {
                      measurementControl_r8  := {  //MeasurementControl-r8-IEs,
                        //-- Measurement IEs
                        measurementIdentity  := 3,
                        //-- TABULAR: The measurement type is included in measurementCommand.
                        measurementCommand := {  //MeasurementCommand-r8,
                          setup := {
                            //MeasurementType-r8
                            interRATMeasurement   := {//InterRATMeasurement-r8
                              interRATMeasurementObjects := {
                                eutra_FrequencyList := {
                                  eutraFrequencyRemoval  := {                 //EUTRA-FrequencyRemoval
                                    removeNoFrequencies  := NULL
                                  },
                                  eutraNewFrequencies      := {//              EUTRA-FrequencyInfoList
                                    {
                                      earfcn  := p_EutraCell_ARFCN,
                                      measurementBandwidth := p_EutraCell_MeasBandwidth,
                                      eutra_blackListedCellList   := omit
                                    }
                                  }
                                }
                              },
                              interRATMeasQuantity :=  {//              InterRATMeasQuantity-r8                OPTIONAL,
                                measQuantityUTRAN_QualityEstimate  := {//      IntraFreqMeasQuantity            OPTIONAL,
                                  filterCoefficient := fc0,
                                  modeSpecificInfo  := {
                                    fdd   := {
                                      intraFreqMeasQuantity_FDD  := cpich_Ec_N0      //IntraFreqMeasQuantity-FDD
                                    }
                                  }
                                },
                                ratSpecificInfo  := {
                                  e_UTRA  := {
                                    measurementQuantity := rsrq,//       MeasurementQuantityEUTRA,
                                    filterCoefficient   := fc0  //       FilterCoefficient        DEFAULT fc0
                                  }
                                }
                              },
                              interRATReportingQuantity := omit,//            InterRATReportingQuantity-r8        OPTIONAL,
                              reportCriteria  :={//                       InterRATReportCriteria,
                                interRATReportingCriteria := {
                                  interRATEventList  := {
                                    {
                                      event3a:= {
                                        thresholdOwnSystem    :=  -66,
                                        w                     :=    0,
                                        thresholdOtherSystem  :=  -80,
                                        hysteresis            :=    0,
                                        timeToTrigger         :=   ttt10,
                                                                                                reportingCellStatus   := {
                                          withinActSetOrVirtualActSet_InterRATcells := e2
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              idleIntervalInfo := omit//                 IdleIntervalInfo                    OPTIONAL
                            }
                          } //end setup
                        },
                        measurementReportingMode  := {    //MeasurementReportingMode            OPTIONAL,
                          measurementReportTransferMode := acknowledgedModeRLC,
                          periodicalOrEventTrigger      := eventTrigger
                        },
                        additionalMeasurementList  := omit,
                        //-- Physical channel IEs
                        dpch_CompressedModeStatusInfo := {
                          tgps_Reconfiguration_CFN  := p_Tgps_Reconfiguration_CFN,
                          tgp_SequenceShortList     := {
                            {
                              tgpsi := 1,
                              tgps_Status := {
                                activate_ := {
                                  tgcfn := p_TGCFN
                                }
                              }
                            }
                          }
                        }
                      },
                      //-- Container for adding non critical extensions after freezing REL-9
                      measurementControl_r8_add_ext   := omit, // BIT STRING        OPTIONAL,
                      nonCriticalExtensions           := omit  // SEQUENCE {}        OPTIONAL
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  };
  
  //R5-095652 36.508 Table 4.7B.1-4: MEASUREMENT REPORT
  template UL_DCCH_Message cr_MeasurementReport :=
  {
    integrityCheckInfo := *,
    message_ := {
      measurementReport := {
        measurementIdentity := 3,
        measuredResults := omit,
        measuredResultsOnRACH := omit,
        additionalMeasuredResults := omit,
        eventResults := omit,
        v390nonCriticalExtensions  := *
      }
    }
  };
  
  
  //----------------------------------------------------------------------
  // Functions
  //----------------------------------------------------------------------
  
  //* @desc Test case 8.4.2.2 Inter-RAT Handover / from UTRA(PS) to E-UTRA  / Data
  function f_TC_8_4_2_2_UTRAN() runs on UTRAN_PTC
  {
    var boolean v_TriggerRxd := false;
    var UTRAN_FDD_TDD v_FDD_TDD_Mode;
    //@sic Removed T0 from CR R5-104789 @sic
    var integer v_T1_CPICH_Cell5 := -65;
    var integer v_T1_PCCPCH_Cell5 := -67;
    var integer v_T2_CPICH_Cell5 := -115;
    var integer v_T2_PCCPCH_Cell5 := -67;

    var UTRAN_SecurityInfo_Type v_SecurityInfo;
    var RRC_TransactionIdentifier v_RRC_TI := 0;
    var TGCFN v_TGCFN;
    var integer v_FrameNumber;
    var TGPS_Reconfiguration_CFN   v_Tgps_Reconfiguration_CFN;
    var integer v_TtiValue := 4; //cell_DCH_64kPS_RAB_SRB is configured

    var octetstring v_RRCConnectionConfigurationMessage;
    var IRAT_CoOrd_SysInfo_Type v_EUTRASysInfo;

    var EUTRA_MeasurementBandwidth v_EUTRA_MeasurementBandwidth := f_UTRAN_ConvertIntegerToEUTRA_MeasurementBandwidth(f_ConvertDL_BandwidthPIXITToInteger());

    //* @desc Initialise all cells
    f_UTRAN_Init ( EUTRA_UTRAN );

    v_SecurityInfo := f_UTRAN_Security_Get ( );

    //Send the cell info to the EUTRA component
    f_UTRAN_Send_IR_SysInfoToEUTRA ( utran_Cell5 );

    //Get Cell Parameters for EUTRA cell
    v_EUTRASysInfo := f_WaitForIRATCoOrd_SysInfo (EUTRA);
    
    //* @desc Create and configure Cell 5
    //* Cell started switched on with default power level, -60 and max attenuation
    f_SS_CreateCellDCH ( utran_Cell5 );

    //* @desc Start sending System Information
    f_UTRAN_SendDefSysInfo ( utran_Cell5 );

    //UE starts registered in EUTRA, wait its Auth Params
    f_UTRAN_InterRAT_InitialiseAuthParams();
    
    //* @desc Get FDD or TDD mode
    v_FDD_TDD_Mode := f_UTRAN_CellInfo_GetFDD_TDD ( utran_Cell5 );
      
    f_UTRAN_TestBody_Set( true );
    
    //@siclog "Step 1" siclog@
    //The SS changes Cell 1 and Cell 5 level according to the row "T1" in table 8.4.2.2.3.2-1.
    f_UTRAN_SetCellPower( utran_Cell5, v_T1_CPICH_Cell5, v_T1_PCCPCH_Cell5);
    
    //@siclog "Step 2" siclog@
    //Generic procedure in 36.508 subclause 6.4.2.8 is performed on cell 5
    //NOTE: The UE performs a RAU procedure and the RRC connection is released.
    f_UTRAN_508CheckCampOnNewUtranCell ( utran_Cell5 );
    
    //@siclog "Step 3 and 4" siclog@
    //34.108 subclause 7.2.4.2.3 on cell5
    f_UTRAN_UE_64kPS_Rb_Est( utran_Cell5 );
    
    //@siclog "Step 5 - 6" siclog@
    //SS tx a phy channel reconfig on cell5 and UE tx a phy channel reconfig complete on cell5
    f_UTRAN_PhyChReconf_InterRatCompresseModeActivate ( utran_Cell5 );
    
    v_FrameNumber := f_CPHY_GetFrameNumber (utran_Cell5, tsc_DL_DPCH1 );
    //Physical Channel identity is hardcoded to the value set in cell_DCH_64kPS_RAB_SRB is configured, tsc_DL_DPCH1
    v_Tgps_Reconfiguration_CFN := (v_FrameNumber+(250-v_TtiValue )) mod 256;
    v_TGCFN := (v_FrameNumber+(252-v_TtiValue )) mod 256;
    
    //refresh security info
    v_SecurityInfo := f_UTRAN_Security_Get ( );
    
    //@siclog "Step 8" siclog@
    //ss tx a measurement control to setup inter-RAT on cell 5
    U_AM.send ( cas_RLC_Data_Req_NoCnf ( utran_Cell5,
                                         tsc_RB2,
                                         cs_MeasurementControl_InterRATMeasurement ( v_SecurityInfo.dl_IntegrityCheckInfo,
                                                                                     v_RRC_TI,
                                                                                     v_EUTRASysInfo.Eutra[0].Arfcn,
                                                                                     v_EUTRA_MeasurementBandwidth,
                                                                                     v_Tgps_Reconfiguration_CFN,
                                                                                     v_TGCFN ) ) );
    
    
    
    // Send trigger from UTRAN side
    f_SendIRATCoOrd (EUTRA, cms_IRAT_Trigger);
    
    //@siclog "Step 9" siclog@
    //SS changes Cell1 and UTRAN cell5 level acc. to row T2 in table 8.4.2.2.3.2-1
    //* @desc Sets the cell power attenuation and stores the value in the EUTRA_CellInfo
    f_UTRAN_SetCellPower( utran_Cell5, v_T2_CPICH_Cell5, v_T2_PCCPCH_Cell5);
    
    // Wait for trigger from E-UTRA side
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger (EUTRA);
    
    //10 UE tx a measurement report on cell5
    U_AM.receive ( car_RLC_Data_Ind ( utran_Cell5,
                                      tsc_RB2,
                                      cr_MeasurementReport ) );
    
    if ( v_FDD_TDD_Mode == UTRAN_FDD ) {
      v_RRCConnectionConfigurationMessage := f_U_Encode_RRCConnectionReconfigurationEUTRAMessage_FDD ( );
    }
    else {
      v_RRCConnectionConfigurationMessage := f_U_Encode_RRCConnectionReconfigurationEUTRAMessage_TDD ( );
    }
    
    //@siclog "Step 11" siclog@
    //SS tx a handover from utran command on cell5
    U_AM.send ( cas_RLC_Data_Req_NoCnf( utran_Cell5,
                                        tsc_RB2,
                                        cs_HandoverFromUTRANCommand_EUTRA ( v_SecurityInfo.dl_IntegrityCheckInfo,
                                                                            v_RRC_TI,
                                                                            v_RRCConnectionConfigurationMessage ) ) );
    
    // Send trigger from UTRAN side
    f_SendIRATCoOrd (EUTRA, cms_IRAT_Trigger);
    
    //* @desc Wait for the end of the test case
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger ( EUTRA );
    
    //postamble
    f_UTRAN_TestBody_Set( false );
    
    //* @desc Release UTRAN Cell 5
    f_UTRAN_ReleaseCell ( utran_Cell5 );
  }
  
  //---------------------------
  //* @desc Test case 8.4.2.4 Inter-RAT Handover / from UTRA(HSDPA) to E-UTRA  / Data
  function f_TC_8_4_2_4_UTRAN() runs on UTRAN_PTC
  {
    var boolean v_TriggerRxd := false;
    var UTRAN_FDD_TDD v_FDD_TDD_Mode;
    //@sic Removed T0 from CR R5-104790 @sic
    var integer v_T1_CPICH_Cell5 := -65;
    var integer v_T1_PCCPCH_Cell5 := -67;
    var integer v_T2_CPICH_Cell5 := -115;
    var integer v_T2_PCCPCH_Cell5 := -67;
    
    var UTRAN_SecurityInfo_Type v_SecurityInfo;
    var RRC_TransactionIdentifier v_RRC_TI := 0;
    var TGCFN v_TGCFN;
    var TGPS_Reconfiguration_CFN v_Tgps_Reconfiguration_CFN;
    var integer v_FrameNumber;
    var integer v_TtiValue := 4; //cell_DCH_HS_DSCH is configured
    
    var octetstring v_RRCConnectionConfigurationMessage;
    var IRAT_CoOrd_SysInfo_Type v_EUTRASysInfo;
    
    var EUTRA_MeasurementBandwidth v_EUTRA_MeasurementBandwidth := f_UTRAN_ConvertIntegerToEUTRA_MeasurementBandwidth(f_ConvertDL_BandwidthPIXITToInteger());

    //* @desc Initialise all cells
    f_UTRAN_Init ( EUTRA_UTRAN );

    v_SecurityInfo := f_UTRAN_Security_Get ( );

    //Send the cell info to the EUTRA component
    f_UTRAN_Send_IR_SysInfoToEUTRA ( utran_Cell5 );
    
    //Get Cell Parameters for EUTRA cell
    v_EUTRASysInfo := f_WaitForIRATCoOrd_SysInfo (EUTRA);
    
    //* @desc Create and configure Cell 5
    //* Cell started switched on with default power level, -60 and max attenuation
    f_SS_CreateCellDCH ( utran_Cell5 );

    //* @desc Start sending System Information
    f_UTRAN_SendDefSysInfo ( utran_Cell5 );

    //UE starts registered in EUTRA, wait its Auth Params
    f_UTRAN_InterRAT_InitialiseAuthParams();
    
    //* @desc Get FDD or TDD mode
    v_FDD_TDD_Mode := f_UTRAN_CellInfo_GetFDD_TDD ( utran_Cell5 );
        
    f_UTRAN_TestBody_Set( true );
    
    //@siclog "Step 1" siclog@
    //The SS changes Cell 1 and Cell 5 level according to the row "T1" in table 8.4.2.4.3.2-1.
    f_UTRAN_SetCellPower( utran_Cell5, v_T1_CPICH_Cell5, v_T1_PCCPCH_Cell5);
 
    //@siclog "Step 2" siclog@
    //Generic procedure in 36.508 subclause 6.4.2.8 is performed on cell 5
    f_UTRAN_508CheckCampOnNewUtranCell ( utran_Cell5 );
    
    //@siclog "Step 3 and 4" siclog@
    //34.108 subclause 7.2.4.2.3 on cell5
    f_UTRAN_UE_HSDPA_Rb_Est( utran_Cell5 );
    
    //@siclog "Step 5 - 6" siclog@
    //SS tx a phy channel reconfig on cell5 and UE tx a phy channel reconfig complete on cell5
    f_UTRAN_PhyChReconf_InterRatCompresseModeActivate ( utran_Cell5 );
    
    v_FrameNumber := f_CPHY_GetFrameNumber (utran_Cell5, tsc_DL_DPCH1 );
    //Physical Channel identity is hardcoded to the value set in cell_DCH_HS_DSCH is configured, tsc_DL_DPCH1
    v_Tgps_Reconfiguration_CFN := (v_FrameNumber+(250-v_TtiValue )) mod 256;
    v_TGCFN := (v_FrameNumber+(252-v_TtiValue )) mod 256;
    
    //refresh security info
    v_SecurityInfo := f_UTRAN_Security_Get ( );
    
    //@siclog "Step 8" siclog@
    //ss tx a measurement control to setup inter-RAT on cell 5
    U_AM.send ( cas_RLC_Data_Req_NoCnf ( utran_Cell5,
                                         tsc_RB2,
                                         cs_MeasurementControl_InterRATMeasurement ( v_SecurityInfo.dl_IntegrityCheckInfo,
                                                                                     v_RRC_TI,
                                                                                     v_EUTRASysInfo.Eutra[0].Arfcn,
                                                                                     v_EUTRA_MeasurementBandwidth,
                                                                                     v_Tgps_Reconfiguration_CFN,
                                                                                     v_TGCFN ) ) );
    
    // Send trigger from UTRAN side
    f_SendIRATCoOrd (EUTRA, cms_IRAT_Trigger);
    
    //@siclog "Step 9" siclog@
    //SS changes Cell1 and UTRAN cell5 level acc. to row T2 in table 8.4.2.4.3.2-1
    //* @desc Sets the cell power attenuation and stores the value in the EUTRA_CellInfo
    f_UTRAN_SetCellPower( utran_Cell5, v_T2_CPICH_Cell5, v_T2_PCCPCH_Cell5);
    
    // Wait for trigger from E-UTRA side
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger (EUTRA);
    
    //@siclog "Step 10" siclog@
    //UE tx a measurement report on cell5
    U_AM.receive ( car_RLC_Data_Ind ( utran_Cell5,
                                      tsc_RB2,
                                      cr_MeasurementReport ) );
    
    if ( v_FDD_TDD_Mode == UTRAN_FDD ) {
      v_RRCConnectionConfigurationMessage := f_U_Encode_RRCConnectionReconfigurationEUTRAMessage_FDD ( );
    }
    else {
      v_RRCConnectionConfigurationMessage := f_U_Encode_RRCConnectionReconfigurationEUTRAMessage_TDD ( );
    }
    
    //@siclog "Step 11" siclog@
    //SS tx a handover from utran command on cell5
    U_AM.send ( cas_RLC_Data_Req_NoCnf ( utran_Cell5,
                                         tsc_RB2,
                                         cs_HandoverFromUTRANCommand_EUTRA ( v_SecurityInfo.dl_IntegrityCheckInfo,
                                                                             v_RRC_TI,
                                                                             v_RRCConnectionConfigurationMessage ) ) );
    
    // Send trigger from UTRAN side: generic procedure in 36.508 subclause 6.4.2.10 on cell1
    f_SendIRATCoOrd (EUTRA, cms_IRAT_Trigger);
    
    //* @desc Wait for the end of the test case
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger ( EUTRA );
    
    //postamble
    f_UTRAN_TestBody_Set( false );
    
    //* @desc Release UTRAN Cell 5
    f_UTRAN_ReleaseCell ( utran_Cell5 );
  }
}
