Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Using encode function of TTCN_Buffer
Using encode function of TTCN_Buffer [message #1712068] Wed, 21 October 2015 08:17 Go to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Hi all,

i'm implementing a test port for a communication standard for metering. I defined my datatypes like this :
	type record WmbusFrameA
	{
	  WmbusDLLheader	dllheader,
	  WmbusCRC			crc,
	  WmbusAPLheader 	aplheader,
	  octetstring       payload 
	}

For sending messages of these complex datatype, i want to convert it to raw format and have just a buffer with the data. I saw in the api guide the functions of the TTCN_Buffer and also a example witch do what i want (see page 42/43 of apiguide.pdf).

My outgoing_send functions for this type looks like this:
void LcmTP__Port::outgoing_send(const LibWmbus__TypesAndValues::WmbusFrameA& send_par)
{

	TTCN_Buffer buf;
	send_par.encode(LibWmbus__TypesAndValues::WmbusFrameA_descr_, buf, TTCN_EncDec::CT_RAW);
....


The Problem is:
error: 'const class LibWmbus__TypesAndValues::WmbusFrameA' has no member named 'encode


Why has my type no encode function ?

best regards
Re: Using encode function of TTCN_Buffer [message #1712071 is a reply to message #1712068] Wed, 21 October 2015 08:23 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
One remark: It is possible to disable generation of encoding/coding functionalities with a compiler flag. But I have already checked, it isn't set.
Re: Using encode function of TTCN_Buffer [message #1712073 is a reply to message #1712068] Wed, 21 October 2015 08:32 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
HI Johannes , my guess is that you are missing two things:

-you need a with { encode "RAW" }; instruction at the end of the module:

module something {

:
:

}
with { encode "RAW" };



-for every type you want RAW encoded, you need a with { variant "....." };
instruction, which details how the type should be encoded/decoded
if you have no specific instructions (meaning that the defaults will kick in) still you need and empty with { variant "" }

This will indicate to the compiler that it has to generate the codec functions; else, to decrease the size of the generated code, it will not do so.


I hope this helps

Elemer


Re: Using encode function of TTCN_Buffer [message #1712080 is a reply to message #1712073] Wed, 21 October 2015 08:50 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Yes it helped, thanks ! One more question. This "with { variant ""} instructions are special for titan and not ttcn standard, aren't it ?
Re: Using encode function of TTCN_Buffer [message #1712084 is a reply to message #1712080] Wed, 21 October 2015 08:58 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Johannes,

that's right , variants are not standard, but implementation specific.
The standard leaves codec implementation details to tool manufacturers.

Regards

Elemer

Previous Topic:The binary RAW encoder of Titan : part III
Next Topic:The binary RAW encoder of Titan : part IV
Goto Forum:
  


Current Time: Thu Apr 25 10:46:32 GMT 2024

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

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

Back to the top