/******************************************************************************/
// @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-15 17:58:51 +0200 (Wed, 15 Sep 2010) $
// $Rev: 3904 $
/******************************************************************************/
// Common type definitions, e.g. being used in ASP definitions as well as for NAS
//------------------------------------------------------------------------------
//* History:
//*   R5-096657   Added SMS command DELETE_MESSAGE_WITHFLAG
//------------------------------------------------------------------------------

module UpperTesterDefs {

  //----------------------------------------------------------------------------
  group TypeDefs_Common {       // types being used at the PTC <-> UpperTester interface as well as at the UpperTester <-> System interface

  type record Ut_Parameter_Type {               /* @status    APPROVED */
    charstring Name,            // name of the parameter/attribute
    charstring Value            // value (may need to be converted e.g. to integer)
  };

  type record of Ut_Parameter_Type Ut_ParameterList_Type;       /* @status    APPROVED */

  type enumerated Ut_CnfReq_Type {              /* @status    APPROVED */
    NO_CNF_REQUIRED,
    CNF_REQUIRED
  };

  type record UT_COMMON_CNF {                   /* Common confirmation triggered by the UE;
                                                   used at the system interface as well as at the inter PTC interface;
                                                   @status    APPROVED */
    boolean         Result,                     // true: success; false: failure
    charstring      ResultString  optional      // contains response from the UE (if there is any)
  };

  } // end of group TypeDefs_Common

  //----------------------------------------------------------------------------
  group TypeDefs_PTC_UT {       // types being used at the PTC <-> UpperTester interface

  type enumerated Ut_Common_Req_Type {          /* @status    APPROVED */
    SWITCH_ON,
    SWITCH_OFF,
    POWER_ON,
    POWER_OFF,
    INSERT_USIM,
    REMOVE_USIM,
    DEFINE_QOS,
    DEFINE_EPS_QOS,
    REQUEST_DED_BEARER,
    DEFINE_TFT,
    REQUEST_CS_CALL,
    CHECK_PLMN,
    PLMN_MANUAL,
    PLMN_AUTOMATIC,
    SELECT_PLMN,
    ACTIVATE_BEARER,
    REQUEST_PDPCONTEXT,
    DEACTIVATE_BEARER,
    MODIFY_BEARER,
    ATTACH,
    DETACH,
    DELETE_MESSAGE_WITHFLAG,
    SELECT_MESSAGE_SERVICE,
    SET_PREFERRED_STORAGE,
    MESSAGE_FORMAT,
    SELECT_CHARACTER_SET,
    SERVICE_CENTRE_ADDRESS,
    WRITE_MESSAGE_TOMEMORY_TEXTMODE,
    SEND_STORED_MESSAGE_ONE,
    SET_TEXTMODE_PARAMETERS,
    CHECK_MESSAGE_DISPLAYED,
    CONFIGURE_EPS_ATTACH,
    CONFIGURE_COMBINED_ATTACH,
    CHECK_CLOCK,
    CHECK_OPERATOR_NAME,
    DISABLE_EPS,
    ANSWER_CS_CALL
    // DO NOT ADD FIELDS TO THIS TYPE, TO BE EXTENDED BY FILE OWNER ONLY
  };

  type record UT_COMMON_CMD {                   /* Common ASP to be sent by a PTC to the upper tester (MTC);
                                                   @status    APPROVED */
    Ut_Common_Req_Type          Cmd,
    Ut_CnfReq_Type              CnfReq,
    Ut_ParameterList_Type       ParameterList optional  // to be used to include any additional information required
  };

  } // end of group TypeDefs_PTC_UT

  //----------------------------------------------------------------------------
  group TypeDefs_UT_System {    // types being used at the UpperTester <-> System interface

  type record MMI_Cmd_Type {                            /* @status    APPROVED */
    charstring Cmd,                                     /* commands corresponding to Ut_Common_Req_Type (e.g. "SelectPLMN");
                                                           it is a charstring rather than a enumerated to allow generic implementation in the system adaptor */
    Ut_ParameterList_Type ParameterList optional        /* additional information to perform the MMI:
                                                           e.g. for "SelectPLMN" this is {"MCC" <MCC value>}, {"MNC" <MNC value>} */

  };
  type union Ut_System_Cmd_Type {                       /* @status    APPROVED */
    charstring    AT,                                   /* to carry mandatory and optional AT commands */
    MMI_Cmd_Type  MMI                                   /* to carry MMI commands and optional AT commands */
  };
  type record UT_SYSTEM_REQ {                           /* @status    APPROVED */
    Ut_System_Cmd_Type  Cmd,
    boolean             CnfRequired                     /* true:  system adaptor shall reply with the confirmation gotten from the UE;
                                                         *        (corresponds to CNF_REQUIRED as being send by the PTC)
                                                         * false: SS shall swallow any confirmation generated by the UE
                                                         *        (corresponds to NO_CNF_REQUIRED as being send by the PTC)
                                                         * Notes: a confirmation shall only be requested in cases when there is no signalling
                                                         *        from the UE being triggered by the MMI/AT command */
  };
  } // end of group TypeDefs_UT_System

  // -----------------------------------------------------------------------------
  // Ports:
  type port UT_PTC_MTC_PORT message {   /* port at a PTC to communicated with the upper tester (MTC)
                                           @status    APPROVED */
    out UT_COMMON_CMD;
    in  UT_COMMON_CNF;
  };

  type port UT_MTC_PTC_PORT message {   /* port at the upper tester (MTC) to communicated with a PTC
                                           @status    APPROVED */
    out UT_COMMON_CNF;
    in  UT_COMMON_CMD;
  };

  type port MTC_System_Ut message {     /* Upper Tester: Port at MTC to be connected with system
                                           @status    APPROVED */
    out UT_SYSTEM_REQ;
    in  UT_COMMON_CNF;
  };

  // -----------------------------------------------------------------------------
  //Templates:
  template (value) Ut_ParameterList_Type cs_EPSBearerParams ( charstring p_Id,
                                                              charstring p_Type,
                                                              charstring p_AccessPointName,
                                                              charstring p_DComp,
                                                              charstring p_HComp,
                                                              charstring p_PDL,
                                                              charstring p_PDN,
                                                              charstring p_IPv4Alloc ) :=
  {
    {// Minimum value 1
      Name := "EPS ID",
      Value := p_Id
    },
    { // values: X.25, IP, IPV6, IPV4V6, PPP
      Name := "PDP TYPE",
      Value := p_Type
    },
    {
      Name := "APN",
      Value := p_AccessPointName
    },
    {
      Name := "D COMP",
      Value := p_DComp
    },
    {
      Name := "H COMP",
      Value := p_HComp
    },
    {
      Name := "PD L",
      Value := p_PDL
    },
    {
      Name := "PD N",
      Value := p_PDN
    },
    {
      Name := "IPv4ADDR",
      Value := p_IPv4Alloc
    }
  };

}
