/******************************************************************************/
// @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 15:33:02 +0200 (Fri, 10 Sep 2010) $
// $Rev: 3842 $
/******************************************************************************/

module InterRat_CellReSelection_EtoC_CDMA2000 {
  /////////////////
  // Import Part //
  /////////////////
  
  import from CommonIratDefs all;
  import from CDMA2000_CellInfo all;
  import from CDMA2000_CommonFunctions all;
  import from CDMA2000_Component all;
  import from CDMA2000_CommonDefs all;
  
  //================================================================
  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.2.2.3
   * Inter-RAT Cell selection / From E-UTRA RRC_IDLE to HRPD Idle / Serving cell becomes non-suitable (SServingCell<0)
   * @status
   */
  function f_TC_6_2_2_3_CDMA2000 () runs on CDMA2000_PTC
  {
    const  PowerIor_Type tsc_Cell15_Ior := -60; //@sic R5-104718 sic@
    var boolean v_TriggerRxd := false;
    
    
    //Initialise test case
    f_CDMA2000_Init ( EUTRA_CDMA2000 );
    // Set MAX reference power corresponding to Ior/Ioc =-5 and -20 for cell 15 and 16 respectively
    // Note as cell 15 and 16 are on different frequency the
    f_CDMA2000_CellInfo_InitMaxReferencePower(cdma2000_Cell15, cs_CDMA2000_AbsoluteCellPowerDef(-55, tsc_Cell15_Ior));    //Ioc =-55, Ior/Ioc=-5, Pilot offset =0
    
    //Create CDMA2000 cell15 and broadcast System Infomation
    f_CDMA2000CreateCell ( cdma2000_Cell15 );
        
    //First Trigger: to Change cell power according to T0 after EUTRA Registration
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger (EUTRA);
    
    
    f_CDMA2000_TestBody_Set( true );
    //------------------------------------------------
    //Start TestBody
    //@siclog "Step 1" siclog@
    f_CDMA2000_SetCellPower( cdma2000_Cell15, tsc_Cell15_Ior );
    
    //@siclog "Step 3" siclog@
    f_CDMA2000_RegisterHRPDCell (cdma2000_Cell15);
    f_CDMA2000_PreliminaryPass(__FILE__, __LINE__, "UE has sent the Access probe and registered on HRPD cell");
    
    //End TestBody
    //------------------------------------------------
    f_CDMA2000_TestBody_Set ( false );
    // send coordination message for end of test case
    f_SendIRATCoOrd ( EUTRA, cms_IRAT_Trigger );
    // Swith off/power off and release cells
    
    f_CDMA2000_Postamble (cdma2000_Cell15
                       //UE is active and connected state
                       )
      
      }; //end of testcase 6.2.2.3
  
  //================================================================
  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.2.3.7
   * Inter-RAT cell reselection / From E-UTRA RRC_IDLE to HRPD Idle / HRPD cell is higher reselection priority than E-UTRA
   * @status
   */
  function f_TC_6_2_3_7_CDMA2000 () runs on CDMA2000_PTC
  {
    var boolean v_TriggerRxd := false;
    
    
    //Initialise test case
    f_CDMA2000_Init ( EUTRA_CDMA2000 );
    // Set MAX reference power corresponding to Tor/Ioc =-5 and -20 for cell 15 and 16 respectively
    // Note as cell 15 and 16 are on different frequency the
    f_CDMA2000_CellInfo_InitMaxReferencePower(cdma2000_Cell15, cs_CDMA2000_AbsoluteCellPowerDef(-75, -75));    //Ioc =-75, Ior/Ioc=0, Ior=-75, Pilot offset =-7
    
    //Create CDMA2000 cell15 and broadcast System Infomation
    f_CDMA2000CreateCell ( cdma2000_Cell15 );
    
    //First Trigger: to Change cell power according to T1 after EUTRA Registration
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger (EUTRA);
    
    
    f_CDMA2000_TestBody_Set( true );
    //------------------------------------------------
    //Start TestBody
    
    //@siclog "Step 2" siclog@
    f_CDMA2000_SetCellPower( cdma2000_Cell15, -88 ); //i.e attenuation of 13, Ior =-88 , Ioc=-75, results in Pilot Ec/Io = -20
    
    //@siclog "step 3-4"
    f_CDMA2000_CheckUEDoesNotCamponHRPDCell(cdma2000_Cell15 //wait timer of default 60 seconds
                                            );
    //@siclog "Step 5" siclog@
    
    f_CDMA2000_SetCellPower( cdma2000_Cell15, -75 ); //i.e attenuation of 0, Ior =-75 , Ioc=-75, results in Pilot Ec/Io = -10
    //@siclog "step 6" siclog@
    f_CDMA2000_RegisterHRPDCell (cdma2000_Cell15);
    f_CDMA2000_PreliminaryPass(__FILE__, __LINE__, "UE has sent the Access probe and registered on HRPD cell");
    
    
    //End TestBody
    //------------------------------------------------
    f_CDMA2000_TestBody_Set ( false );
    // Swith off/power off and release cells
    f_SendIRATCoOrd ( EUTRA, cms_IRAT_Trigger );
    // Swith off/power off and release cells
    
    f_CDMA2000_Postamble (cdma2000_Cell15
                       //UE is active and connected state
                       )
      
      }; //end of testcase 6.2.3.7
  
  //================================================================
  /*
   * @desc      REFERENCE TS 36.523-1 clause 6.2.3.8
   * Inter-RAT cell reselection / From E-UTRA RRC_IDLE to HRPD Idle / HRPD cell is higher reselection priority than E-UTRA
   * @status
   */
  function f_TC_6_2_3_8_CDMA2000 () runs on CDMA2000_PTC
  {
    var boolean v_TriggerRxd := false;
    
    //Initialise test case
    f_CDMA2000_Init ( EUTRA_CDMA2000 );
    // Set MAX reference power corresponding to Tor/Ioc =-5 and -20 for cell 15 and 16 respectively
    // Note as cell 15 and 16 are on different frequency the
    f_CDMA2000_CellInfo_InitMaxReferencePower(cdma2000_Cell15, cs_CDMA2000_AbsoluteCellPowerDef(-55, -55));    //Ioc =-55, Ior/Ioc=0, Ior=-55, Pilot offset =-7
    
    //Create CDMA2000 cell15 and broadcast System Infomation
    f_CDMA2000CreateCell ( cdma2000_Cell15 );
    
    
    //First Trigger: to Change cell power according to T1 after EUTRA Registration
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger (EUTRA);
    
    
    f_CDMA2000_TestBody_Set( true );
    //------------------------------------------------
    //Start TestBody
    
    //@siclog "Step 1" siclog@
    f_CDMA2000_SetCellPower( cdma2000_Cell15, -68 ); //i.e attenuation of 13, Ior =-68 , Ioc=-55, results in Pilot Ec/Io = -20
    
    //@siclog "step 3-4"
    f_CDMA2000_CheckUEDoesNotCamponHRPDCell(cdma2000_Cell15 //wait timer of default 60 seconds
                                            );
    //@siclog "Step 5" siclog@
    // send co-ordination message so that power level as per T2 can be configured
    f_SendIRATCoOrd ( EUTRA, cms_IRAT_Trigger );
    f_CDMA2000_SetCellPower( cdma2000_Cell15, -55 ); //i.e attenuation of 0, Ior =-55 , Ioc=-55, results in Pilot Ec/Io = -10
    //@siclog "step 6" siclog@
    f_CDMA2000_RegisterHRPDCell (cdma2000_Cell15);
    f_CDMA2000_PreliminaryPass(__FILE__, __LINE__, "UE has sent the Access probe and registered on HRPD cell");
    
    
    //End TestBody
    //------------------------------------------------
    f_CDMA2000_TestBody_Set ( false );
    // Swith off/power off and release cells
    
    f_CDMA2000_Postamble (cdma2000_Cell15
                       //UE is active and connected state
                       );
    
  }; //end of testcase 6.2.3.8
  //================================================================
  
}
