/******************************************************************************/
// @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-16 23:11:35 +0200 (Thu, 16 Sep 2010) $
// $Rev: 3943 $
/******************************************************************************/
module RRC_ConnRel_GERAN {

  import from GERAN_Component all;
  import from GERAN_CommonFunctions all;
  import from CommonIratDefs all;
  import from GERAN_TypeDefs all;

//==============================================================================
// Functions
//==============================================================================

  //RRC Connection Release: redirection from E-UTRAN to GERAN
  function f_TC_8_1_3_8_GERAN () runs on GERAN_PTC
  {
    var boolean v_TriggerRxd := false;
    var integer v_T0_RSSI_Cell24 := -70;

    //Initialise test case
    f_GERAN_Init ( EUTRA_GERAN );

    //Create GERAN cell and broadcast System Infomation
    f_GERAN_CreateCell ( geran_Cell24 );
    f_GERAN_InterRAT_InitialiseAuthParams();  // The UE starts in EUTRA, so wait for it to send the Auth Params

    //* @desc Coordinate with E-UTRA component to send GERAN frequencies
    f_GERAN_Send_IR_SysInfoToEUTRA ( geran_Cell24 );

    //Initial trigger: wait for trigger to set power level according to T0 and finish preamble
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger (EUTRA);

    //Set GERAN cell's power level for T0
    f_GERAN_SetCellPowerLevel( geran_Cell24, v_T0_RSSI_Cell24 );

    f_GERAN_TestBody_Set( true );
  //------------------------------------------------
  //Start TestBody

    //First Trigger: wait for Step1 at EUTRA side
    v_TriggerRxd := f_WaitForIRATCoOrd_Trigger (EUTRA);

    //@siclog "Step 2" siclog@
    //Check: does the test result of generic test procedure in 36.508 subclause 6.4.2.9 indicate that the UE is camped on GERAN Cell 24?
    f_GERAN_508CheckCampOnNewGeranCell( geran_Cell24 );

    //* @desc Tell the EUTRA component that test case is over
    f_SendIRATCoOrd ( EUTRA, cms_IRAT_Trigger );

  //End TestBody
  //------------------------------------------------
    f_GERAN_TestBody_Set ( false );

    f_GERAN_Postamble (geran_Cell24, G1_IDLE);

  }; //end of testcase 8.1.3.8

}
