Skip to main content



      Home
Home » Eclipse Projects » Eclipse Titan » Crosstag with nested elements
Crosstag with nested elements [message #1859732] Fri, 23 June 2023 11:21 Go to next message
Eclipse UserFriend
Hey guys,
I have the following situation: I have a record of two records.

    type record MME {
        MME_Header mme_header,
        MME_Payload mme_payload
    }


MME_Header looking like this:
  
type record MME_Header{
        MMV_TYPE mmv,
        MM_TYPE mmtype_hex optional,
        MMTYPE mmtype optional,
        Fmi_TYPE fmi optional,
        Fmsn_TYPE fmsn optional
    }


And MME_Payload like that:

type record MME_Payload{
        union  {
        CM_SLAC_PARM_REQ cm_slac_parm_req,
        CM_SLAC_PARM_CNF cm_slac_parm_cnf,
        CM_START_ATTEN_CHAR_IND cm_start_atten_char_ind,
        CM_ATTEN_CHAR_IND cm_atten_char_ind,
        CM_ATTEN_CHAR_RSP cm_atten_char_rsp,
        CM_ATTEN_PROFILE_IND cm_atten_profile_ind,
        CM_MNBC_SOUND_IND cm_mnbc_sound_ind,
        CM_VALIDATE_REQ cm_validate_req,
        CM_VALIDATE_CNF cm_validate_cnf,
        CM_SLAC_MATCH_REQ cm_slac_match_req,
        CM_SLAC_MATCH_CNF cm_slac_match_cnf,
        CM_SET_KEY_REQ cm_set_key_req,
        CM_SET_KEY_CNF cm_set_key_cnf,
        VS_PL_LNK_STATUS_REQ vs_pl_lnk_status_req,
        VS_PL_LNK_STATUS_CNF vs_pl_lnk_status_cnf,
        CM_AMP_MAP_REQ cm_amp_map_req,
        CM_AMP_MAP_CNF cm_amp_map_cnf,
        VS_HST_ACTION_REQ vs_hst_action_req,
        VS_HST_ACTION_RSP vs_hst_action_rsp,
        CM_NW_STATS_REQ cm_nw_stats_req,
        CM_NW_STATS_CNF cm_nw_stats_cnf
        } payload 
     }
     with {
        variant ""
     }


I now want the field mme_header.mmtype_hex to determine the selected union member of mme_payload.payload so I tried this:

    type record MME{
        MME_Header mme_header,
        MME_Payload mme_payload
    }
    with {
        variant (mme_payload.payload) "CROSSTAG(cm_slac_parm_cnf, mme_header.mmtype_hex = '6065'H )";
        variant (mme_header) "FORCEOMIT(mmtype)";
    }


(You can ignore the FORCEOMIT, thats just a workaround.

But it does not seem to work, the payload-Union is decoded as its first element always despite mme_header.mmtype_hex being set correctly.

Is this construct legal and supposed to work?

Thanks,
Moritz


[Updated on: Fri, 23 June 2023 11:23] by Moderator

Re: Crosstag with nested elements [message #1859733 is a reply to message #1859732] Fri, 23 June 2023 12:21 Go to previous messageGo to next message
Eclipse UserFriend
My twopence...

The field of the record to which CROSSTAG is added shall be the union it specifies. In your case the field mme_payload is a record, not a union. The purpose of the record wrapper in MME_Payload is unclear to me, it doesn't seem to do anything, so you can try:

type record MME{
MME_Header mme_header,
MME_Payload mme_payload
}
with {
variant (mme_payload) "CROSSTAG(
cm_slac_parm_cnf, mme_header.mmtype_hex = '6065'H;
<hex identifications for the other payload types>
)"
}

type union MME_Payload{
CM_SLAC_PARM_REQ cm_slac_parm_req,
...
} with {
variant ""
}
Re: Crosstag with nested elements [message #1859735 is a reply to message #1859733] Fri, 23 June 2023 13:30 Go to previous messageGo to next message
Eclipse UserFriend
Hey Gyorgy,
thanks for the response. I'm adapting an existing test suite and did want to avoid changes over all modules as often as possible but I think I will resort to that!

Thanks,
Moritz
Re: Crosstag with nested elements [message #1859737 is a reply to message #1859735] Fri, 23 June 2023 13:39 Go to previous message
Eclipse UserFriend
Small update: I guess the notation was used because template generation would be easier?

I am getting this error on a lot of templates:
 
error: value list notation cannot be used for union type `@DataStructure_SLAC.MME_Payload'


Example template:
    template MME_Payload md_CMN_CmAmpMapReq_002(
                        in template(present) Amlen_TYPE p_amlen,
                        in template(present) ListofAmdata_TYPE p_listAmdata) := {
        {
            cm_amp_map_req := {
                amlen := p_amlen ,
                listAmdata := p_listAmdata
            }
        }
    }

Previous Topic:Reference for a non-defined simpleType or complexType type: http://www.w3.org/2001/XMLSchema|anyType
Next Topic:Issue while decoding COER packet
Goto Forum:
  


Current Time: Tue Jul 15 09:52:38 EDT 2025

Powered by FUDForum. Page generated in 0.08216 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top