Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Issue with unknow subtypes [solved]
Issue with unknow subtypes [solved] [message #1713444] Wed, 04 November 2015 08:57 Go to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Hi all,

i contact with a strange behavior, see the comment at code:

import from LibMy_TypesAndValues all;
import from LibMy_Interface all;

/* Only this type will not be importet fom Lib, its strange */
type octetstring octet length(1);

/* Templates  */

template MyDLLheader mDLLh(integer l, octet c):={
  leng                                      := l,
  controllField                       := c,
  manufacturerID                := '86CE'O,
  originatorAddress             := '01000080'O,
  version                                := '23'O,
  typ                                        := '07'O
};
...


Here the LibMy_TypesAndValues.ttcn:

module LibMy_TypesAndValues
{
	type octetstring MyAddress length (4);
	type octetstring MyMfield length (2);
	type octetstring MyCRC	length (2);
	type octetstring MySignature length (2);
	type octetstring octet length (1); 

	type record MyDLLheader
	{
	  integer leng,
	  octet controllField,
	  MyMfield manufacturerID,
	  MyAddress originatorAddress,
	  octet version,
	  octet typ	  
	}with { variant "" }
...


Any idea ?

br Johannes

[Updated on: Wed, 04 November 2015 10:03]

Report message to a moderator

Re: Issue with unknow subtypes [message #1713453 is a reply to message #1713444] Wed, 04 November 2015 09:21 Go to previous messageGo to next message
Gyorgy Rethy is currently offline Gyorgy RethyFriend
Messages: 31
Registered: April 2015
Member
Hi Johannes,

Your code containing LibMy_TypesAndValues and the module with the template compiling to me without a problem. I suspect a name clashing problem. What is the error message?

If you have a definition with the name "octet" in the module LibMy_Interface as well, this would explain the problem. In this case both "octet"-s are imported, but in the module with the template it is not possible to decide which one is used as the type of the formal parameter. When you define a local type with name octet, and using it without name qualification, the local definition takes precedence over the imported ones and the code will compile.

If my assumption is correct, you have two options:
- import LibMy_TypesAndValues into LibMy_Interface as well and use octet from LibMy_TypesAndValues instead of defining another one in LibMy_Interface
- in the module containing your template use the qualified name LibMy_TypesAndValues.octet instead of octet.

I hope this helps Smile

Best Regards, György
Re: Issue with unknow subtypes [message #1713456 is a reply to message #1713444] Wed, 04 November 2015 09:25 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Johannes,

what is the error message you get ?


I tried

module mod2
{

import from LibMy_TypesAndValues all;


/* Only this type will not be importet fom Lib, its strange */
//type octetstring octet length(1);

/* Templates  */

template MyDLLheader mDLLh(integer l, octet c):={
  leng                                      := l,
  controllField                       := c,
  manufacturerID                := '86CE'O,
  originatorAddress             := '01000080'O,
  version                                := '23'O,
  typ                                        := '07'O
};




template octet t_octet:='AA'O;



}


and it compiled with no problem, so octet is imported.
What makes you think it is not?

Best regards

Elemer
Re: Issue with unknow subtypes [message #1713464 is a reply to message #1713456] Wed, 04 November 2015 09:54 Go to previous messageGo to next message
Johannes Bro is currently offline Johannes BroFriend
Messages: 56
Registered: June 2015
Member
Hi,
sorry its was to less explanation. It's not like you thought. But your answers helped me to find the mistake.
I need this redefinition of octet subtype otherwise it wasn't compilable. This message occur: It is not possible to resolve this reference unambigously, as it can be resolved to `@LibInterTestsys_TypesAndValues.octet' and to `@LibMys_TypesAndValues.octet'.
I did import another Lib on a other place witch also contain also a octet type...
The solution is to use another Lib for types which i need on more as one point. Then I just import this Lib.


Thank you very much for you fast reply and sorry for this mistake...

best regards

[Updated on: Wed, 04 November 2015 09:56]

Report message to a moderator

Re: Issue with unknow subtypes [message #1713472 is a reply to message #1713464] Wed, 04 November 2015 11:42 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Johannes, great news.

If you have a type defined with the same name in several modules , you can refer them differentiatedly by using the module name as a prefix:

in your case octet refers to the type octet defined in the same module, while LibMys_TypesAndValues.octet refers to the type octet defined in the module LibMys_TypesAndValues.

So it's not compulsory to rename the type, but you have to face the expense of longer references.

Best regards

Elemer

Previous Topic:Issue using Titan Execution Controller
Next Topic:Creation of testsets in titan Execution
Goto Forum:
  


Current Time: Fri Apr 19 08:09:57 GMT 2024

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

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

Back to the top