/******************************************************************************/
// @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.
//   (c) 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).
//   All rights reserved.
// @version: IWD_23wk37
// $Date: 2022-06-14 15:51:23 +0200 (Tue, 14 Jun 2022) $
// $Rev: 33641 $
/******************************************************************************/

module SMS_Templates {
  
  import from CommonDefs all;
  import from SMS_TypeDefs all;
  
  template (value) TransactionIdentifier_Type cs_MT_TI0_FromSS :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    tI_Flag := '0'B,
    tI_Value := '000'B
  };
  
  template (value) TransactionIdentifier_Type cs_MT_TI1_FromSS :=
  { /* @status    APPROVED (NR5GC) */
    tI_Flag := '0'B,
    tI_Value := '001'B
  };
  
  template (present) TransactionIdentifier_Type cr_MT_TI0_FromUE :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    tI_Flag := '1'B,
    tI_Value := '000'B
  };

  template (present) TransactionIdentifier_Type cr_MT_TI1_FromUE :=
  { /* @status    APPROVED (NR5GC) */
    tI_Flag := '1'B,
    tI_Value := '001'B
  };
  
  template (present) TransactionIdentifier_Type cr_MO_AnyTI_FromUE :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    tI_Flag := '0'B,
    tI_Value := '???'B
  };
  
  template (present) TypeOfNumberingPlan cr_TypeOfNumberingPlanAny :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    extBit := ?,
    typeOfNumber := ?,
    numberingPlanId := ?
  };
  
  template (value) TypeOfNumberingPlan cs_TypeOfNumberingPlan :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    extBit := '1'B,
    typeOfNumber := '001'B, // international number
    numberingPlanId := '0001'B // ISDN/telephony numbering plan (Rec. E.164/E.163)
  };
  
  /* End Non-SMS Type Constraints */
  
  
  template (value) CP_UserData_Type cs_CP_UserData_DELIVER (octetstring p_Digits):=
  { /* @status    APPROVED (LTE, NR5GC) */
    spare := omit,
    iei := omit,
    iel := int2oct ((162 + lengthof (p_Digits)), 1), // 162 = 153 + 1 + 5 + 3=size of cs_RP_OriginatorAddress_dl
    rP_PDU := {RP_DATA_dl := cs_RP_DATA_dl_DELIVER (p_Digits)}
  };
  
  template (value) CP_UserData_Type cs_CP_UserData_SUBMIT_REPORT(O1_Type p_MsgRef) :=
  {
    // @sic R5s100604 sic@
    spare := omit,
    iei := omit,
    iel := '0D'O, // the length of RPDU is 13
    rP_PDU := {RP_ACK := cs_RP_ACK_SUBMIT_REPORT(p_MsgRef)}
  };
  
  template (value) CP_UserData_Type cs_CP_UserData_RP_ACK_dl (O1_Type p_MsgRef):=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    // @sic R5s100604 sic@ @sic R5s110206 sic@
    spare := omit,
    iei := omit,
    iel := '02'O, // the length of RPDU is 2 as RP UserData are omitted now
    rP_PDU := {
      RP_ACK := cs_RP_ACK_dl(p_MsgRef)
    }
  };
  
  template (present) CP_UserData_Type cr_CP_UserData_SUBMIT(template (present) RP_DATA_ul_Type p_RP_DATA_ul := cr_RP_DATA_ul_SUBMIT) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    spare := omit,
    iei := omit,
    iel := ?,
    rP_PDU := {
      RP_DATA_ul := p_RP_DATA_ul
    }
  };
  
  template (present) CP_UserData_Type cr_CP_UserData_DELIVER_REPORT :=
  {
    spare := omit,
    iei := omit,
    iel := ?,
    rP_PDU := {
      RP_ACK := cr_RP_ACK_DELIVER_REPORT
    }
  };
  
  template (present) CP_UserData_Type cr_CP_UserData_RP_ACK_ul :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    spare := omit,
    iei := omit,
    iel := ?,
    rP_PDU := {
      RP_ACK := cr_RP_ACK_ul
    }
  };
  /* End SM-CP Type Constraints */

  /* SM-CP PDU Constraints */
  
  template (value) CP_DATA_Type cs_CP_DATA (template (value) TransactionIdentifier_Type p_TransactionIdentifier,
                                            template (omit) CP_UserData_Type p_CP_UserData) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    transactionIdentifier := p_TransactionIdentifier,
    protocolDiscriminator := tsc_PD_SMS,
    messageType := tsc_MT_CP_DATA,
    cP_UserData := p_CP_UserData
  };
  
  template (present) CP_DATA_Type cr_CP_DATA (template TransactionIdentifier_Type p_TransactionIdentifier,
                                              template CP_UserData_Type p_CP_UserData) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    transactionIdentifier := p_TransactionIdentifier,
    protocolDiscriminator := tsc_PD_SMS,
    messageType := tsc_MT_CP_DATA,
    cP_UserData := p_CP_UserData
  };
  
  template (value) CP_ACK_Type cs_CP_ACK(template (value) TransactionIdentifier_Type p_TransactionIdentifier) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    transactionIdentifier := p_TransactionIdentifier,
    protocolDiscriminator := tsc_PD_SMS,
    messageType := tsc_MT_CP_ACK
  };
  
  template (present) CP_ACK_Type cr_CP_ACK(template TransactionIdentifier_Type p_TransactionIdentifier) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    transactionIdentifier := p_TransactionIdentifier,
    protocolDiscriminator := tsc_PD_SMS,
    messageType := tsc_MT_CP_ACK
  };
  
  template (value) CP_ERROR_Type cs_CP_ERROR(TransactionIdentifier_Type p_TransactionIdentifier,
                                             CP_Cause_Type p_CP_Cause) :=
  {
    transactionIdentifier := p_TransactionIdentifier,
    protocolDiscriminator := tsc_PD_SMS,
    messageType := tsc_MT_CP_ERROR,
    cP_Cause := p_CP_Cause
  };
  
  template (present) CP_ERROR_Type cr_CP_ERROR(template (value) TransactionIdentifier_Type p_TransactionIdentifier,
                                               CP_Cause_Type p_CP_Cause) :=
  {
    transactionIdentifier := p_TransactionIdentifier,
    protocolDiscriminator := tsc_PD_SMS,
    messageType := tsc_MT_CP_ERROR,
    cP_Cause := p_CP_Cause
  };
  
  template (present) CP_PDU_Type cr_CP_DATA_PDU(template TransactionIdentifier_Type p_TransactionIdentifier,
                                                template CP_UserData_Type p_CP_UserData) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    CP_DATA := cr_CP_DATA (p_TransactionIdentifier, p_CP_UserData)
  };
  
  template (value) CP_PDU_Type cs_CP_DATA_PDU (template (value) TransactionIdentifier_Type p_TransactionIdentifier,
                                               template (value) CP_UserData_Type p_CP_UserData) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    CP_DATA := cs_CP_DATA (p_TransactionIdentifier, p_CP_UserData)
  };
  
  template (present) CP_PDU_Type cr_CP_ACK_PDU(template TransactionIdentifier_Type p_TransactionIdentifier) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    CP_ACK := cr_CP_ACK (p_TransactionIdentifier)
  };
  
  template (value) CP_PDU_Type cs_CP_ACK_PDU(template (value) TransactionIdentifier_Type p_TransactionIdentifier) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    CP_ACK := cs_CP_ACK (p_TransactionIdentifier)
  };
  
  /* End SM-CP PDU Constraints */
  
  /* SM-RP Type Constraints */
  
  template (omit) RP_OriginatorAddress_dl cs_RP_OriginatorAddress_dl :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    spare := omit,
    iei := omit,
    iel := '04'O, // 4 semi-octets   @sic R5s100586 sic@
    typeOfNumberingPlan := cs_TypeOfNumberingPlan,
    digits := '001122'O
  };
  
  template (present) RP_OriginatorAddress_ul cr_RP_OriginatorAddress_ul :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    spare := omit,
    iei := omit,
    iel := '00'O
  };
  
  template (present) RP_DestinationAddress_ul cr_RP_DestinationAddress_ul(template (present) octetstring p_Digits := ?) :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    spare := omit,
    iei := omit,
    iel := ?,
    typeOfNumberingPlan := cr_TypeOfNumberingPlanAny,
    digits := p_Digits
  };

  template (value) RP_DestinationAddress_dl cs_RP_DestinationAddress_dl :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    spare := omit,
    iei := omit,
    iel := '00'O
  };

  template (value) RP_UserData cs_RP_UserData_DELIVER (octetstring p_Digits) :=
  { /* @status    APPROVED (IMS, LTE, NR5GC) */
    spare := omit,
    iei := omit,
    iel := int2oct ((153 + lengthof (p_Digits)), 1),
    tP_PDU := {SMS_DELIVER := cs_SMS_DELIVER (p_Digits)}
  };
  
  template (value) RP_UserData cs_RP_UserData_SUBMIT_REPORT :=
  { /* @status    APPROVED (IMS, LTE_A_R12, NR5GC) */
    spare := tsc_Sparebit,
    iei := tsc_IEI_RP_UserData,
    iel := '09'O, // the TPDU data length is 9 octets  @sic R5s201325 sic@
    tP_PDU := {SMS_SUBMIT_REPORT := cs_SMS_SUBMIT_REPORT}
  };

  template (present) RP_UserData cr_RP_UserData_SUBMIT(template (present) SMS_SUBMIT_Type p_SMS_SUBMIT := cr_SMS_SUBMIT_VPF_REF) :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    /* NOTE: cr_SMS_SUBMIT_VPF_REF fits with AT command !! */
    spare := omit,
    iei := omit,
    iel := ?,
    tP_PDU := {
      SMS_SUBMIT := p_SMS_SUBMIT
    }
  };
  
  template (present) RP_UserData cr_RP_UserData_DELIVER_REPORT :=
  { /* @status    APPROVED (IMS) */
    spare := tsc_Sparebit,
    iei := tsc_IEI_RP_UserData,
    iel := ?,
    tP_PDU := {
      SMS_DELIVER_REPORT := cr_SMS_DELIVER_REPORT
    }
  };
  
  /* End SM-RP Type Constraints */
  
  /* SM-RP PDU Constraints */
  
  template (value) RP_DATA_dl_Type cs_RP_DATA_dl_DELIVER (octetstring p_Digits) :=
  { /* @status    APPROVED (IMS, LTE, NR5GC) */
    spare5 := '00000'B,
    rP_MessageTypeIndicator := tsc_MT_RP_DATA_dl,
    rP_MessageReference := int2oct(0, 1),
    rP_OriginatorAddress := cs_RP_OriginatorAddress_dl,
    rP_DestinationAddress := cs_RP_DestinationAddress_dl,
    rP_UserData := cs_RP_UserData_DELIVER(p_Digits)
  };
  
  template (present) RP_DATA_ul_Type cr_RP_DATA_ul_SUBMIT(template (present) RP_UserData p_RP_UserData := cr_RP_UserData_SUBMIT,
                                                          template (present) octetstring p_Digits := ?) :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    spare5 := '00000'B,
    rP_MessageTypeIndicator := tsc_MT_RP_DATA_ul,
    rP_MessageReference := ?,
    rP_OriginatorAddress := cr_RP_OriginatorAddress_ul,
    rP_DestinationAddress := cr_RP_DestinationAddress_ul(p_Digits),
    rP_UserData := p_RP_UserData
  };
  
  template (value) RP_ACK_Type cs_RP_ACK_SUBMIT_REPORT(O1_Type p_MsgRef) :=
  { /* @status    APPROVED (IMS, LTE_A_R12, NR5GC) */
    spare5 := '00000'B,
    rP_MessageTypeIndicator := tsc_MT_RP_ACK_dl,
    rP_MessageReference := p_MsgRef,   // @sic R5s100604 sic@
    rP_UserData := cs_RP_UserData_SUBMIT_REPORT
  };
  
  template (present) RP_ACK_Type  cr_RP_ACK_DELIVER_REPORT :=
  { /* @status    APPROVED (IMS) */
    spare5 := '00000'B,
    rP_MessageTypeIndicator := tsc_MT_RP_ACK_ul,
    rP_MessageReference := ?,
    rP_UserData := cr_RP_UserData_DELIVER_REPORT
  };
  
  template (value) RP_ACK_Type cs_RP_ACK_dl(O1_Type p_MsgRef) :=
  { /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC) */
    spare5 := '00000'B,
    rP_MessageTypeIndicator := tsc_MT_RP_ACK_dl,
    rP_MessageReference := p_MsgRef,   // @sic R5s100604 sic@
    rP_UserData := omit
  };
  
  template (present) RP_ACK_Type  cr_RP_ACK_ul :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    spare5 := '00000'B,
    rP_MessageTypeIndicator := tsc_MT_RP_ACK_ul,
    rP_MessageReference := ?,
    rP_UserData := *
  };
  
  /* End SM-RP PDU Constraints */
  
  /* SM-TP Type Constraints */
  template (present) TP_ProtocolIdentifier_Type cr_TP_ProtocolIdentifier :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    // @sic R5s100586 sic@
    pidType := '00'B,
    interworking := '0'B,
    pidValue := '00000'B  // @sic R5s100773 sic@
  };
  
  template (value) TP_ProtocolIdentifier_Type cs_TP_ProtocolIdentifier :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    // @sic R5s100586 sic@
    pidType := '00'B,
    interworking := '0'B,
    pidValue := '00000'B  // @sic R5s100773 sic@
  };
  
  template (value) TP_DataCodingScheme_Type cs_TP_DataCodingScheme :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, NBIOT, NR5GC) */
    codingGroup := '0000'B,
    codeValue := '0000'B
  };
  
  template (present) TP_Address_Type cr_TP_AddressAny :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    iel := ?,
    typeOfNumberingPlan := cr_TypeOfNumberingPlanAny,
    digits := *
  };
  
  template (value) TP_Address_Type cs_TP_Address (octetstring p_Digits) :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, NBIOT, NR5GC) */
    iel := int2oct(2 * lengthof(p_Digits), 1),
    // length is number of useful semi-octets
    // as p_digits is declared as octetstring the number must be even
    typeOfNumberingPlan := cs_TypeOfNumberingPlan,
    digits := p_Digits
  };
  
  template (present) TP_ParameterIndicator_Type cr_TP_ParameterIndicator := // @sic R5s210112, R5s211245, R5-217832 sic@
  { /* @status    APPROVED (IMS) */
    extBit1 := '0'B,
    spare4 := '0000'B,
    tP_UDL := '?'B,
    tP_DCS := '?'B,
    tP_PID := '?'B // @sic R5s201325 sic@
  };

  template (value) TP_ParameterIndicator_Type cs_TP_ParameterIndicator := // @sic R5s210112, R5s211245 sic@
  { /* @status    APPROVED (IMS, LTE_A_R12, NR5GC) */
    extBit1 := '0'B,
    spare4 := '0000'B,
    tP_UDL := '0'B,
    tP_DCS := '0'B,
    tP_PID := '0'B // @sic R5s201325 sic@
  };
  
  /* End SM-TP Type Constraints */
  
  /* SM-TP PDU Constraints */
  
  template (value) SMS_DELIVER_Type cs_SMS_DELIVER (octetstring p_Digits) :=
  { /* @status    APPROVED (IMS, LTE, NR5GC) */
    tP_ReplyPath := '0'B,
    tP_UserDataHeaderIndicator := '0'B,
    tP_StatusReportIndication := '0'B,
    spare2 := '00'B,
    tP_MoreMessagesToSend := '1'B,
    tP_MessageTypeIndicator := tsc_MT_SMS_DELIVER,
    tP_OriginatingAddress := cs_TP_Address (p_Digits),
    tP_ProtocolIdentifier := cs_TP_ProtocolIdentifier,
    tP_DataCodingScheme_Type := cs_TP_DataCodingScheme,
    tP_ServiceCentreTimeStamp := f_BCD_TimestampWithTimezone(),
    tP_UserDataLength := int2oct(160,1),
    tP_UserData := f_CharPacking_IA5toGsm7Bit(tsc_Fox, SMS_Packing)
  };
  
  template (present) SMS_DELIVER_REPORT_Type cr_SMS_DELIVER_REPORT :=
  { /* @status    APPROVED (IMS) */
    spare1 := '0'B,
    tP_UserDataHeaderIndicator  := '0'B,
    spare4 := '0000'B,
    tP_MessageTypeIndicator := tsc_MT_SMS_DELIVER_REPORT,
    tP_FailureCause := omit,
    tP_ParameterIndicator := cr_TP_ParameterIndicator, // @sic R5s210112, R5s211245 sic@
    tP_ProtocolIdentifier := *, // @sic R5-205345 sic@
    tP_DataCodingScheme_Type := *,
    tP_UserDataLength := *,
    tP_UserData := *
  };

  template (present) SMS_SUBMIT_Type cr_SMS_SUBMIT(template (present) B2_Type p_ValidityPeriodFormat := '??'B,
                                                   template TP_ValidityPeriod_Type p_ValidityPeriod := *,
                                                   template (present) TP_UserDataLength_Type p_UserDataLength := ?) :=
  { /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
    tP_ReplyPath := '?'B,
    tP_UserDataHeaderIndicator := '?'B,
    tP_StatusReportRequest := '?'B,
    tP_ValidityPeriodFormat := p_ValidityPeriodFormat,
    tP_RejectDuplicates := '?'B,
    tP_MessageTypeIndicator := tsc_MT_SMS_SUBMIT,
    tP_MessageReference := ?,
    tP_DestinationAddress := cr_TP_AddressAny,
    tP_ProtocolIdentifier := cr_TP_ProtocolIdentifier,
    tP_DataCodingScheme_Type := ?,
    tP_ValidityPeriod  := p_ValidityPeriod,
    tP_UserDataLength := p_UserDataLength, // @sic R5s120530 sic@
    tP_UserData := ? // any data will do
  };
  
  template (present) TP_ValidityPeriod_Type cr_TP_ValidityPeriod_Relative(integer p_Value) := { TP_ValidityPeriodRelative := int2oct(p_Value, 1) };  /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
  template (present) SMS_SUBMIT_Type cr_SMS_SUBMIT_VPF_REF := cr_SMS_SUBMIT('10'B, cr_TP_ValidityPeriod_Relative(167), int2oct(160, 1));             /* @status    APPROVED (IMS, LTE, LTE_A_PRO, LTE_A_R12, NBIOT, NR5GC) */
  template (present) SMS_SUBMIT_Type cr_SMS_SUBMIT_AnyVP := cr_SMS_SUBMIT(-, *);          /* @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC)
                                                                                             @sic R5s141400 sic@ @sic R5s150777 sic@ */

  template (value) SMS_SUBMIT_REPORT_Type cs_SMS_SUBMIT_REPORT :=
  { /* @status    APPROVED (IMS, LTE_A_R12, NR5GC) */
    spare1 := '0'B,
    tP_UserDataHeaderIndicator := '0'B,
    spare4 := '0000'B,
    tP_MessageTypeIndicator := tsc_MT_SMS_SUBMIT_REPORT,
    tP_FailureCause := omit,
    tP_ParameterIndicator := cs_TP_ParameterIndicator, // @sic R5s210112, R5s211245 sic@
    tP_ServiceCentreTimeStamp := f_BCD_TimestampWithTimezone(),
    tP_ProtocolIdentifier := omit, // @sic R5s201325 sic@
    tP_DataCodingScheme_Type := omit,
    tP_UserDataLength := omit,
    tP_UserData := omit
  };
  
  /* End SM-TP PDU Constraints */
  //----------------------------------------------------------------------------
  /*
   * @desc      wrapper function for encvalue
   * @param     p_CP_PDU
   * @return    octetstring
   * @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC)
   */
  function f_SMS_PDU_Encvalue(template (value) CP_PDU_Type p_CP_PDU) return octetstring
  {
    var bitstring v_Bitstring := encvalue(p_CP_PDU);
    var octetstring v_Octetstring := bit2oct(f_OctetAlignedBitString(v_Bitstring));
    return v_Octetstring;
  }

  //----------------------------------------------------------------------------
  /*
   * @desc      Decode given bitstring as CP_PDU and match it against the expected CP_PDU
   *            if the bitstring cannot be fully decoded or it does not match the expected CP_PDU verdict FAIL is assigned
   *            as the function is always used in the test body
   * @param     p_EncodedSMS_Message
   * @param     p_Expected_CP_PDU
   * @param     p_Testcase
   * @param     p_Step
   * @return    CP_PDU_Type
   * @status    APPROVED (LTE, LTE_A_PRO, NBIOT, NR5GC)
   */
  function f_SMS_CP_PDU_DecodeAndMatch(bitstring p_EncodedSMS_Message,
                                       template CP_PDU_Type p_Expected_CP_PDU,
                                       charstring p_Testcase,
                                       charstring p_Step) return CP_PDU_Type
  {
    var CP_PDU_Type v_Received_CP_PDU;
    var integer v_DecodeResult := decvalue(p_EncodedSMS_Message, v_Received_CP_PDU);
    
    if (v_DecodeResult != 0) {
      f_SetVerdict(fail,__FILE__, __LINE__, p_Testcase & ": SMS_CP_PDU cannot be decoded in " & p_Step);
      self.kill;    // => test case will be terminated immediately @sic R5s210140 sic@
    }
    if (not match(v_Received_CP_PDU, p_Expected_CP_PDU))  {
      //* @verdict fail Received decoded template does not match with the expected template
      f_SetVerdict(fail,__FILE__, __LINE__, p_Testcase & ": SMS_CP_PDU cannot be matched in " & p_Step);
      self.kill;    // => test case will be terminated immediately @sic R5s210140 sic@
    }
    return v_Received_CP_PDU;
  }

}
