Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » External functions returning templates(How to set omit in the return value of an external function implementation)
External functions returning templates [message #1827876] Tue, 26 May 2020 08:08 Go to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 127
Registered: November 2018
Senior Member
Hi Titan experts,

Unfortunately my TTCN ATS defines one external function returning a template. Below a simplified example:

  external function fx_Test(octetstring p_Data) return template (omit) octetstring;


The idea is that in particular data conditions the external function returns omit
My test implementation (not yet correct) in C is:

 OCTETSTRING_template fx__Test(const OCTETSTRING &p_Data) {
  
    const uint8_t *data_in = p_Data;
    uint8_t data_out[2];
    OCTETSTRING_template v_ReturnVal;

    data_out[0] = data_in[0];
    data_out[1] = data_in[1];
    if (data_in[0] == 0x0) {
      // FFS - Set v_ReturnVal to omit
      return v_ReturnVal;
    }
   v_ReturnVal = OCTETSTRING(2, data_out);
    return v_ReturnVal;
  }
 


My question: How can I set in my C implementation v_ReturnVal to omit?

Thanks for any hint,
Olaf
Re: External functions returning templates [message #1827892 is a reply to message #1827876] Tue, 26 May 2020 12:35 Go to previous messageGo to next message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 55
Registered: February 2016
Member
Hi,

like this:

v_ReturnVal = OMIT_VALUE;


Best regards,
Botond
Re: External functions returning templates [message #1827900 is a reply to message #1827892] Tue, 26 May 2020 14:19 Go to previous message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 127
Registered: November 2018
Senior Member
Thanks, Botond! It works as you say !

A happy TTCN programmer,
Olaf
Previous Topic:TITAN installation tutorial video for Windows with compiling on Cygwin.
Next Topic:Titan for UE testing for 3GPP Release 15 and beyond
Goto Forum:
  


Current Time: Fri Sep 20 08:03:49 GMT 2024

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

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

Back to the top